changeset 65:1f27354dcdcf

Dont reuse the same layout data object
author Omair Majid <omajid@redhat.com>
date Thu, 02 Jan 2014 11:50:26 -0500
parents c9c6c6c327ea
children 5c4aae25081e
files src/com/redhat/thermostat/plugin/eclipse/editor/CommandEditPage.java
diffstat 1 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/redhat/thermostat/plugin/eclipse/editor/CommandEditPage.java	Thu Jan 02 11:40:46 2014 -0500
+++ b/src/com/redhat/thermostat/plugin/eclipse/editor/CommandEditPage.java	Thu Jan 02 11:50:26 2014 -0500
@@ -169,20 +169,19 @@
         Composite basicContents = toolkit.createComposite(basics);
         basics.setClient(basicContents);
         basicContents.setLayout(new GridLayout(2, false));
-        GridData fillHorizontally = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
 
         toolkit.createLabel(basicContents, "Name:");
         commandName = toolkit.createText(basicContents, "<command name here>");
         commandName.setEditable(false);
-        commandName.setLayoutData(fillHorizontally);
+        commandName.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
 
         toolkit.createLabel(basicContents, "Usage:");
         commandUsage = toolkit.createText(basicContents, "<usage>");
-        commandUsage.setLayoutData(fillHorizontally);
+        commandUsage.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
 
         toolkit.createLabel(basicContents, "Description:");
         commandDescription = toolkit.createText(basicContents, "<description>");
-        commandDescription.setLayoutData(fillHorizontally);
+        commandDescription.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
 
         toolkit.createLabel(basicContents, "Environments");
         Composite environmentsComposite = toolkit.createComposite(basicContents);
@@ -213,10 +212,8 @@
         Composite buttonComposite = toolkit.createComposite(bundleContents);
         buttonComposite.setLayout(new GridLayout(1, false));
 
-        GridData buttonLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
-
         Button add = toolkit.createButton(buttonComposite, "Add", SWT.NONE);
-        add.setLayoutData(buttonLayoutData);
+        add.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
         add.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
@@ -231,6 +228,7 @@
         });
 
         Button remove = toolkit.createButton(buttonComposite, "Remove", SWT.NONE);
+        remove.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
         remove.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
@@ -240,7 +238,6 @@
                 bundleViewer.setInput(viewModel);
             }
         });
-        remove.setLayoutData(buttonLayoutData);
     }
 
     private void updateFromModel() {