import org.eclipse.ui.views.properties.IPropertyDescriptor;\r
import org.eclipse.ui.views.properties.IPropertySource;\r
import org.eclipse.ui.views.properties.PropertyDescriptor;\r
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;\r
\r
+import eu.etaxonomy.cdm.common.CdmUtils;\r
import eu.etaxonomy.cdm.model.description.CommonTaxonName;\r
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
import eu.etaxonomy.cdm.model.description.Distribution;\r
import eu.etaxonomy.cdm.model.description.QuantitativeData;\r
import eu.etaxonomy.cdm.model.description.TaxonInteraction;\r
import eu.etaxonomy.cdm.model.description.TextData;\r
-import eu.etaxonomy.cdm.model.reference.Generic;\r
import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
import eu.etaxonomy.taxeditor.ITaxEditorConstants;\r
+import eu.etaxonomy.taxeditor.controller.DescriptionController;\r
+import eu.etaxonomy.taxeditor.controller.ReferenceController;\r
import eu.etaxonomy.taxeditor.propertysheet.reference.IReferenceSearch;\r
import eu.etaxonomy.taxeditor.propertysheet.reference.ReferencePropertySource;\r
import eu.etaxonomy.taxeditor.propertysheet.reference.ReferenceSearchDescriptor;\r
* Property unique keys\r
*/\r
public static final String P_ID_ELEMENT_CLASS = "element_class";\r
+ public static final String P_ID_ELEMENT_TEXT = "text";\r
public static final String P_ID_FEATURE = "feature";\r
public static final String P_ID_BIBREF = "bibref";\r
+ public static final String P_ID_MICROREF = "microref";\r
\r
/**\r
* Property display keys\r
* @see eu.etaxonomy.taxeditor.propertysheet.EditorPropertySheetEntry\r
*/\r
public static final String P_ELEMENT_CLASS = "01:Save element as";\r
- public static final String P_FEATURE = "00:Feature";\r
+ public static final String P_ELEMENT_TEXT = "00:Element";\r
+ public static final String P_FEATURE = "01:Feature";\r
public static final String P_BIBREF = "02:Bibliographic Reference";\r
+ public static final String P_MICROREF = "03:Reference Detail";\r
\r
-// protected static final String[] TOP_LEVEL_PROPERTIES = new String[] {P_ID_ELEMENT_CLASS, P_ID_FEATURE, P_ID_BIBREF};\r
- protected static final String[] TOP_LEVEL_PROPERTIES = new String[] {P_ID_BIBREF};\r
+ protected static final String[] TOP_LEVEL_PROPERTIES = \r
+ new String[] {P_ID_ELEMENT_TEXT, P_ID_FEATURE, P_ID_BIBREF, P_ID_MICROREF};\r
\r
private String[] P_FEATURE_CLASS_NAME_MENU;\r
private Class[] P_FEATURE_CLASSES;\r
}\r
\r
if (id.equals(P_ID_BIBREF)) {\r
- descriptors.addElement(new ReferenceSearchDescriptor(P_ID_BIBREF, P_BIBREF, IReferenceSearch.BIBREF) {\r
- protected void saveReference(ReferenceBase reference) {\r
- setPropertyValue(P_ID_BIBREF, reference);\r
- }\r
- }); \r
-// descriptors.addElement(new TextPropertyDescriptor(P_ID_BIBREF, P_BIBREF));\r
+// descriptors.addElement(new ReferenceSearchDescriptor(P_ID_BIBREF, P_BIBREF, IReferenceSearch.BIBREF) {\r
+// protected void saveReference(ReferenceBase reference) {\r
+// setPropertyValue(P_ID_BIBREF, reference);\r
+// }\r
+// }); \r
+ descriptors.addElement(new PropertyDescriptor(P_ID_BIBREF, P_BIBREF));\r
+ }\r
+ if (id.equals(P_ID_ELEMENT_TEXT)) {\r
+ descriptors.addElement(new TextPropertyDescriptor(P_ID_ELEMENT_TEXT, P_ELEMENT_TEXT));\r
+ }\r
+ \r
+ if (id.equals(P_ID_MICROREF)) {\r
+ descriptors.addElement(new TextPropertyDescriptor(P_ID_MICROREF, P_MICROREF));\r
}\r
}\r
\r
}\r
});\r
return bibRefPropertySource;\r
- } \r
+ }\r
+ \r
+ if (id.equals(P_ID_ELEMENT_TEXT)) {\r
+ return DescriptionController.getCache(descriptionElement); \r
+ }\r
+\r
+ if (id.equals(P_ID_MICROREF)) {\r
+ return CdmUtils.Nz(descriptionElement.getCitationMicroReference());\r
+ }\r
\r
return null;\r
}\r
descriptionElement.setCitation((ReferenceBase) value);\r
}\r
\r
- if (value instanceof String) {\r
- \r
- }\r
- ReferenceBase bibRef = descriptionElement.getCitation();\r
- if (bibRef == null) {\r
- bibRef = Generic.NewInstance();\r
- descriptionElement.setCitation(bibRef);\r
- }\r
+ ReferenceBase bibRef = \r
+ ReferenceController.getOrCreateCitation(descriptionElement);\r
\r
// "value" is the ReferencePropertySource, so we get the TitleCache from its\r
// toString() method\r
bibRef.setTitleCache(value.toString());\r
}\r
\r
+ if (id.equals(P_ID_ELEMENT_TEXT)) {\r
+ DescriptionController.setCache(descriptionElement, (String) value);\r
+ }\r
+ \r
+ if (id.equals(P_ID_MICROREF)) {\r
+ descriptionElement.setCitationMicroReference((String) value);\r
+ }\r
+ \r
descriptionElement.firePropertyChange(ITaxEditorConstants.PROPERTY_SHEET_CHANGE, null, null);\r
}\r
}\r