EGF Engine
Release 0.1.0

org.eclipse.egf.common.ui.helper
Class FormHelper

java.lang.Object
  extended by org.eclipse.egf.common.ui.helper.FormHelper

public class FormHelper
extends Object

UI Forms helper.
Allows creation of Composites, Layouts and Forms widgets.


Nested Class Summary
static class FormHelper.LayoutType
          Layout usable types.
 
Constructor Summary
FormHelper()
           
 
Method Summary
static Composite createCompositeWithLayoutType(FormToolkit toolkit_p, Composite parent_p, FormHelper.LayoutType layoutType_p, int numColumns_p, boolean equalWidth_p)
          Create a new composite and set the layout using #updateCompositeLayoutWithLayoutType(Composite, org.eclipse.egf.common.ui.helper.FormHelper.LayoutType, int) method.
static Couple<Label,Text> createLabelAndText(FormToolkit toolkit_p, Composite parent_p, String labelMessage_p, String initialText_p, boolean editable_p)
          Create a user text widget with preceding label.
static Couple<Text,Button> createLabelTextAndButton(FormToolkit toolkit_p, Composite parent_p, String labelMessage_p, String buttonLabel_p, SelectionListener listener_p)
          Create a user text widget with preceding label and following button.
static void createLinkWithDescription(FormToolkit toolkit_p, Composite parent_p, Image icon_p, String linkText_p, Object linkRef_p, String linkDescription_p, IHyperlinkListener listener_p)
          Create a link with a label description.
static Couple<Section,Composite> createSectionWithChildComposite(FormToolkit toolkit_p, Composite parent_p, int sectionStyle_p, FormHelper.LayoutType layoutType_p, int childNumColumns_p, boolean equalWidth_p)
          Create a section with a composite child using given child layout type.
static void forceControlSize(Control control_p, int widthInChars_p, int heightInChars_p)
          Force control size.
static Object updateCompositeLayoutWithLayoutType(Composite composite_p, FormHelper.LayoutType layoutType_p, int numColumns_p, boolean equalWidth_p)
          Update given composite with given layout type and given number of columns (if it makes any sense).
static Object updateControlLayoutDataWithLayoutTypeData(Control control_p, FormHelper.LayoutType layoutType_p)
          Update given control layout data depending on given layout type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormHelper

public FormHelper()
Method Detail

createCompositeWithLayoutType

public static Composite createCompositeWithLayoutType(FormToolkit toolkit_p,
                                                      Composite parent_p,
                                                      FormHelper.LayoutType layoutType_p,
                                                      int numColumns_p,
                                                      boolean equalWidth_p)
Create a new composite and set the layout using #updateCompositeLayoutWithLayoutType(Composite, org.eclipse.egf.common.ui.helper.FormHelper.LayoutType, int) method.

Parameters:
toolkit_p -
parent_p -
numColumns_p -
Returns:

updateCompositeLayoutWithLayoutType

public static Object updateCompositeLayoutWithLayoutType(Composite composite_p,
                                                         FormHelper.LayoutType layoutType_p,
                                                         int numColumns_p,
                                                         boolean equalWidth_p)
Update given composite with given layout type and given number of columns (if it makes any sense).
Also set the layout data to #updateControlLayoutDataWithLayoutTypeData(Composite, org.eclipse.egf.common.ui.helper.FormHelper.LayoutType).

Parameters:
composite_p -
layoutType_p -
numColumns_p -

updateControlLayoutDataWithLayoutTypeData

public static Object updateControlLayoutDataWithLayoutTypeData(Control control_p,
                                                               FormHelper.LayoutType layoutType_p)
Update given control layout data depending on given layout type.
Replace layout data is set to fill/grab in both directions, if it makes any sense.

Parameters:
control_p -

createSectionWithChildComposite

public static Couple<Section,Composite> createSectionWithChildComposite(FormToolkit toolkit_p,
                                                                        Composite parent_p,
                                                                        int sectionStyle_p,
                                                                        FormHelper.LayoutType layoutType_p,
                                                                        int childNumColumns_p,
                                                                        boolean equalWidth_p)
Create a section with a composite child using given child layout type.

Parameters:
toolkit_p -
parent_p -
sectionStyle_p -
layoutType_p -
childNumColumns_p -
equalWidth_p -
Returns:

createLabelAndText

public static Couple<Label,Text> createLabelAndText(FormToolkit toolkit_p,
                                                    Composite parent_p,
                                                    String labelMessage_p,
                                                    String initialText_p,
                                                    boolean editable_p)
Create a user text widget with preceding label.
Requires at least a two columns layout so that both the label and the text are displayed on the same line.

Parameters:
toolkit_p -
parent_p -
labelMessage_p -
initialText_p -
editable_p -
Returns:

createLabelTextAndButton

public static Couple<Text,Button> createLabelTextAndButton(FormToolkit toolkit_p,
                                                           Composite parent_p,
                                                           String labelMessage_p,
                                                           String buttonLabel_p,
                                                           SelectionListener listener_p)
Create a user text widget with preceding label and following button.
Requires at least a three columns layout so that the label, the text and the button are displayed on the same line.

Parameters:
toolkit_p -
parent_p -
labelMessage_p -
buttonLabel_p -
listener_p -
Returns:

createLinkWithDescription

public static void createLinkWithDescription(FormToolkit toolkit_p,
                                             Composite parent_p,
                                             Image icon_p,
                                             String linkText_p,
                                             Object linkRef_p,
                                             String linkDescription_p,
                                             IHyperlinkListener listener_p)
Create a link with a label description.
Requires a two columns layout so that both the link and the label are displayed on the same line.

Parameters:
toolkit_p -
parent_p -
icon_p -
linkText_p -
linkRef_p -
linkDescription_p -
listener_p -

forceControlSize

public static void forceControlSize(Control control_p,
                                    int widthInChars_p,
                                    int heightInChars_p)
Force control size.

Parameters:
control_p -
widthInChars_p - The expected width, in number of chars to display.
heightInChars_p - The expected height, in number of chars to display.

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.