More work on BibRefPropertySource.
authorp.ciardelli <p.ciardelli@localhost>
Tue, 11 Nov 2008 16:32:02 +0000 (16:32 +0000)
committerp.ciardelli <p.ciardelli@localhost>
Tue, 11 Nov 2008 16:32:02 +0000 (16:32 +0000)
.gitattributes
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/DayValidator.java [new file with mode: 0644]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/TimePeriodPropertySource.java [new file with mode: 0644]
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/bibref/BibRefPropertySource.java

index 17329b31882ae8f986ebff533af0438b8fbbb92f..2fddcf3c75a3003fcd2d81d868e75e0d01bd4f41 100644 (file)
@@ -516,12 +516,14 @@ eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/CollectionPropertySource.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/CompletionProcessor.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/CustomSortPropertySheetEntry.java -text
+eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/DayValidator.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/MarkersPropertySource.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/PropertySheetContentProvider.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/PropertySheetValueEditingSupport.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/PropertySheetValueLabelProvider.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/PropertySourceAdapter.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/SourceViewerConfig.java -text
+eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/TimePeriodPropertySource.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/YearValidator.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/bibref/BibRefPropertySource.java -text
 eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/description/DescriptionElementPropertySource.java -text
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/DayValidator.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/DayValidator.java
new file mode 100644 (file)
index 0000000..512735c
--- /dev/null
@@ -0,0 +1,50 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+\r
+package eu.etaxonomy.taxeditor.propertysheet;\r
+\r
+import org.apache.log4j.Logger;\r
+import org.eclipse.jface.viewers.ICellEditorValidator;\r
+\r
+/**\r
+ * @author p.ciardelli\r
+ * @created 11.11.2008\r
+ * @version 1.0\r
+ */\r
+public class DayValidator implements ICellEditorValidator {\r
+       private static final Logger logger = Logger.getLogger(DayValidator.class);\r
+\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)\r
+        */\r
+       @Override\r
+       public String isValid(Object value) {\r
+               \r
+               String msg = "Value in day field must be an integer between 1-31."; \r
+               \r
+               if (((String) value).equals("")) {\r
+                       return null;\r
+               }\r
+               \r
+               Integer day = 0;\r
+               try {\r
+                       day = new Integer((String) value);\r
+               } catch (ClassCastException e) {\r
+                       return msg;\r
+               } catch (NumberFormatException e) {\r
+                       return msg;\r
+               }\r
+\r
+               if (day == 0 || day > 31) {\r
+                       return msg;\r
+               }\r
+               \r
+               return null;\r
+       }\r
+}\r
diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/TimePeriodPropertySource.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/TimePeriodPropertySource.java
new file mode 100644 (file)
index 0000000..71c38bd
--- /dev/null
@@ -0,0 +1,292 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy \r
+* http://www.e-taxonomy.eu\r
+* \r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+\r
+package eu.etaxonomy.taxeditor.propertysheet;\r
+\r
+import java.beans.PropertyChangeListener;\r
+import java.beans.PropertyChangeSupport;\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Calendar;\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 org.eclipse.ui.views.properties.PropertyDescriptor;\r
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;\r
+\r
+import eu.etaxonomy.cdm.model.common.TimePeriod;\r
+import eu.etaxonomy.taxeditor.ITaxEditorConstants;\r
+\r
+/**\r
+ * @author p.ciardelli\r
+ * @created 10.11.2008\r
+ * @version 1.0\r
+ */\r
+public class TimePeriodPropertySource implements IPropertySource {\r
+       private static final Logger logger = Logger\r
+                       .getLogger(TimePeriodPropertySource.class);\r
+       \r
+       private TimePeriod timePeriod;\r
+       \r
+       // Property unique keys\r
+       public static final String P_ID_STARTYEAR = "P_ID_STARTYEAR";\r
+       public static final String P_ID_STARTMONTH = "P_ID_STARTMONTH";\r
+       public static final String P_ID_STARTDAY = "P_ID_STARTDAY";\r
+       public static final String P_ID_ENDYEAR = "P_ID_ENDYEAR";\r
+       public static final String P_ID_ENDMONTH = "P_ID_ENDMONTH";\r
+       public static final String P_ID_ENDDAY = "P_ID_ENDDAY";\r
+               \r
+       // Property display keys\r
+       public static final String P_STARTYEAR = "00:Year (Start)";\r
+       public static final String P_STARTMONTH = "01:Month (Start)";\r
+       public static final String P_STARTDAY = "02:Day (Start)";\r
+       public static final String P_ENDYEAR = "03:Year (End)";\r
+       public static final String P_ENDMONTH = "04:Month (End)";\r
+       public static final String P_ENDDAY = "05:Day (End)";   \r
+\r
+       protected static final String[] TOP_LEVEL_PROPERTIES = \r
+               new String[] {P_ID_STARTYEAR, P_ID_STARTMONTH, P_ID_STARTDAY, \r
+                                               P_ID_ENDYEAR, P_ID_ENDMONTH, P_ID_ENDDAY};\r
+                       \r
+       private static final String[] P_MONTH_MENU = new String[] {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};\r
+       \r
+       public TimePeriodPropertySource(TimePeriod timePeriod) {\r
+               super();\r
+               \r
+               if (timePeriod == null) {\r
+                       timePeriod = TimePeriod.NewInstance();\r
+               }\r
+               this.timePeriod = timePeriod;\r
+\r
+               // Add property sheet descriptors\r
+               addDescriptor(P_ID_STARTYEAR);\r
+               if (!getPropertyValue(P_ID_STARTYEAR).equals("")) {\r
+                       \r
+                       // Only show start month and start day after start year has been populated\r
+                       addDescriptor(P_ID_STARTMONTH);\r
+                       addDescriptor(P_ID_STARTDAY);\r
+                       \r
+                       // Only show end if start has been populated\r
+                       addDescriptor(P_ID_ENDYEAR);\r
+                       \r
+                       if (!getPropertyValue(P_ID_ENDYEAR).equals("")) {\r
+                               // Only show end month and end day after end year has been populated\r
+                               addDescriptor(P_ID_ENDMONTH);\r
+                               addDescriptor(P_ID_ENDDAY);                             \r
+                       }       \r
+               }\r
+//             for (String key : TOP_LEVEL_PROPERTIES) {\r
+//                     addDescriptor(key);\r
+//             }\r
+       }\r
+       \r
+    //static date formatter\r
+    private static final DateFormat formatter = new SimpleDateFormat(\r
+            "EEEE, MMMM d, yyyy"); //$NON-NLS-1$\r
+\r
+    private Vector<PropertyDescriptor> descriptors = new Vector<PropertyDescriptor>();\r
+    \r
+    private void addDescriptor(String id) {\r
+        \r
+        if (id.equals(P_ID_STARTYEAR)) {\r
+               PropertyDescriptor descriptor = new TextPropertyDescriptor(P_ID_STARTYEAR, P_STARTYEAR);\r
+               descriptor.setValidator(new YearValidator());\r
+                       descriptors.addElement(descriptor);\r
+        }\r
+\r
+        if (id.equals(P_ID_STARTMONTH)) {\r
+               descriptors.addElement(new ComboBoxPropertyDescriptor(\r
+                               P_ID_STARTMONTH, P_STARTMONTH, P_MONTH_MENU));\r
+        }\r
+\r
+        if (id.equals(P_ID_STARTDAY)) {\r
+               PropertyDescriptor descriptor = new TextPropertyDescriptor(P_ID_STARTDAY, P_STARTDAY);\r
+               descriptor.setValidator(new DayValidator());\r
+                       descriptors.addElement(descriptor);\r
+        }\r
+        \r
+        if (id.equals(P_ID_ENDYEAR)) {\r
+               PropertyDescriptor descriptor = new TextPropertyDescriptor(P_ID_ENDYEAR, P_ENDYEAR);\r
+               descriptor.setValidator(new YearValidator());\r
+                       descriptors.addElement(descriptor);\r
+        }\r
+\r
+        if (id.equals(P_ID_ENDMONTH)) {\r
+               descriptors.addElement(new ComboBoxPropertyDescriptor(\r
+                               P_ID_ENDMONTH, P_ENDMONTH, P_MONTH_MENU));\r
+        }\r
+        \r
+        if (id.equals(P_ID_ENDDAY)) {\r
+               PropertyDescriptor descriptor = new TextPropertyDescriptor(P_ID_ENDDAY, P_ENDDAY);\r
+               descriptor.setValidator(new DayValidator());\r
+                       descriptors.addElement(descriptor);\r
+        }\r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * Method declared on IPropertySource\r
+     */\r
+    public Object getEditableValue() {\r
+        return "";\r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * Method declared on IPropertySource\r
+     */\r
+    public IPropertyDescriptor[] getPropertyDescriptors() {\r
+               return (IPropertyDescriptor[]) descriptors.toArray(\r
+                new IPropertyDescriptor[descriptors.size()]);\r
+    }\r
+\r
+    public Object getPropertyValue(Object id) {\r
+       \r
+       Calendar start = timePeriod.getStart();\r
+       Calendar end = timePeriod.getEnd();\r
+       \r
+       if (id.equals(P_ID_STARTYEAR)) {\r
+               return (start == null) ? "" : String.valueOf(start.get(Calendar.YEAR));\r
+       }\r
+       \r
+       if (id.equals(P_ID_STARTMONTH)) {\r
+               return (start == null) ? 0 : Integer.valueOf(start.get(Calendar.MONTH));\r
+       }\r
+\r
+       if (id.equals(P_ID_STARTDAY)) {\r
+               return (start == null) ? "" : String.valueOf(start.get(Calendar.DAY_OF_MONTH));\r
+       }\r
+       \r
+       if (id.equals(P_ID_ENDYEAR)) {\r
+               return (end == null) ? "" : String.valueOf(end.get(Calendar.YEAR));\r
+       }\r
+\r
+       if (id.equals(P_ID_ENDMONTH)) {\r
+               return (end == null) ? 0 : Integer.valueOf(end.get(Calendar.MONTH));\r
+       }\r
+\r
+       if (id.equals(P_ID_ENDDAY)) {\r
+               return (end == null) ? "" : String.valueOf(end.get(Calendar.DAY_OF_MONTH));\r
+       }\r
+       \r
+        return "";\r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * Method declared on IPropertySource\r
+     */\r
+    public boolean isPropertySet(Object property) {\r
+       return false;\r
+    }\r
+\r
+    /* (non-Javadoc)\r
+     * Method declared on IPropertySource\r
+     */\r
+    public void resetPropertyValue(Object property) {}\r
+\r
+    public void setPropertyValue(Object id, Object value) {\r
+       Calendar start = timePeriod.getStart();\r
+       Calendar end = timePeriod.getEnd();\r
+       \r
+       // Init start if necessary\r
+       if (id.equals(P_ID_STARTYEAR) || id.equals(P_ID_STARTMONTH) || \r
+                       id.equals(P_ID_STARTDAY) ) {\r
+               if (start == null) {\r
+                       start = Calendar.getInstance();\r
+                       timePeriod.setStart(start);\r
+                       \r
+                       // Default to January 1\r
+                       start.set(Calendar.DAY_OF_YEAR, 1);\r
+               }                               \r
+       }\r
+\r
+       // Init end if necessary\r
+       if (id.equals(P_ID_ENDYEAR) || id.equals(P_ID_ENDMONTH) || \r
+                       id.equals(P_ID_ENDDAY) ) {\r
+               if (end == null) {\r
+                       end = Calendar.getInstance();\r
+                       timePeriod.setEnd(end);\r
+                       \r
+                       // Default to January 1\r
+                       end.set(Calendar.DAY_OF_YEAR, 1);\r
+               }                               \r
+       }\r
+       \r
+       if (id.equals(P_ID_STARTYEAR)) {\r
+               \r
+                       // Empty year string, set start and end to null\r
+               if (((String) value).equals("")) {\r
+                       start = null;\r
+                       end = null;\r
+               } else {\r
+                       start.set(Calendar.YEAR, castToInteger(value));\r
+               }\r
+       }\r
+\r
+       if (id.equals(P_ID_STARTMONTH)) {\r
+               start.set(Calendar.MONTH, (Integer) value);\r
+       }\r
+\r
+       if (id.equals(P_ID_STARTDAY)) {\r
+               start.set(Calendar.DAY_OF_MONTH, castToInteger(value));\r
+       }\r
+       \r
+       if (id.equals(P_ID_ENDYEAR)) {\r
+\r
+                       // Empty year string, set end to null\r
+               if (((String) value).equals("")) {\r
+                       timePeriod.setEnd(null);\r
+               } else {\r
+                       end.set(Calendar.YEAR, castToInteger(value));\r
+               }\r
+       }\r
+\r
+       if (id.equals(P_ID_ENDMONTH)) {\r
+               end.set(Calendar.MONTH, (Integer) value);\r
+       }\r
+\r
+       if (id.equals(P_ID_ENDDAY)) {\r
+               end.set(Calendar.DAY_OF_MONTH, castToInteger(value));\r
+       }\r
+       \r
+       propertyChangeSupport.firePropertyChange(ITaxEditorConstants.PROPERTY_SHEET_CHANGE, null, timePeriod);\r
+    }\r
+\r
+    private int castToInteger(Object value) {\r
+       Integer integer;\r
+               try {\r
+                       integer = new Integer((String) value);\r
+               } catch (ClassCastException e) {\r
+                       integer = 0;\r
+               } catch (NumberFormatException e) {\r
+                       // Likely because value = ""\r
+                       integer = 0;\r
+               }\r
+       return integer;\r
+    }\r
+    \r
+    /**\r
+     * The value as displayed in the Property Sheet.\r
+     * @return java.lang.String\r
+     */\r
+    public String toString() {\r
+//        Date bday = (new GregorianCalendar(getYear().intValue(), getMonth()\r
+//                .intValue() - 1, getDay().intValue())).getTime();\r
+//        return formatter.format(bday);\r
+       return "";\r
+    }  \r
+\r
+       private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);\r
+       \r
+       public void addPropertyChangeListener(\r
+                       PropertyChangeListener listener) {\r
+               propertyChangeSupport.addPropertyChangeListener(listener);\r
+       }\r
+}\r
index 6385448b56743113ff63ed1ce61f9a4ac6531426..2b82a7504d8e53aa5a3b9fb84a644b14a5b553ce 100644 (file)
@@ -57,6 +57,7 @@ import eu.etaxonomy.cdm.model.reference.WebPage;
 import eu.etaxonomy.taxeditor.ITaxEditorConstants;\r
 import eu.etaxonomy.taxeditor.model.CdmUtil;\r
 import eu.etaxonomy.taxeditor.propertysheet.CheckboxPropertyDescriptor;\r
+import eu.etaxonomy.taxeditor.propertysheet.TimePeriodPropertySource;\r
 import eu.etaxonomy.taxeditor.propertysheet.YearValidator;\r
 \r
 /**\r
@@ -109,7 +110,6 @@ public class BibRefPropertySource implements IPropertySource {
        public static final String P_ID_DATEPUBLISHED = "P_ID_DATEPUBLISHED";\r
        public static final String P_ID_TITLE = "P_ID_TITLE";\r
        public static final String P_ID_INJOURNAL = "P_ID_INJOURNAL";\r
-       public static final String P_ID_NOMENCLATURAL_CITATION = "P_ID_NOMENCLATURAL_CITATION";\r
        public static final String P_ID_PAGES = "P_ID_PAGES";\r
        public static final String P_ID_SERIES = "P_ID_SERIES";\r
        public static final String P_ID_VOLUME = "P_ID_VOLUME";\r
@@ -140,7 +140,6 @@ public class BibRefPropertySource implements IPropertySource {
        public static final String P_ID_EPRINT = "P_ID_EPRINT";\r
        public static final String P_ID_NOTE = "P_ID_NOTE";\r
        public static final String P_ID_CROSSREF = "P_ID_CROSSREF";\r
-       public static final String P_ID_NOMREFBASE = "P_ID_NOMREFBASE"; \r
        \r
     // Property display keys\r
        public static final String P_REFERENCETYPE = "00:Reference Type";\r
@@ -151,7 +150,6 @@ public class BibRefPropertySource implements IPropertySource {
        public static final String P_DATEPUBLISHED = "05:Date Published";\r
        public static final String P_TITLE = "06:Title";\r
        public static final String P_INJOURNAL = "07:In Journal";\r
-       public static final String P_NOMENCLATURAL_CITATION = "08:Nomenclatural Citation";\r
        public static final String P_PAGES = "09:Pages";\r
        public static final String P_SERIES = "10:Series";\r
        public static final String P_VOLUME = "11:Volume";\r
@@ -181,11 +179,12 @@ public class BibRefPropertySource implements IPropertySource {
        public static final String P_MONTH = "35:Month";\r
        public static final String P_EPRINT = "36:E-Print";\r
        public static final String P_NOTE = "37:Note";\r
-       public static final String P_CROSSREF = "38:BibTeX Crossref";\r
-       public static final String P_NOMREFBASE = "39:Nomenclatural Citation";          \r
+       public static final String P_CROSSREF = "38:BibTeX Crossref";           \r
        \r
        private static HashMap<Class, String> referenceTypeMap = null;\r
        \r
+       private static final String[] P_BIBTEX_ENTRYTYPE_MENU = new String[] {"ARTICLE", "BOOK", "BOOKLET", "INBOOK", "INCOLLECTION", "PROCEEDINGS", "INPROCEEDINGS", "CONFERENCE", "MANUAL", "MASTERTHESIS", "PHDTHESIS", "TECHREPORT", "UNPUBLISHED", "MISC"};\r
+       \r
        private void populateReferenceTypes() {\r
                \r
                // LinkedHashMap maintains insertion order\r
@@ -258,7 +257,6 @@ public class BibRefPropertySource implements IPropertySource {
                        displayFields.add(P_ID_EPRINT);\r
                        displayFields.add(P_ID_NOTE);\r
                        displayFields.add(P_ID_CROSSREF);\r
-                       displayFields.add(P_ID_NOMREFBASE);\r
                }\r
 \r
                if (reference instanceof StrictReferenceBase) {\r
@@ -268,14 +266,12 @@ public class BibRefPropertySource implements IPropertySource {
 \r
                        if (referenceClass == Article.class) {\r
                                displayFields.add(P_ID_INJOURNAL);\r
-                               displayFields.add(P_ID_NOMENCLATURAL_CITATION);\r
                                displayFields.add(P_ID_PAGES);\r
                                displayFields.add(P_ID_SERIES);\r
                                displayFields.add(P_ID_VOLUME);\r
                        }\r
 \r
                        if (referenceClass == Generic.class) {\r
-                               displayFields.add(P_ID_NOMENCLATURAL_CITATION);\r
                                displayFields.add(P_ID_PAGES);\r
                                displayFields.add(P_ID_SERIES);\r
                                displayFields.add(P_ID_VOLUME);\r
@@ -337,7 +333,8 @@ public class BibRefPropertySource implements IPropertySource {
                                        displayFields.add(P_ID_VOLUME);\r
                                        \r
                                        if (referenceClass == Book.class) {\r
-                                               displayFields.add(P_ID_ISBN);                                           \r
+                                               displayFields.add(P_ID_ISBN);\r
+                                               displayFields.add(P_ID_EDITION);\r
                                        }\r
                                        \r
                                        if (referenceClass == Proceedings.class) {\r
@@ -353,7 +350,6 @@ public class BibRefPropertySource implements IPropertySource {
                                \r
                                if (referenceClass == BookSection.class) {\r
                                        displayFields.add(P_ID_INBOOK);\r
-                                       displayFields.add(P_ID_NOMENCLATURAL_CITATION);\r
                                }\r
                                \r
                                if (referenceClass == InProceedings.class) {\r
@@ -372,6 +368,8 @@ public class BibRefPropertySource implements IPropertySource {
        private TextPropertyDescriptor yearDescriptor;\r
        \r
        protected void addDescriptor(String id) {\r
+               \r
+               // Reference type\r
                if (id.equals(P_ID_REFERENCETYPE)) {\r
                        if (referenceTypeMap == null) {\r
                                populateReferenceTypes();\r
@@ -380,10 +378,14 @@ public class BibRefPropertySource implements IPropertySource {
                        descriptors.addElement(\r
                                        new ComboBoxPropertyDescriptor(P_ID_REFERENCETYPE, P_REFERENCETYPE, P_REFERENCETYPE_MENU));\r
                }\r
+               \r
+               // Author team\r
                if (id.equals(P_ID_AUTHORTEAM)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_AUTHORTEAM, P_AUTHORTEAM));                     \r
                }\r
+               \r
+               // Year\r
                if (id.equals(P_ID_YEAR)) {\r
                        yearDescriptor = new TextPropertyDescriptor(P_ID_YEAR, P_YEAR);\r
                        \r
@@ -393,95 +395,145 @@ public class BibRefPropertySource implements IPropertySource {
                        }\r
                        descriptors.addElement(yearDescriptor);         \r
                }\r
+               \r
+               // Citation\r
                if (id.equals(P_ID_CITATION)) {\r
                        descriptors.addElement(\r
-                                       new TextPropertyDescriptor(P_ID_CITATION, P_CITATION));                 \r
-               } \r
+                                       new PropertyDescriptor(P_ID_CITATION, P_CITATION));                     \r
+               }\r
+               \r
+               // URI\r
                if (id.equals(P_ID_URI)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_URI, P_URI));                   \r
                } \r
+               \r
+               // Date published\r
                if (id.equals(P_ID_DATEPUBLISHED)) {\r
                        descriptors.addElement(\r
-                                       new TextPropertyDescriptor(P_ID_DATEPUBLISHED, P_DATEPUBLISHED));                       \r
+                                       new PropertyDescriptor(P_ID_DATEPUBLISHED, P_DATEPUBLISHED));                   \r
                } \r
+               \r
+               // Title\r
                if (id.equals(P_ID_TITLE)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_TITLE, P_TITLE));                       \r
                } \r
+               \r
+               // In journal\r
                if (id.equals(P_ID_INJOURNAL)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_INJOURNAL, P_INJOURNAL));                       \r
-               } \r
-               if (id.equals(P_ID_NOMENCLATURAL_CITATION)) {\r
-                       descriptors.addElement(\r
-                                       new TextPropertyDescriptor(P_ID_NOMENCLATURAL_CITATION, P_NOMENCLATURAL_CITATION));                     \r
-               } \r
+               }\r
+               \r
+               // Pages\r
                if (id.equals(P_ID_PAGES)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_PAGES, P_PAGES));                       \r
                } \r
+               \r
+               // Series\r
                if (id.equals(P_ID_SERIES)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_SERIES, P_SERIES));                     \r
                } \r
+               \r
+               // Volume\r
                if (id.equals(P_ID_VOLUME )) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_VOLUME, P_VOLUME));                     \r
                }\r
+               \r
+               // Editor\r
                if (id.equals(P_ID_EDITOR)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_EDITOR, P_EDITOR));                     \r
                } \r
+\r
+               // Edition\r
+               if (id.equals(P_ID_EDITION)) {\r
+                       descriptors.addElement(\r
+                                       new TextPropertyDescriptor(P_ID_EDITION, P_EDITION));                   \r
+               } \r
+               \r
+               // Place published\r
                if (id.equals(P_ID_PLACEPUBLISHED)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_PLACEPUBLISHED, P_PLACEPUBLISHED));                     \r
                }\r
+               \r
+               // Publisher\r
                if (id.equals(P_ID_PUBLISHER)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_PUBLISHER, P_PUBLISHER));                       \r
                } \r
+               \r
+               // ISSN\r
                if (id.equals(P_ID_ISSN)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_ISSN, P_ISSN));                 \r
                } \r
+               \r
+               // Institution\r
                if (id.equals(P_ID_INSTITUTION)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_INSTITUTION, P_INSTITUTION));                   \r
                } \r
+               \r
+               // School\r
                if (id.equals(P_ID_SCHOOL)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_SCHOOL, P_SCHOOL));                     \r
                } \r
+               \r
+               // In series\r
                if (id.equals(P_ID_INSERIES)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_INSERIES, P_INSERIES));                 \r
                } \r
+               \r
+               // Series part\r
                if (id.equals(P_ID_SERIESPART)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_SERIESPART, P_SERIESPART));                     \r
                } \r
+               \r
+               // ISBN\r
                if (id.equals(P_ID_ISBN)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_ISBN, P_ISBN));\r
                }\r
+               \r
+               // Organization\r
                if (id.equals(P_ID_ORGANIZATION)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_ORGANIZATION, P_ORGANIZATION));                 \r
                } \r
+               \r
+               // Printed unit\r
                if (id.equals(P_ID_PRINTEDUNIT)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_PRINTEDUNIT, P_PRINTEDUNIT));                   \r
                } \r
+               \r
+               // In book\r
                if (id.equals(P_ID_INBOOK)) {\r
                        descriptors.addElement(\r
                                        new TextPropertyDescriptor(P_ID_INBOOK, P_INBOOK));                     \r
                } \r
-               if (id.equals(P_ID_INPROCEEDINGS)) {\r
+               \r
+               // In proceedings\r
+//             if (id.equals(P_ID_INPROCEEDINGS)) {\r
+//                     descriptors.addElement(\r
+////                                   new TextPropertyDescriptor(P_ID_INPROCEEDINGS, P_INPROCEEDINGS));\r
+//                                     new CheckboxPropertyDescriptor(P_ID_INPROCEEDINGS, P_INPROCEEDINGS));\r
+//             } \r
+               \r
+               // Bibtex entry type\r
+               if (id.equals(P_ID_BIBTEX_ENTRYTYPE)) {\r
                        descriptors.addElement(\r
-//                                     new TextPropertyDescriptor(P_ID_INPROCEEDINGS, P_INPROCEEDINGS));\r
-                                       new CheckboxPropertyDescriptor(P_ID_INPROCEEDINGS, P_INPROCEEDINGS));\r
-               } \r
+                                       new ComboBoxPropertyDescriptor(P_ID_BIBTEX_ENTRYTYPE, P_BIBTEX_ENTRYTYPE, P_BIBTEX_ENTRYTYPE_MENU));                    \r
+               }\r
        }\r
        \r
        /* (non-Javadoc)\r
@@ -504,9 +556,9 @@ public class BibRefPropertySource implements IPropertySource {
         */\r
        public Object getPropertyValue(Object id) {\r
                \r
-               if (id.equals(P_ID_INPROCEEDINGS)) {\r
-                       return Boolean.TRUE;\r
-               }\r
+//             if (id.equals(P_ID_INPROCEEDINGS)) {\r
+//                     return Boolean.TRUE;\r
+//             }\r
                \r
                // Reference Type: get integer index of drop-down menu\r
                if (id.equals(P_ID_REFERENCETYPE)) {\r
@@ -538,6 +590,36 @@ public class BibRefPropertySource implements IPropertySource {
                        return CdmUtils.Nz(reference.getYear());\r
                }\r
                \r
+               // Citation\r
+               if (id.equals(P_ID_CITATION)) {\r
+                       return CdmUtils.Nz(reference.getCitation());\r
+               }\r
+               \r
+               // URI\r
+               if (id.equals(P_ID_URI)) {\r
+                       return CdmUtils.Nz(reference.getUri());\r
+               }\r
+               \r
+               // Date published\r
+               if (id.equals(P_ID_DATEPUBLISHED)) {\r
+                       TimePeriod datePublished = (TimePeriod) invokeMethod(reference, "getDatePublished", null);\r
+                       \r
+                       if (datePublished == null) {\r
+                               datePublished = TimePeriod.NewInstance();\r
+                       }\r
+                       \r
+                       TimePeriodPropertySource timePeriodPropertySource = \r
+                                       new TimePeriodPropertySource(datePublished);\r
+                       timePeriodPropertySource.addPropertyChangeListener(new PropertyChangeListener() {\r
+                               public void propertyChange(PropertyChangeEvent evt) {\r
+                                       if (reference instanceof StrictReferenceBase && evt.getNewValue() instanceof TimePeriod) {      \r
+                                               ((StrictReferenceBase) reference).setDatePublished((TimePeriod) evt.getNewValue());\r
+                                       }\r
+                               }\r
+                       });\r
+                       return timePeriodPropertySource;\r
+               }\r
+               \r
                // Title: used by StrictReferenceBase\r
                if (id.equals(P_ID_TITLE)) {\r
                        String title = (String) invokeMethod(reference, "getTitle", null);\r
@@ -547,14 +629,7 @@ public class BibRefPropertySource implements IPropertySource {
                // InJournal: return an instance of BibRefPropertySource\r
                if (id.equals(P_ID_INJOURNAL)) {\r
                                \r
-                       Journal inJournal = null;\r
-                       try {\r
-                               inJournal = ((Article) reference).getInJournal();\r
-                       } catch (ClassCastException e) {\r
-                               // Leave method on class cast error\r
-                               logger.error(e.getMessage());\r
-                               return null;\r
-                       }\r
+                       Journal inJournal = (Journal) invokeMethod(reference, "getInJournal", null);\r
                        \r
                        if (inJournal == null) {\r
                                inJournal = Journal.NewInstance();\r
@@ -570,6 +645,103 @@ public class BibRefPropertySource implements IPropertySource {
                        });\r
                        return bibRefPropertySource;\r
                }\r
+               \r
+               // Pages\r
+               if (id.equals(P_ID_PAGES)) {\r
+                       String pages = (String) invokeMethod(reference, "getPages", null);\r
+                       return CdmUtils.Nz(pages);\r
+               }\r
+               \r
+               // Series\r
+               if (id.equals(P_ID_SERIES)) {\r
+                       String series = (String) invokeMethod(reference, "getSeries", null);\r
+                       return CdmUtils.Nz(series); \r
+               }\r
+\r
+               // Volume\r
+               if (id.equals(P_ID_VOLUME)) {\r
+                       String volume = (String) invokeMethod(reference, "getVolume", null);\r
+                       return CdmUtils.Nz(volume);                     \r
+               }\r
+\r
+               // Editor\r
+               if (id.equals(P_ID_EDITOR)) {\r
+                       String editor = (String) invokeMethod(reference, "getEditor", null);\r
+                       return CdmUtils.Nz(editor);                     \r
+               }\r
+\r
+               // Edition\r
+               if (id.equals(P_ID_EDITION)) {\r
+                       String edition = (String) invokeMethod(reference, "getEdition", null);\r
+                       return CdmUtils.Nz(edition);                    \r
+               }\r
+               \r
+               // Place published\r
+               if (id.equals(P_ID_PLACEPUBLISHED)) {\r
+                       String placePublished = (String) invokeMethod(reference, "getPlacePublished", null);\r
+                       return CdmUtils.Nz(placePublished);\r
+               }\r
+               \r
+               // Publisher\r
+               if (id.equals(P_ID_PUBLISHER)) {\r
+                       String publisher = (String) invokeMethod(reference, "getPublisher", null);\r
+                       return CdmUtils.Nz(publisher);                  \r
+               }\r
+\r
+               // ISSN\r
+               if (id.equals(P_ID_ISSN)) {\r
+                       String issn = (String) invokeMethod(reference, "getIssn", null);\r
+                       return CdmUtils.Nz(issn);                       \r
+               }\r
+\r
+               // Institution\r
+               if (id.equals(P_ID_INSTITUTION)) {\r
+                       String institution = (String) invokeMethod(reference, "getInstitution", null);\r
+                       return CdmUtils.Nz(institution);                        \r
+               }\r
+\r
+               // In series\r
+               if (id.equals(P_ID_INSERIES)) {\r
+                       \r
+               }\r
+               \r
+               // ISBN\r
+               if (id.equals(P_ID_ISBN)) {\r
+                       String isbn = (String) invokeMethod(reference, "getIsbn", null);\r
+                       return CdmUtils.Nz(isbn);                               \r
+               }\r
+\r
+               // Organization\r
+               if (id.equals(P_ID_ORGANIZATION)) {\r
+                       String organization = (String) invokeMethod(reference, "getOrganization", null);\r
+                       return CdmUtils.Nz(organization);                       \r
+               }\r
+               \r
+               // In book\r
+               if (id.equals(P_ID_INBOOK)) {\r
+                       \r
+                       Book inBook = (Book) invokeMethod(reference, "getInBook", null);\r
+                       \r
+                       if (inBook == null) {\r
+                               inBook = Book.NewInstance();\r
+                       }\r
+                       \r
+                       BibRefPropertySource bibRefPropertySource = new BibRefPropertySource(inBook);\r
+                       bibRefPropertySource.addPropertyChangeListener(new PropertyChangeListener() {\r
+                               public void propertyChange(PropertyChangeEvent evt) {\r
+                                       if (reference instanceof BookSection && evt.getNewValue() instanceof Book) {    \r
+                                               ((BookSection) reference).setInBook((Book) evt.getNewValue());\r
+                                       }\r
+                               }\r
+                       });\r
+                       return bibRefPropertySource;\r
+               }\r
+\r
+               // Bibtex entry type\r
+               if (id.equals(P_ID_BIBTEX_ENTRYTYPE)) {\r
+                       \r
+               }\r
+               \r
                return "";\r
        }\r
 \r
@@ -672,6 +844,12 @@ public class BibRefPropertySource implements IPropertySource {
                        }\r
                }\r
                \r
+               // Citation\r
+               if (id.equals(P_ID_URI)) {\r
+                       String uri = (String) value;\r
+                       reference.setUri(uri);\r
+               }\r
+               \r
                // Year\r
                if (id.equals(P_ID_YEAR)) {\r
                        String year = (String) value;\r
@@ -704,6 +882,71 @@ public class BibRefPropertySource implements IPropertySource {
                        }\r
                        invokeMethod(reference, "setTitle", title);\r
                }\r
+\r
+               // Pages\r
+               if (id.equals(P_ID_PAGES)) {\r
+                       invokeMethod(reference, "setPages", (String) value);\r
+               }\r
+\r
+               // Series\r
+               if (id.equals(P_ID_SERIES)) {\r
+                       invokeMethod(reference, "setSeries", (String) value);\r
+               }\r
+               \r
+               // Volume\r
+               if (id.equals(P_ID_VOLUME)) {\r
+                       invokeMethod(reference, "setVolume", (String) value);\r
+               }\r
+               \r
+               // Editor\r
+               if (id.equals(P_ID_EDITOR)) {\r
+                       invokeMethod(reference, "setEditor", (String) value);\r
+               }\r
+\r
+               // Edition\r
+               if (id.equals(P_ID_EDITION)) {\r
+                       invokeMethod(reference, "setEdition", (String) value);\r
+               }\r
+               \r
+               // Place published\r
+               if (id.equals(P_ID_PLACEPUBLISHED)) {\r
+                       invokeMethod(reference, "setPlacePublished", (String) value);\r
+               }\r
+\r
+               // Publisher\r
+               if (id.equals(P_ID_PUBLISHER)) {\r
+                       invokeMethod(reference, "setPublisher", (String) value);\r
+               }\r
+\r
+               // ISSN\r
+               if (id.equals(P_ID_ISSN)) {\r
+                       invokeMethod(reference, "setIssn", (String) value);\r
+               }\r
+\r
+               // Institution\r
+               if (id.equals(P_ID_INSTITUTION)) {\r
+                       invokeMethod(reference, "setInstitution", (String) value);                      \r
+               }\r
+               \r
+               // ISBN\r
+               if (id.equals(P_ID_ISBN)) {\r
+                       invokeMethod(reference, "setIsbn", (String) value);\r
+               }\r
+\r
+               // Organization\r
+               if (id.equals(P_ID_ORGANIZATION)) {\r
+                       invokeMethod(reference, "setOrganization", (String) value);\r
+               }\r
+\r
+               // In book\r
+               if (id.equals(P_ID_INBOOK)) {\r
+                       Book inBook = (Book) invokeMethod(reference, "getInBook", null);\r
+                       if (inBook == null) {\r
+                               inBook = Book.NewInstance();\r
+                               invokeMethod(reference, "setInBook", inBook);\r
+                       }\r
+                       inBook.setTitleCache((String) value);\r
+               }\r
                \r
                propertyChangeSupport.firePropertyChange(ITaxEditorConstants.PROPERTY_SHEET_CHANGE, null, reference);           \r
        }\r