import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
/** Utilities to simplify UI development. */
public class EclipseUiUtils {
-
-
+
//
// Simplify grid layouts management
//
false);
}
-
-
-
-
+ //
+ // Simplify Form layout management
+ //
+
/**
- * Create a label and a text field for a grid layout, the text field grabbing
- * excess horizontal
+ * Creates a basic form data that is attached to the 4 corners of the parent
+ * composite
+ */
+ public static FormData fillFormData() {
+ FormData formData = new FormData();
+ formData.top = new FormAttachment(0, 0);
+ formData.left = new FormAttachment(0, 0);
+ formData.right = new FormAttachment(100, 0);
+ formData.bottom = new FormAttachment(100, 0);
+ return formData;
+ }
+
+ /**
+ * Create a label and a text field for a grid layout, the text field
+ * grabbing excess horizontal
*
* @param parent
* the parent composite
return txt;
}
+ //
+ // FONTS
+ //
+
/** Shortcut to retrieve default italic font from display */
public static Font getItalicFont(Composite parent) {
return JFaceResources.getFontRegistry().defaultFontDescriptor()