import java.util.Map;\r
import java.util.Vector;\r
\r
-import org.apache.log4j.Logger;\r
import org.eclipse.ui.views.properties.ComboBoxPropertyDescriptor;\r
import org.eclipse.ui.views.properties.IPropertyDescriptor;\r
import org.eclipse.ui.views.properties.IPropertySource;\r
import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
import eu.etaxonomy.taxeditor.propertysheet.reference.ReferencePropertySource;\r
import eu.etaxonomy.taxeditor.store.model.DescriptionUtil;\r
-import eu.etaxonomy.taxeditor.store.model.ReferenceUtil;\r
\r
/**\r
* @author p.ciardelli\r
* @version 1.0\r
*/\r
public class DescriptionElementPropertySource implements IPropertySource {\r
- private static final Logger logger = Logger\r
- .getLogger(DescriptionElementPropertySource.class);\r
\r
/**\r
* The DescriptionElement whose properties are being displayed\r
P_ID_MICROREF};\r
\r
private String[] P_FEATURE_CLASS_NAME_MENU;\r
- private Class[] P_FEATURE_CLASSES;\r
\r
/**\r
* Constructor for top level property fields. All fields that are not subfields\r
public DescriptionElementPropertySource(DescriptionElementBase descriptionElement, String parentid, \r
String[] keys) {\r
this.descriptionElement = descriptionElement;\r
- this.parentid = parentid;\r
+ this.setParentid(parentid);\r
for (String key : keys) {\r
addDescriptor(key);\r
}\r
if (id.equals(P_ID_ELEMENT_CLASS)) {\r
\r
Feature feature = descriptionElement.getFeature();\r
- Map<Class, String> supportedClasses = new HashMap<Class, String>();\r
+ Map<Class<?>, String> supportedClasses = new HashMap<Class<?>, String>();\r
\r
// Populate feature class arrays with classes supported by this feature\r
if (feature.supportsCommonTaxonName()) {\r
} \r
\r
P_FEATURE_CLASS_NAME_MENU = supportedClasses.values().toArray((new String[supportedClasses.size()]));\r
- P_FEATURE_CLASSES = supportedClasses.keySet().toArray(new Class[supportedClasses.size()]);\r
+ supportedClasses.keySet().toArray(new Class[supportedClasses.size()]);\r
\r
descriptors.addElement( \r
new ComboBoxPropertyDescriptor(P_ID_ELEMENT_CLASS, P_ELEMENT_CLASS, P_FEATURE_CLASS_NAME_MENU)\r
* @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()\r
*/\r
public IPropertyDescriptor[] getPropertyDescriptors() {\r
- return (IPropertyDescriptor[]) descriptors.toArray(\r
+ return descriptors.toArray(\r
new IPropertyDescriptor[descriptors.size()]);\r
}\r
\r
}\r
\r
if (id.equals(P_ID_BIBREF)) {\r
- ReferenceBase citation = descriptionElement.getCitation();\r
+ ReferenceBase<?> citation = descriptionElement.getCitation();\r
ReferencePropertySource bibRefPropertySource = new ReferencePropertySource(citation);\r
bibRefPropertySource.addPropertyChangeListener(new PropertyChangeListener() {\r
public void propertyChange(PropertyChangeEvent evt) {\r
- descriptionElement.setCitation((ReferenceBase) evt.getNewValue());\r
+ descriptionElement.setCitation((ReferenceBase<?>) evt.getNewValue());\r
}\r
});\r
return bibRefPropertySource;\r
\r
if (id.equals(P_ID_BIBREF)) {\r
if (value instanceof ReferenceBase) {\r
- descriptionElement.setCitation((ReferenceBase) value);\r
+ descriptionElement.setCitation((ReferenceBase<?>) value);\r
}\r
}\r
\r
public DescriptionElementBase getDescriptionElement() {\r
return descriptionElement;\r
}\r
+\r
+ /**\r
+ * @param parentid the parentid to set\r
+ */\r
+ public void setParentid(String parentid) {\r
+ this.parentid = parentid;\r
+ }\r
+\r
+ /**\r
+ * @return the parentid\r
+ */\r
+ public String getParentid() {\r
+ return parentid;\r
+ }\r
}\r