OK, I think the endless loop bug is really solved this time.
authorp.ciardelli <p.ciardelli@localhost>
Wed, 18 Mar 2009 12:09:26 +0000 (12:09 +0000)
committerp.ciardelli <p.ciardelli@localhost>
Wed, 18 Mar 2009 12:09:26 +0000 (12:09 +0000)
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/EditorPropertySheetEntry.java
eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/type/TypeCollectionPropertySource.java

index 248a9b664c0a11c7c8aaf3d0ae903cc368150ea2..2d0206f87f62dd10516de9a8db18b8e4db417c5d 100644 (file)
@@ -89,9 +89,18 @@ public class EditorPropertySheetEntry extends PropertySheetEntry {
        return displayName;\r
     }\r
     \r
-    protected void valueChanged(PropertySheetEntry child) {\r
-       \r
-       super.valueChanged(child);\r
+//    protected void valueChanged(PropertySheetEntry child) {\r
+//     \r
+//     super.valueChanged(child);\r
+//     \r
+//     // If this is the top level of the property sheet, redraw the freetext area\r
+//     if (getParent() == null) {\r
+//             EditorController.redraw(taxon);  // causing infinite loops?\r
+//     }\r
+//    }\r
+    \r
+    protected void refreshFromRoot() {\r
+       super.refreshFromRoot();\r
        \r
        // If this is the top level of the property sheet, redraw the freetext area\r
        if (getParent() == null) {\r
index 86bf36e66e9f10c001c67c4aac5216eb0abd2e91..ff1e7a84539ebd31b4853326b8dd988a36f629d4 100644 (file)
@@ -63,35 +63,29 @@ public class TypeCollectionPropertySource extends CollectionPropertySource {
                         *  IPropertySource is now saved in the field editorValue for comparison.\r
                         */\r
                        descriptors.addElement(\r
-                                       new TextPropertyDescriptor(item, itemDisplayName) {\r
-                                           public CellEditor createPropertyEditor(Composite parent) {\r
-                                               CellEditor editor = new TextCellEditor(parent) {\r
-                                                       Object editorValue;\r
-                                                   protected void doSetValue(Object value) {\r
-                                                       if (value instanceof String) {\r
-                                                               super.doSetValue(value);\r
-                                                       } else {\r
-                                                               editorValue = value;\r
-                                                               super.doSetValue(value.toString());\r
-                                                       }                                                       \r
-                                                   }\r
-                                                   protected Object doGetValue() {\r
-                                                       \r
-//                                                     if (editorValue instanceof TypeCollectionPropertySource) {\r
-//                                                             String cache = \r
-//                                                     }\r
-//                                                     \r
-//                                                     if (super.doGetValue().equals())\r
-//                                                     return editorValue;\r
-                                                       return super.doGetValue();\r
-                                                   }\r
-                                               };\r
-                                               if (getValidator() != null) {\r
-                                                               editor.setValidator(getValidator());\r
-                                                       }\r
-                                               return editor;\r
-                                           }\r
-                                       });\r
+                                       new TextPropertyDescriptor(item, itemDisplayName));\r
+//                                     new TextPropertyDescriptor(item, itemDisplayName) {\r
+//                                         public CellEditor createPropertyEditor(Composite parent) {\r
+//                                             CellEditor editor = new TextCellEditor(parent) {\r
+//                                                     Object editorValue;\r
+//                                                 protected void doSetValue(Object value) {\r
+//                                                     if (value instanceof String) {\r
+//                                                             super.doSetValue(value);\r
+//                                                     } else {\r
+//                                                             editorValue = value;\r
+//                                                             super.doSetValue(value.toString());\r
+//                                                     }                                                       \r
+//                                                 }\r
+////                                               protected Object doGetValue() {\r
+////                                                   return super.doGetValue();\r
+////                                               }\r
+//                                             };\r
+//                                             if (getValidator() != null) {\r
+//                                                             editor.setValidator(getValidator());\r
+//                                                     }\r
+//                                             return editor;\r
+//                                         }\r
+//                                     });\r
                }\r
        }\r
        \r
@@ -165,7 +159,17 @@ public class TypeCollectionPropertySource extends CollectionPropertySource {
                \r
                @Override\r
                public Object getEditableValue() {\r
-                       return this;\r
+                       if (typeDesignation instanceof SpecimenTypeDesignation) {\r
+                               return ((SpecimenTypeDesignation) typeDesignation).getTypeSpecimen().getTitleCache();\r
+                       }\r
+                       \r
+                       if (typeDesignation instanceof NameTypeDesignation) {\r
+                               if (((NameTypeDesignation) typeDesignation).getTypeName() != null) {\r
+                                       return ((NameTypeDesignation) typeDesignation).getTypeName().getTitleCache();\r
+                               }\r
+                       }\r
+                       \r
+                       return null;\r
                }\r
 \r
                @Override\r
@@ -205,19 +209,19 @@ public class TypeCollectionPropertySource extends CollectionPropertySource {
                public void setPropertyValue(Object id, Object value) {\r
                }\r
                \r
-               public String toString() {\r
-                       if (typeDesignation instanceof SpecimenTypeDesignation) {\r
-                               return ((SpecimenTypeDesignation) typeDesignation).getTypeSpecimen().getTitleCache();\r
-                       }\r
-                       \r
-                       if (typeDesignation instanceof NameTypeDesignation) {\r
-                               if (((NameTypeDesignation) typeDesignation).getTypeName() != null) {\r
-                                       return ((NameTypeDesignation) typeDesignation).getTypeName().getTitleCache();\r
-                               }\r
-                       }\r
-                       \r
-                       return null;\r
-               }\r
+//             public String toString() {\r
+//                     if (typeDesignation instanceof SpecimenTypeDesignation) {\r
+//                             return ((SpecimenTypeDesignation) typeDesignation).getTypeSpecimen().getTitleCache();\r
+//                     }\r
+//                     \r
+//                     if (typeDesignation instanceof NameTypeDesignation) {\r
+//                             if (((NameTypeDesignation) typeDesignation).getTypeName() != null) {\r
+//                                     return ((NameTypeDesignation) typeDesignation).getTypeName().getTitleCache();\r
+//                             }\r
+//                     }\r
+//                     \r
+//                     return null;\r
+//             }\r
                \r
                public boolean equals(Object object) {\r
                        if (object == null) {\r