ref #6694 Beautify alignment of feature tree editor
authorPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 16 Jun 2017 13:23:31 +0000 (15:23 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 16 Jun 2017 13:23:31 +0000 (15:23 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java

index 4017e0aa3259a6dd54a669759fe698dd5cb4724c..af9ef8dadfc7746ac77300179ea32c9e8b906fe1 100644 (file)
@@ -103,15 +103,14 @@ public class FeatureTreeEditor implements
        /** {@inheritDoc} */
        @PostConstruct
        public void createControl(Composite parent, @Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
-           parent.setLayout(new GridLayout());
-               Composite composite = new Composite(parent, SWT.NULL);
-               composite.setLayout(new GridLayout());
-               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+           parent.setLayout(new GridLayout(2, false));
 
-               Composite composite_treeTitle = new Composite(composite, SWT.NULL);
+               Composite composite_treeTitle = new Composite(parent, SWT.NULL);
                composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
                                false));
-               composite_treeTitle.setLayout(new GridLayout(3, false));
+               GridLayout gl_composite_treeTitle = new GridLayout(2, false);
+               gl_composite_treeTitle.marginWidth = 0;
+               composite_treeTitle.setLayout(gl_composite_treeTitle);
 
                label_title = new Label(composite_treeTitle, SWT.NULL);
                label_title.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
@@ -120,31 +119,29 @@ public class FeatureTreeEditor implements
                text_title = new Text(composite_treeTitle, SWT.BORDER);
                text_title.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
 
-               btnOpenFeatureTree = new Button(composite_treeTitle, SWT.NONE);
+               btnOpenFeatureTree = new Button(parent, SWT.NONE);
+               btnOpenFeatureTree.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
                btnOpenFeatureTree.setToolTipText("Open Tree");
                btnOpenFeatureTree.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
 
-               Composite composite_treeContent = new Composite(composite, SWT.NULL);
-               composite_treeContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
-                               true, true));
-               composite_treeContent.setLayout(new GridLayout(2, false));
-
-               viewer = new TreeViewer(composite_treeContent);
+               viewer = new TreeViewer(parent);
                Tree tree = viewer.getTree();
                tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
                viewer.getControl().setLayoutData(
                                new GridData(SWT.FILL, SWT.FILL, true, true));
 
-               Composite composite_buttons = new Composite(composite_treeContent,
+               Composite composite_buttons = new Composite(parent,
                                SWT.NULL);
                composite_buttons.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false,
                                false));
                composite_buttons.setLayout(new GridLayout());
 
                button_add = new Button(composite_buttons, SWT.PUSH);
+               button_add.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
                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.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
                button_remove.setToolTipText("Remove a feature from this feature tree.");
                button_remove.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));