You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2011/12/05 13:45:39 UTC
svn commit: r1210435 -
/incubator/opennlp/sandbox/caseditor-opennlp-plugin/src/main/java/org/apache/opennlp/caseditor/TypeListFieldEditor.java
Author: joern
Date: Mon Dec 5 12:45:39 2011
New Revision: 1210435
URL: http://svn.apache.org/viewvc?rev=1210435&view=rev
Log:
OPENNLP-319 Minor layout improvements.
Modified:
incubator/opennlp/sandbox/caseditor-opennlp-plugin/src/main/java/org/apache/opennlp/caseditor/TypeListFieldEditor.java
Modified: incubator/opennlp/sandbox/caseditor-opennlp-plugin/src/main/java/org/apache/opennlp/caseditor/TypeListFieldEditor.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/sandbox/caseditor-opennlp-plugin/src/main/java/org/apache/opennlp/caseditor/TypeListFieldEditor.java?rev=1210435&r1=1210434&r2=1210435&view=diff
==============================================================================
--- incubator/opennlp/sandbox/caseditor-opennlp-plugin/src/main/java/org/apache/opennlp/caseditor/TypeListFieldEditor.java (original)
+++ incubator/opennlp/sandbox/caseditor-opennlp-plugin/src/main/java/org/apache/opennlp/caseditor/TypeListFieldEditor.java Mon Dec 5 12:45:39 2011
@@ -23,6 +23,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -51,7 +52,9 @@ public class TypeListFieldEditor extends
int numColumns) {
Label messageLabel = getLabelControl(parent);
- // TODO: Should be on top of list control .. then it has more space!
+ GridData messageGridDate = new GridData();
+ messageGridDate.horizontalSpan = numColumns;
+ messageLabel.setLayoutData(messageGridDate);
typeList = new List(parent, SWT.BORDER | SWT.SINGLE
| SWT.V_SCROLL | SWT.H_SCROLL);
@@ -63,9 +66,11 @@ public class TypeListFieldEditor extends
typeList.setLayoutData(gd);
- // TODO: The buttons should be moved to the right next to the control ...
+ Composite buttonGroup = new Composite(parent, SWT.NONE);
+ GridLayout buttonLayout = new GridLayout();
+ buttonGroup.setLayout(buttonLayout);
- Button addButton = new Button(parent, SWT.PUSH);
+ Button addButton = new Button(buttonGroup, SWT.PUSH);
addButton.setText("Add");
addButton.addSelectionListener(new SelectionListener() {
@@ -90,7 +95,7 @@ public class TypeListFieldEditor extends
});
// TODO: only enabled when an item in the list is selected
- Button removeButton = new Button(parent, SWT.PUSH);
+ Button removeButton = new Button(buttonGroup, SWT.PUSH);
removeButton.setText("Remove");
removeButton.addSelectionListener(new SelectionListener() {
@@ -148,7 +153,7 @@ public class TypeListFieldEditor extends
@Override
public int getNumberOfControls() {
- return 4;
+ return 3;
}
public static String[] getTypeList(String typeListString) {