ref #6694 Improve UI and feature tree creation
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / featuretree / e4 / FeatureTreeEditor.java
index c24c41e2a72313388a0ab53cf4f98463a0132c94..26f4305b26bb538474db6f01a6b5debf45a554eb 100644 (file)
@@ -76,11 +76,9 @@ public class FeatureTreeEditor implements
        private Label label_title;
        private Button button_add;
        private Button button_remove;
-       private Label label_treeInfo;
        private FeatureTree featureTree;
        private Text text_title;
     private Button btnOpenFeatureTree;
-    private Button btnNewFeatureTree;
 
     private ConversationHolder conversation;
     @Inject
@@ -107,7 +105,7 @@ public class FeatureTreeEditor implements
                Composite composite_treeTitle = new Composite(composite, SWT.NULL);
                composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
                                false));
-               composite_treeTitle.setLayout(new GridLayout(4, false));
+               composite_treeTitle.setLayout(new GridLayout(3, false));
 
                label_title = new Label(composite_treeTitle, SWT.NULL);
                label_title.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
@@ -117,11 +115,8 @@ public class FeatureTreeEditor implements
                text_title.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
 
                btnOpenFeatureTree = new Button(composite_treeTitle, SWT.NONE);
+               btnOpenFeatureTree.setToolTipText("Open Tree");
                btnOpenFeatureTree.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
-               btnOpenFeatureTree.setText("Open Tree");
-
-               btnNewFeatureTree = new Button(composite_treeTitle, SWT.NONE);
-               btnNewFeatureTree.setText("New Feature Tree");
 
                Composite composite_treeContent = new Composite(composite, SWT.NULL);
                composite_treeContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
@@ -141,16 +136,11 @@ public class FeatureTreeEditor implements
                composite_buttons.setLayout(new GridLayout());
 
                button_add = new Button(composite_buttons, SWT.PUSH);
-               button_add.setText("Add");
-               button_add.setToolTipText("Add a feature to this feature treee.");
+               button_add.setToolTipText("Add a feature to this feature tree.");
+               button_add.setImage(ImageResources.getImage(ImageResources.ADD_EDIT));
                button_remove = new Button(composite_buttons, SWT.PUSH);
-               button_remove.setText("Remove");
-               button_remove
-                               .setToolTipText("Remove a feature from this feature tree.");
-
-               label_treeInfo = new Label(composite, SWT.NULL);
-               label_treeInfo
-                               .setText("Order and nesting of feature nodes may be changed through drag and drop.");
+               button_remove.setToolTipText("Remove a feature from this feature tree.");
+               button_remove.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
 
                init(shell);
        }
@@ -181,7 +171,9 @@ public class FeatureTreeEditor implements
             @Override
             public void widgetSelected(SelectionEvent e) {
                 FeatureTree tree = FeatureTreeSelectionDialog.select(shell, conversation, null);
-                setSelectedTree(tree);
+                if(tree!=null){
+                    setSelectedTree(tree);
+                }
             }
 
             @Override