[jbosstools-commits] JBoss Tools SVN: r7136 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Mar 26 18:01:37 EDT 2008


Author: rob.stryker at jboss.com
Date: 2008-03-26 18:01:37 -0400 (Wed, 26 Mar 2008)
New Revision: 7136

Modified:
   trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
JBIDE-1956 - ui error

Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java	2008-03-26 19:44:24 UTC (rev 7135)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java	2008-03-26 22:01:37 UTC (rev 7136)
@@ -53,6 +53,9 @@
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -98,6 +101,8 @@
 
 	private Composite root = null;
 
+	private ActionPanel actionPanel;
+	
 	private Map<SeamRuntime, SeamRuntime> changed = new HashMap<SeamRuntime, SeamRuntime>();
 
 	private List<SeamRuntime> checkedElements = new ArrayList<SeamRuntime>();
@@ -172,22 +177,34 @@
 	public Object[] getEditorControls(Object composite) {
 
 		root = new Composite((Composite) composite, SWT.NONE);
-		root.setLayout(new GridLayout(GL_COLUMNS, false));
 		GridData gd = new GridData();
 		gd.horizontalAlignment = GridData.FILL;
 		gd.grabExcessHorizontalSpace = true;
 		root.setLayoutData(gd);
 
+		root.setLayout(new FormLayout());
+		createTableView();
+		createActionBar();
+		
+		FormData tableData = new FormData();
+		tableData.left = new FormAttachment(0,5);
+		tableData.right = new FormAttachment(actionPanel, -5);
+		tableData.top = new FormAttachment(0,5);
+		tableData.bottom = new FormAttachment(100,-5);
+		tableView.getControl().setLayoutData(tableData);
+		
+		FormData actionsData = new FormData();
+		actionsData.top = new FormAttachment(0,5);
+		actionsData.bottom = new FormAttachment(100,-5);
+		actionsData.right = new FormAttachment(100,-5);
+		actionPanel.setLayoutData(actionsData);
+		return new Control[] {root};
+	}
+	
+	protected void createTableView() {
 		tableView = CheckboxTableViewer.newCheckList(root, SWT.V_SCROLL
 				| SWT.BORDER | SWT.FULL_SELECTION | SWT.SINGLE);
 
-		gd = new GridData();
-		gd.heightHint = GL_HINT_HEIGHT;
-		gd.horizontalAlignment = GridData.FILL;
-		gd.grabExcessHorizontalSpace = true;
-
-		tableView.getControl().setLayoutData(gd);
-
 		TableColumn tc1 = new TableColumn(tableView.getTable(), SWT.CENTER);
 		tc1.setWidth(TC_DEFAULT_WIDTH);
 		tc1.setResizable(false);
@@ -316,10 +333,12 @@
 				checkedElements.add(rt);
 			}
 		}
-		ActionPanel actionPanel = new ActionPanel(root, new BaseAction[] {
+	}
+	
+	protected void createActionBar() {
+		actionPanel = new ActionPanel(root, new BaseAction[] {
 				new AddAction(), new EditAction(), new RemoveAction()});
 		tableView.addSelectionChangedListener(actionPanel);
-		return new Control[] {root};
 	}
 
 	/**
@@ -866,11 +885,6 @@
 			super(parent, style);
 			this.actions = actions;
 			setLayout(new GridLayout(1, false));
-			GridData gd = new GridData();
-			gd.horizontalAlignment = GridData.FILL;
-			gd.verticalAlignment = GridData.FILL;
-			gd.grabExcessVerticalSpace = true;
-			setLayoutData(gd);
 			for (BaseAction action : this.actions) {
 				new ActionButton(this, SWT.PUSH, action);
 			}
@@ -912,10 +926,7 @@
 	 */
 	public static class ActionButton implements IPropertyChangeListener {
 
-		private static final int DEFAULT_WIDTH_HINT = 50;
-
 		private Button button;
-
 		private BaseAction action;
 
 		/**
@@ -938,7 +949,6 @@
 
 			gd.horizontalAlignment = GridData.FILL;
 			gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
-			gd.widthHint = DEFAULT_WIDTH_HINT;
 			this.button.setLayoutData(gd);
 			this.action.addPropertyChangeListener(this);
 			this.button.setText(action.getText());




More information about the jbosstools-commits mailing list