fixed a bug that lead to ungrouped display of features
authorn.hoffmann <n.hoffmann@localhost>
Wed, 10 Jun 2009 13:54:50 +0000 (13:54 +0000)
committern.hoffmann <n.hoffmann@localhost>
Wed, 10 Jun 2009 13:54:50 +0000 (13:54 +0000)
taxeditor-editor/src/main/java/eu/etaxonomy/taxeditor/editor/AbstractTaxonEditor.java

index ad05aa4aeecd849e7470ee1d30b0db40eb9a0f21..e91eaa5f9fcc21b922c0d0535ddea457c83a4921 100644 (file)
@@ -41,7 +41,6 @@ import org.eclipse.ui.views.properties.IPropertySource;
 import org.eclipse.ui.views.properties.PropertySheetPage;\r
 import org.eclipse.ui.views.properties.PropertySheetSorter;\r
 import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;\r
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;\r
 \r
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
@@ -50,6 +49,7 @@ import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;\r
 import eu.etaxonomy.taxeditor.model.Resources;\r
 import eu.etaxonomy.taxeditor.operations.IPostOperationEnabled;\r
+import eu.etaxonomy.taxeditor.propertysheet.EditorPropertySheetEntry;\r
 import eu.etaxonomy.taxeditor.propertysheet.PropertySheetUtil;\r
 \r
 /**\r
@@ -179,19 +179,19 @@ public abstract class AbstractTaxonEditor extends EditorPart implements IAdaptab
                        this.selectedData = ((Composite) selectedObject).getData();\r
                }\r
                \r
-//             // Get the selection's property source, pass it to the selection provider\r
-//             IPropertySource propertySource = null;\r
-//             if (selectedObject != null) {\r
-//                     propertySource = selectedObject.getPropertySource();\r
-//             }\r
-//             if (propertySource == null) {\r
-//                     provider.setSelection(new StructuredSelection());\r
-//             } else {\r
-//                     provider.setSelection(new StructuredSelection(propertySource));\r
-//             }\r
+               // Get the selection's property source, pass it to the selection provider\r
+               IPropertySource propertySource = null;\r
+               if (selectedObject != null) {\r
+                       propertySource = selectedObject.getPropertySource();\r
+               }\r
+               if (propertySource == null) {\r
+                       provider.setSelection(new StructuredSelection());\r
+               } else {\r
+                       provider.setSelection(new StructuredSelection(propertySource));\r
+               }\r
                \r
-\r
-               provider.setSelection(new StructuredSelection(this.selectedData));\r
+               // TabbedPropertySheet stuff \r
+//             provider.setSelection(new StructuredSelection(this.selectedData));\r
                \r
        }\r
        \r
@@ -253,22 +253,20 @@ public abstract class AbstractTaxonEditor extends EditorPart implements IAdaptab
        @SuppressWarnings("unchecked")\r
        public Object getAdapter(Class type) {\r
            if (type == IPropertySheetPage.class) {\r
-//             \r
-//             PropertySheetPage page = new EditorPropertySheetPage();\r
-//             \r
-//             PropertySheetUtil.setPropertySheetPage(page);\r
-//             \r
-//             EditorPropertySheetEntry entry = new EditorPropertySheetEntry(taxon, this);\r
-//             page.setRootEntry(entry);\r
-//             page.refresh();\r
-//             \r
-//             return page;\r
                \r
-               TabbedPropertySheetPage page = new TabbedPropertySheetPage(this);\r
-\r
-               \r
-               return page;\r
+               PropertySheetPage page = new EditorPropertySheetPage();\r
+               \r
+               PropertySheetUtil.setPropertySheetPage(page);\r
+               \r
+               EditorPropertySheetEntry entry = new EditorPropertySheetEntry(taxon, this);\r
+               page.setRootEntry(entry);\r
+               page.refresh();\r
+               \r
+               return page;\r
                \r
+               // TabbedPropertySheet stuff\r
+//             TabbedPropertySheetPage page = new TabbedPropertySheetPage(this);\r
+//             return page;            \r
            }\r
            \r
            return super.getAdapter(type);\r
@@ -360,7 +358,6 @@ public abstract class AbstractTaxonEditor extends EditorPart implements IAdaptab
                for(Control child : composite.getChildren()){\r
                        if(child instanceof GroupComposite){\r
                                groupComposites.add((GroupComposite) child);\r
-                       }else if(child instanceof Composite){\r
                                getGroupCompositesRecursively((Composite) child, groupComposites);\r
                        }\r
                }\r