Fix various RAP lifecycle issues
[lgpl/argeo-commons.git] / eclipse / runtime / org.argeo.eclipse.ui / src / main / java / org / argeo / eclipse / ui / EclipseUiUtils.java
index 333db5b8899a1b1a732a6b5c0f1110265bf143cb..e70d819d19e69c922a6534256830a5a18d4b89d9 100644 (file)
@@ -28,7 +28,19 @@ public class EclipseUiUtils {
                lbl.setText(label);
                lbl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
                Text txt = new Text(parent, SWT.LEAD | SWT.BORDER);
-               txt.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
+               txt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               if (txt != null)
+                       txt.addModifyListener(modifyListener);
+               return txt;
+       }
+
+       public static Text createGridLP(Composite parent, String label,
+                       ModifyListener modifyListener) {
+               Label lbl = new Label(parent, SWT.LEAD);
+               lbl.setText(label);
+               lbl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
+               Text txt = new Text(parent, SWT.LEAD | SWT.BORDER | SWT.PASSWORD);
+               txt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
                if (txt != null)
                        txt.addModifyListener(modifyListener);
                return txt;