Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui
Class SystemWidgetHelpers

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.SystemWidgetHelpers

public class SystemWidgetHelpers
extends Object

Static methods that can be used when writing SWT GUI code. They simply make it more productive.


Field Summary
static String copyright
           
static Label previousLabel
           
static boolean traceHelpIDs
           
 
Constructor Summary
SystemWidgetHelpers()
           
 
Method Summary
static String appendColon(String label)
          Appends a colon to a label, if the label doesn't already end in a colon of the proper size.
static Button createBrowseButton(Composite group, Listener listener)
          Creates a new "Browse..." pushbutton instance and sets the default layout data.
static Button createBrowseButton(Composite group, Listener listener, ResourceBundle bundle, String toolTipId)
          Creates a new "Browse..." pushbutton instance and sets the default layout data, with tooltip text.
static Button createCheckBox(Composite group, int horizontalSpan, Listener listener, ResourceBundle bundle, String root)
          Creates a new checkbox instance with the given horizontal span and sets the default layout data, and sets the tooltip text.
static Button createCheckBox(Composite group, int horizontalSpan, String label, Listener listener)
          Creates a new checkbox instance with the given horizontal span and sets the default layout data.
static Button createCheckBox(Composite group, Listener listener, ResourceBundle bundle, String root)
          Creates a new checkbox instance and sets the default layout data, and sets the tooltip text.
static Button createCheckBox(Composite group, String label, Listener listener)
          Creates a new checkbox instance and sets the default layout data.
static Combo createCombo(Composite parent, Listener listener)
          Creates a new combobox instance and sets the default layout data.
static Combo createCombo(Composite parent, Listener listener, ResourceBundle bundle, String toolTipId)
          Creates a new combobox instance and sets the default layout data, with tooltip text.
static Label createCommandStatusLine(Composite parent, int horizontalSpan)
          Create a label to show a command string as it is being built-up in a dialog This version uses a default height of 3 normal lines.
static Label createCommandStatusLine(Composite parent, int horizontalSpan, int heightInLines)
          Create a label to show a command string as it is being built-up in a dialog.
static Composite createComposite(Composite parent, int numColumns)
          Creates composite control and sets the default layout data.
static Composite createComposite(Composite parent, int parentSpan, int numColumns, boolean border, String label, int marginSize, int spacingSize)
          This is the most flexible composite creation method.
static SystemConnectionCombo createConnectionCombo(Composite parent, SelectionListener listener, String[] systemTypes, SubSystemFactory factory, String factoryId, String factoryCategory, SystemConnection defaultConnection, int horizontalSpan, boolean newButton)
          Creates a new remote system connection combobox instance and sets the default layout data, with tooltip text.
static Composite createFlushComposite(Composite parent, int numColumns)
          Creates "flush" composite control and sets the default layout data.
static SystemRemoteFolderCombo createFolderCombo(Composite parent, SelectionListener listener, int horizontalSpan, String historyKey, boolean readOnly)
          Creates a new remote system folder combobox instance and sets the default layout data, with tooltip text.
static Group createGroupComposite(Composite parent, int numColumns, String label)
          Creates group composite control and sets the default layout data.
static SystemHistoryCombo createHistoryCombo(Composite parent, SelectionListener listener, String historyKey, boolean readonly, ResourceBundle bundle, String toolTipId)
          Creates a new historical combobox instance and sets the default layout data, with tooltip text.
static Combo createHostNameCombo(Composite parent, Listener listener, String systemType)
          Creates a hostname combination box.
static Button createImageButton(Composite group, Image image, Listener listener)
          Creates a new pushbutton instance with an image, vs text.
static InheritableEntryField createInheritableTextField(Composite parent, ResourceBundle bundle, String toggleToolTipId, String entryToolTipId)
          Create an entry field controlled by an inherit/override switch button After creating the widget, call setLocal to set initial state, and setInheritedText/setLocalText to set inherited/local text
static InheritControl createInheritButton(Composite parent, SelectionListener listener)
          Create a inherit/override switch button.
static InheritControl createInheritButton(Composite parent, SelectionListener listener, ResourceBundle bundle, String toolTipId)
          Create a inherit/override switch button with tooltip text
static Label createLabel(Composite parent, ResourceBundle bundle, String rootKey)
          Creates a label instance and inserts it into a given GridLayout.
static Label createLabel(Composite parent, ResourceBundle bundle, String rootKey, int span, boolean wantBorder)
          Creates a label instance and inserts it into a given GridLayout.
static Label createLabel(Composite parent, String text)
          Creates a label instance and inserts it into a given GridLayout.
static Label createLabel(Composite parent, String text, int span)
          Creates a label instance and inserts it into a given GridLayout.
static Label createLabel(Composite parent, String text, int span, boolean wantBorder)
          Creates a label instance and inserts it into a given GridLayout, optionally with a border style
static Combo createLabeledCombo(Composite parent, Listener listener, ResourceBundle bundle, String key)
          Create a labeled combo field and insert it into a GridLayout, and assign tooltip text.
static Label createLabeledLabel(Composite parent, ResourceBundle bundle, String key, boolean wantBorder)
          Create a pair of labels, the first being a prompt and the second being a value.
static Combo createLabeledReadonlyCombo(Composite parent, Listener listener, ResourceBundle bundle, String key)
          Create a labeled readonly combo field and insert it into a GridLayout, and assign tooltip text.
static Text createLabeledReadonlyTextField(Composite parent, ResourceBundle bundle, String key)
          Create a labeled readonly text field and insert it into a GridLayout, and assign tooltip text.
static Text createLabeledTextField(Composite parent, Listener listener, ResourceBundle bundle, String key)
          Create a labeled text field and insert it into a GridLayout, and assign tooltip text.
static Label createLabeledVerbage(Composite parent, ResourceBundle bundle, String key, int span, boolean border, int widthHint)
          Create a labeled verbage (wrappable label) field and insert it into a GridLayout, and assign tooltip text.
static List createListBox(Composite group, Listener listener, boolean multiSelect, ResourceBundle bundle, String key)
          Creates a new listbox instance and sets the default layout data.
static List createListBox(Composite group, String label, Listener listener, boolean multiSelect)
          Creates a new listbox instance and sets the default layout data.
static List createListBox(Composite group, String label, Listener listener, boolean multiSelect, int columnSpan)
          Creates a new listbox instance and sets the default layout data.
static List createListBox(Composite group, String label, Listener listener, boolean multiSelect, ResourceBundle bundle, String toolTipId)
          Creates a new listbox instance and sets the default layout data.
static Text createMultiLineLabeledTextField(Composite parent, Listener listener, ResourceBundle bundle, String key, int heightHint)
          Create a multiline labeled text field and insert it into a GridLayout, and assign tooltip text.
static Text createMultiLineTextField(Composite parent, Listener listener, int heightHint)
          Create a multiline text field and insert it into a GridLayout.
static Button createPushButton(Composite group, Listener listener, ResourceBundle bundle, String key)
          This one takes the resource bundle key and appends "label" and "tooltip" to it to get the label and tooltip text.
static Button createPushButton(Composite group, String label, Listener listener)
          Creates a new pushbutton instance and sets the default layout data.
static Button createPushButton(Composite group, String label, Listener listener, ResourceBundle bundle, String toolTipId)
          Creates a new pushbutton instance and sets the default layout data, and assign tooltip text Assign the listener to the passed in implementer of Listener.
static SystemQualifiedRemoteFolderCombo createQualifiedDirectoryCombo(Composite parent, SelectionListener listener, int horizontalSpan, String historyKey)
          Creates a new remote system directory combobox instance and sets the default layout data, with tooltip text.
static Button createRadioButton(Composite group, Listener listener, ResourceBundle bundle, String key)
          Creates a new radiobutton instance and sets the default layout data, and assigns tooltip text.
static Button createRadioButton(Composite group, String label, Listener listener)
          Creates a new radiobutton instance and sets the default layout data.
static Combo createReadonlyCombo(Composite parent, Listener listener)
          Creates a new readonly combobox instance and sets the default layout data.
static Combo createReadonlyCombo(Composite parent, Listener listener, ResourceBundle bundle, String toolTipId)
          Creates a new readonly combobox instance and sets the default layout data, with tooltip text.
static Text createReadonlyTextField(Composite parent)
          Create a readonly text field and insert it into a GridLayout.
static Text createReadonlyTextField(Composite parent, ResourceBundle bundle, String toolTipId)
          Create a readonly text field and insert it into a GridLayout, and assign tooltip text.
static Label createRigidFillerLabel(Composite parent, int span, int widthHint)
          Creates a label for use a simple filler, to eat up space.
static void createSpacerLine(Composite parent, int columnSpan, boolean wantBorder)
          Create a spacer line.
static Combo createSystemTypeCombo(Composite parent, Listener listener)
          Creates a readonly system type combination box.
static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes)
          Creates a readonly system type combination box with the given system types.
static Text createTextField(Composite parent, Listener listener)
          Create a text field and insert it into a GridLayout.
static Text createTextField(Composite parent, Listener listener, ResourceBundle bundle, String toolTipId)
          Create a text field and insert it into a GridLayout, and assign tooltip text.
static Composite createTightComposite(Composite parent, int numColumns)
          Creates "tight" composite control and sets the default layout data.
static Label createVerbage(Composite parent, ResourceBundle bundle, String key, int span, boolean border, int widthHint)
          Creates a widget for displaying text verbage that spans multiple lines.
static Label createVerbage(Composite parent, String text, int span, boolean border, int widthHint)
          Creates a widget for displaying text verbage that spans multiple lines.
static Composite createVerticalBeginComposite(Composite parent, int parentSpan, int numColumns, boolean border, String label, int marginSize, int spacingSize)
          Creates a composite with vertical alignment GridData.VERTICAL_ALIGN_BEGINNING.
static Label getFirstColumnOneLabel(Composite composite)
          Given a composite that has been layed out, return the first label found in the first column.
static Label getLastLabel()
          Return the prompting label from the last call to createLabeledXXXX.
static void lineUpPrompts(Composite composite)
          Helper method to line up the leading prompts in a composite, taking into account composite prompts nested within.
static void setCompositeHelp(Composite parent, String helpID)
          Given a Composite, this method walks all the children recursively and and sets the infopop help id for each child control where help makes sense (eg, buttons, combos, entry fields, lists, trees).
static void setHelp(Control c, IViewPart view, Object id)
          Deprecated.  
static void setHelp(Control c, String id)
          Set the context id for a control
static Mnemonics setMnemonics(Composite parent)
          Given a Composite, this method walks all the children recursively and and sets the mnemonics uniquely for each child control where a mnemonic makes sense (eg, buttons).
static Mnemonics setMnemonics(Composite parent, boolean applyToPrecedingLabels)
          Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
static Mnemonics setPreferencePageMnemonics(Composite parent)
          Same as above but specifically for preference pages
static Mnemonics setPreferencePageMnemonics(Composite parent, boolean applyToPrecedingLabels)
          Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
static Mnemonics setWizardPageMnemonics(Composite parent)
          Same as above but specifically for wizard pages
static Mnemonics setWizardPageMnemonics(Composite parent, boolean applyToPrecedingLabels)
          Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

traceHelpIDs

public static boolean traceHelpIDs

previousLabel

public static Label previousLabel
Constructor Detail

SystemWidgetHelpers

public SystemWidgetHelpers()
Method Detail

createComposite

public static Composite createComposite(Composite parent,
                                        int parentSpan,
                                        int numColumns,
                                        boolean border,
                                        String label,
                                        int marginSize,
                                        int spacingSize)
This is the most flexible composite creation method.

Parameters:
parent - Parent composite
parentSpan - number of columns this is to span in the parent's composite
numColumns - number of columns this composite is to have
border - true if you want to show an etched border around the composite
label - optional label to show in the border. Forces border to true
marginSize - the number pixels around the composite. -1 means Eclipse default
spacingSize - the number pixels around the composite controls. -1 means Eclipse default

createVerticalBeginComposite

public static Composite createVerticalBeginComposite(Composite parent,
                                                     int parentSpan,
                                                     int numColumns,
                                                     boolean border,
                                                     String label,
                                                     int marginSize,
                                                     int spacingSize)
Creates a composite with vertical alignment GridData.VERTICAL_ALIGN_BEGINNING.

Parameters:
parent - Parent composite
parentSpan - number of columns this is to span in the parent's composite
numColumns - number of columns this composite is to have
border - true if you want to show an etched border around the composite
label - optional label to show in the border. Forces border to true
marginSize - the number pixels around the composite. -1 means Eclipse default
spacingSize - the number pixels around the composite controls. -1 means Eclipse default

createComposite

public static Composite createComposite(Composite parent,
                                        int numColumns)
Creates composite control and sets the default layout data.


createGroupComposite

public static Group createGroupComposite(Composite parent,
                                         int numColumns,
                                         String label)
Creates group composite control and sets the default layout data. Group composites show a visible border line and optional text in it.


createTightComposite

public static Composite createTightComposite(Composite parent,
                                             int numColumns)
Creates "tight" composite control and sets the default layout data. A tight composite is one with no vertical or horizontal spacing, or margin spacing.


createFlushComposite

public static Composite createFlushComposite(Composite parent,
                                             int numColumns)
Creates "flush" composite control and sets the default layout data. A flush composite is one with no margin spacing but normal inter-component spacing


createRigidFillerLabel

public static Label createRigidFillerLabel(Composite parent,
                                           int span,
                                           int widthHint)
Creates a label for use a simple filler, to eat up space. This is for a rigid filler that doesn't consume space.

Parameters:
parent - Composite to put the field into.
span - Horizontal span
widthHint - How wide to make it. Pass -1 to use SWT default

createLabel

public static Label createLabel(Composite parent,
                                String text)
Creates a label instance and inserts it into a given GridLayout.


createLabel

public static Label createLabel(Composite parent,
                                String text,
                                int span)
Creates a label instance and inserts it into a given GridLayout.

Parameters:
parent - Composite to put the field into.
text - Text to display in the label.
span - Horizontal span

createLabel

public static Label createLabel(Composite parent,
                                String text,
                                int span,
                                boolean wantBorder)
Creates a label instance and inserts it into a given GridLayout, optionally with a border style

Parameters:
parent - Composite to put the field into.
text - Text to display in the label.
span - Horizontal span
wantBorder - true to place border around the label

createLabel

public static Label createLabel(Composite parent,
                                ResourceBundle bundle,
                                String rootKey)
Creates a label instance and inserts it into a given GridLayout. Supports tooltip text

Parameters:
parent - GridLayout composite to put the field into.
bundle - ResourceBundle bundle containing label and tooltip values
rootKey - String to which "label" and "tooltip" are appended to get the label and tooltip text.

createLabel

public static Label createLabel(Composite parent,
                                ResourceBundle bundle,
                                String rootKey,
                                int span,
                                boolean wantBorder)
Creates a label instance and inserts it into a given GridLayout.

Parameters:
parent - Composite to put the field into.
bundle - ResourceBundle bundle containing label and tooltip values
rootKey - String to which "label" and "tooltip" are appended to get the label and tooltip text.
span - Horizontal span
wantBorder - true to place border around the label

createLabeledLabel

public static Label createLabeledLabel(Composite parent,
                                       ResourceBundle bundle,
                                       String key,
                                       boolean wantBorder)
Create a pair of labels, the first being a prompt and the second being a value. A colon is appended to the text of the first label. The text value of the second will be set to "".

The first label is set to not grab excess horizontal space, while the second one is, since its contents are variable.

To help with initial sizing, the widthHint of the second is set to 100.

If you need a handle to the prompting label, immediately call getLastLabel()

Parameters:
parent - composite to put the fields into. Will be added sequentially
bundle - ResourceBundle of label and tooltip
key - root id for the bundle. + "label" for the prompt label text, + "tooltip" for the tooltip for both labels
wantBorder - true if a border is desired around the second label (the value vs the prompt)
Returns:
the second label created. Use setText to place the value in it.

getLastLabel

public static Label getLastLabel()
Return the prompting label from the last call to createLabeledXXXX. These methods only return the second control, but we sometimes need access to the label.


createSpacerLine

public static void createSpacerLine(Composite parent,
                                    int columnSpan,
                                    boolean wantBorder)
Create a spacer line. No widget returned so we have the freedom to change it over time


createVerbage

public static Label createVerbage(Composite parent,
                                  ResourceBundle bundle,
                                  String key,
                                  int span,
                                  boolean border,
                                  int widthHint)
Creates a widget for displaying text verbage that spans multiple lines. The returned widget is not typed so we can easily change it in the future if we decide on a better widget.

Parameters:
parent - Composite to put the field into.
bundle - ResourceBundle bundle containing the verbage text
key - String that is the key into the resource bundle for the verbage. Nothing is appended to the key
span - Horizontal span
border - true if you want a border around the verbage
widthHint - number of pixels to limit width to before wrapping. 200 is a reasonable number
Returns:
the Label widget, in case you want to tweak it

createVerbage

public static Label createVerbage(Composite parent,
                                  String text,
                                  int span,
                                  boolean border,
                                  int widthHint)
Creates a widget for displaying text verbage that spans multiple lines. Takes resolved text vs resource bundle id. The returned widget is not typed so we can easily change it in the future if we decide on a better widget.

Parameters:
parent - Composite to put the field into.
text - String is the verbage text to display
span - Horizontal span
border - true if you want a border around the verbage
widthHint - number of pixels to limit width to before wrapping. 200 is a reasonable number
Returns:
the Label widget, in case you want to tweak it

createLabeledVerbage

public static Label createLabeledVerbage(Composite parent,
                                         ResourceBundle bundle,
                                         String key,
                                         int span,
                                         boolean border,
                                         int widthHint)
Create a labeled verbage (wrappable label) field and insert it into a GridLayout, and assign tooltip text. After calling this, you must call setText on the result to set its contents.

If you need a handle to the prompting label, immediately call getLastLabel()

Parameters:
parent - composite to put the field into.
bundle - ResourceBundle of prompt, and optionally tooltip text
key - root id for the bundle. + "label" for the preceding label text, + "tooltip" for the tooltip.
span - Horizontal span
border - true if you want a border around the verbage
widthHint - number of pixels to limit width to before wrapping. 200 is a reasonable number
Returns:
Label created.

createCommandStatusLine

public static Label createCommandStatusLine(Composite parent,
                                            int horizontalSpan)
Create a label to show a command string as it is being built-up in a dialog This version uses a default height of 3 normal lines.


createCommandStatusLine

public static Label createCommandStatusLine(Composite parent,
                                            int horizontalSpan,
                                            int heightInLines)
Create a label to show a command string as it is being built-up in a dialog. This version allows you specify how tall to make it, in terms of normal line height.


createTextField

public static Text createTextField(Composite parent,
                                   Listener listener)
Create a text field and insert it into a GridLayout. Assign the listener to the passed in implementer of Listener.


createTextField

public static Text createTextField(Composite parent,
                                   Listener listener,
                                   ResourceBundle bundle,
                                   String toolTipId)
Create a text field and insert it into a GridLayout, and assign tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
parent - composite to put the field into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text

createLabeledTextField

public static Text createLabeledTextField(Composite parent,
                                          Listener listener,
                                          ResourceBundle bundle,
                                          String key)
Create a labeled text field and insert it into a GridLayout, and assign tooltip text. Assign the listener to the passed in implementer of Listener.

If you need a handle to the prompting label, immediately call getLastLabel()

Parameters:
parent - composite to put the field into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text
key - root id for the bundle. + "label" for the label text, + "tooltip" for the tooltip for the text field
Returns:
TextField created.

createReadonlyTextField

public static Text createReadonlyTextField(Composite parent)
Create a readonly text field and insert it into a GridLayout.


createReadonlyTextField

public static Text createReadonlyTextField(Composite parent,
                                           ResourceBundle bundle,
                                           String toolTipId)
Create a readonly text field and insert it into a GridLayout, and assign tooltip text.

Parameters:
parent - composite to put the field into.
bundle - ResourceBundle of tooltip text

createLabeledReadonlyTextField

public static Text createLabeledReadonlyTextField(Composite parent,
                                                  ResourceBundle bundle,
                                                  String key)
Create a labeled readonly text field and insert it into a GridLayout, and assign tooltip text. Assign the listener to the passed in implementer of Listener.

If you need a handle to the prompting label, immediately call getLastLabel()

Parameters:
parent - composite to put the field into.
bundle - ResourceBundle of tooltip text
key - root id for the bundle. + "label" for the label text, + "tooltip" for the tooltip for the text field
Returns:
TextField created.

createMultiLineTextField

public static Text createMultiLineTextField(Composite parent,
                                            Listener listener,
                                            int heightHint)
Create a multiline text field and insert it into a GridLayout. Assign the listener to the passed in implementer of Listener.


createMultiLineLabeledTextField

public static Text createMultiLineLabeledTextField(Composite parent,
                                                   Listener listener,
                                                   ResourceBundle bundle,
                                                   String key,
                                                   int heightHint)
Create a multiline labeled text field and insert it into a GridLayout, and assign tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
parent - composite to put the field into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text
key - root id for the bundle. + "label" for the label text, + "tooltip" for the tooltip for the text field
Returns:
TextField created.

createCheckBox

public static Button createCheckBox(Composite group,
                                    String label,
                                    Listener listener)
Creates a new checkbox instance and sets the default layout data. Spans 1 column horizontally. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the checkbox into.
label - to display in the checkbox.
listener - object to listen for events. Can be null.

createCheckBox

public static Button createCheckBox(Composite group,
                                    int horizontalSpan,
                                    String label,
                                    Listener listener)
Creates a new checkbox instance with the given horizontal span and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the checkbox into.
horizontalSpan - number of columns this checkbox is to span.
label - to display in the checkbox.
listener - object to listen for events. Can be null.

createCheckBox

public static Button createCheckBox(Composite group,
                                    Listener listener,
                                    ResourceBundle bundle,
                                    String root)
Creates a new checkbox instance and sets the default layout data, and sets the tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the checkbox into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text
root - key for label (+"label") and tooltip (+"tooltip")

createCheckBox

public static Button createCheckBox(Composite group,
                                    int horizontalSpan,
                                    Listener listener,
                                    ResourceBundle bundle,
                                    String root)
Creates a new checkbox instance with the given horizontal span and sets the default layout data, and sets the tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the checkbox into.
horizontalSpan - number of columns to span.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text
root - key for label (+"label") and tooltip (+"tooltip")

createRadioButton

public static Button createRadioButton(Composite group,
                                       String label,
                                       Listener listener)
Creates a new radiobutton instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
label - to display in the button
listener - object to listen for events. Can be null.

createRadioButton

public static Button createRadioButton(Composite group,
                                       Listener listener,
                                       ResourceBundle bundle,
                                       String key)
Creates a new radiobutton instance and sets the default layout data, and assigns tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text
key - resource bundle key. We add "label" for button text and "tooltip" for button tooltip

createImageButton

public static Button createImageButton(Composite group,
                                       Image image,
                                       Listener listener)
Creates a new pushbutton instance with an image, vs text. SWT does not allow both image and text on a button. Assign the listener to the passed in implementer of Listener.

Parameters:
group - The composite to put the button into.
image - The image to display in the button
listener - The object to listen for events. Can be null.

createPushButton

public static Button createPushButton(Composite group,
                                      String label,
                                      Listener listener)
Creates a new pushbutton instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
label - to display in the button
listener - object to listen for events. Can be null.

createPushButton

public static Button createPushButton(Composite group,
                                      String label,
                                      Listener listener,
                                      ResourceBundle bundle,
                                      String toolTipId)
Creates a new pushbutton instance and sets the default layout data, and assign tooltip text Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
label - to display in the button
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text

createPushButton

public static Button createPushButton(Composite group,
                                      Listener listener,
                                      ResourceBundle bundle,
                                      String key)
This one takes the resource bundle key and appends "label" and "tooltip" to it to get the label and tooltip text.

Parameters:
group - composite to put the button into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text

createBrowseButton

public static Button createBrowseButton(Composite group,
                                        Listener listener)
Creates a new "Browse..." pushbutton instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
listener - object to listen for events. Can be null.

createBrowseButton

public static Button createBrowseButton(Composite group,
                                        Listener listener,
                                        ResourceBundle bundle,
                                        String toolTipId)
Creates a new "Browse..." pushbutton instance and sets the default layout data, with tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
listener - object to listen for events. Can be null.
bundle - ResourceBundle of tooltip text

createListBox

public static List createListBox(Composite group,
                                 String label,
                                 Listener listener,
                                 boolean multiSelect)
Creates a new listbox instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
label - to display above the list box (can be null).
listener - object to listen for events. Can be null.
multiSelect - true if this is to be a multiple selection list. False for single selection.

createListBox

public static List createListBox(Composite group,
                                 String label,
                                 Listener listener,
                                 boolean multiSelect,
                                 int columnSpan)
Creates a new listbox instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
label - to display above the list box (can be null).
listener - object to listen for events. Can be null.
multiSelect - true if this is to be a multiple selection list. False for single selection.
columnSpan - number of columns this should span

createListBox

public static List createListBox(Composite group,
                                 String label,
                                 Listener listener,
                                 boolean multiSelect,
                                 ResourceBundle bundle,
                                 String toolTipId)
Creates a new listbox instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
label - to display above the list box (can be null).
listener - object to listen for events. Can be null.
multiSelect - true if this is to be a multiple selection list. False for single selection.
bundle - ResourceBundle of tooltip text

createListBox

public static List createListBox(Composite group,
                                 Listener listener,
                                 boolean multiSelect,
                                 ResourceBundle bundle,
                                 String key)
Creates a new listbox instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
group - composite to put the button into.
listener - object to listen for events. Can be null.
multiSelect - true if this is to be a multiple selection list. False for single selection.
bundle - ResourceBundle of tooltip text
key - bundle key for label (key + "label") and tooltip text (key + "tooltip")

createCombo

public static Combo createCombo(Composite parent,
                                Listener listener)
Creates a new combobox instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
parent - composite to put the button into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.

createCombo

public static Combo createCombo(Composite parent,
                                Listener listener,
                                ResourceBundle bundle,
                                String toolTipId)
Creates a new combobox instance and sets the default layout data, with tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
parent - composite to put the combo into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
bundle - ResourceBundle of tooltip text

createLabeledCombo

public static Combo createLabeledCombo(Composite parent,
                                       Listener listener,
                                       ResourceBundle bundle,
                                       String key)
Create a labeled combo field and insert it into a GridLayout, and assign tooltip text. Assign the listener to the passed in implementer of Listener.

If you need a handle to the prompting label, immediately call getLastLabel()

Parameters:
parent - composite to put the field into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
bundle - ResourceBundle of tooltip text
key - root id for the bundle. + "label" for the label text, + "tooltip" for the tooltip for the combo field
Returns:
Combo created.

createReadonlyCombo

public static Combo createReadonlyCombo(Composite parent,
                                        Listener listener)
Creates a new readonly combobox instance and sets the default layout data. Assign the listener to the passed in implementer of Listener.

Parameters:
parent - composite to put the button into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.

createReadonlyCombo

public static Combo createReadonlyCombo(Composite parent,
                                        Listener listener,
                                        ResourceBundle bundle,
                                        String toolTipId)
Creates a new readonly combobox instance and sets the default layout data, with tooltip text. Assign the listener to the passed in implementer of Listener.

Parameters:
parent - composite to put the button into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
bundle - ResourceBundle of tooltip text

createLabeledReadonlyCombo

public static Combo createLabeledReadonlyCombo(Composite parent,
                                               Listener listener,
                                               ResourceBundle bundle,
                                               String key)
Create a labeled readonly combo field and insert it into a GridLayout, and assign tooltip text. Assign the listener to the passed in implementer of Listener.

If you need a handle to the prompting label, immediately call getLastLabel()

Parameters:
parent - composite to put the field into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
bundle - ResourceBundle of tooltip text
key - root id for the bundle. + "label" for the label text, + "tooltip" for the tooltip for the combo field
Returns:
Combo created.

createHistoryCombo

public static SystemHistoryCombo createHistoryCombo(Composite parent,
                                                    SelectionListener listener,
                                                    String historyKey,
                                                    boolean readonly,
                                                    ResourceBundle bundle,
                                                    String toolTipId)
Creates a new historical combobox instance and sets the default layout data, with tooltip text.

Assign the listener to the passed in implementer of Listener.

A historical combobox is one that persists its contents between sessions. The management of that persistence is handled for you!.

Parameters:
parent - composite to put the combo into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
readonly - true if this combo is to be readonly, forcing user to select from the history
bundle - ResourceBundle of tooltip text. Can be null for no tooltip text

createFolderCombo

public static SystemRemoteFolderCombo createFolderCombo(Composite parent,
                                                        SelectionListener listener,
                                                        int horizontalSpan,
                                                        String historyKey,
                                                        boolean readOnly)
Creates a new remote system folder combobox instance and sets the default layout data, with tooltip text.

Assign the listener to the passed in implementer of Listener.

A remote system folder combobox is one that mimics the local folder selection combobox, but works with remote file systems instead. It has a label, a historical dropdown, and a browse button.

Parameters:
parent - composite to put the combo into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
historyKey - The key with which to remember/restore the history for this combo. Pass null to use the overall default.
horizontalSpan - number of columns this should span
readOnly - true if the combo is to be readonly

createQualifiedDirectoryCombo

public static SystemQualifiedRemoteFolderCombo createQualifiedDirectoryCombo(Composite parent,
                                                                             SelectionListener listener,
                                                                             int horizontalSpan,
                                                                             String historyKey)
Creates a new remote system directory combobox instance and sets the default layout data, with tooltip text. Each remote directory is qualified by its connection name. These combos are always readonly.

Assign the listener to the passed in implementer of Listener.

A remote system qualified-directory combobox is one that mimics the local directory selection combobox, but works with remote file systems instead. It has a label, a historical dropdown, and a browse button.

Parameters:
parent - composite to put the combo into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addListener(SWT.Modify,this) on your own.
historyKey - The key with which to remember/restore the history for this combo. Pass null to use the overall default.
horizontalSpan - number of columns this should span

createConnectionCombo

public static SystemConnectionCombo createConnectionCombo(Composite parent,
                                                          SelectionListener listener,
                                                          String[] systemTypes,
                                                          SubSystemFactory factory,
                                                          String factoryId,
                                                          String factoryCategory,
                                                          SystemConnection defaultConnection,
                                                          int horizontalSpan,
                                                          boolean newButton)
Creates a new remote system connection combobox instance and sets the default layout data, with tooltip text.

Assign the listener to the passed in implementer of Listener.

A remote system connection combobox is one that allows users to select a connection. The connection list can be subsetted by system type, subsystem factory or subsystem factory category. It has a "Connection:" prompt in front of it and optionally a "New..." button beside it.

Parameters:
parent - composite to put the combo into.
listener - object to listen for selection events. Can be null. If you want to listen for modify events, call addSelectionListener(...) on your own.
systemTypes - array of system types to subset connection list by. Specify a single entry of '*' for all system types. Specify this OR specify factory OR specify factoryCategory OR specify factory Id
factory - the subsystem factory to subset connection list by. Only connections with a subsystem owned by this factory are listed. Specify this OR specify systemTypes OR specify factoryCategory OR specify factory Id
factoryId - the subsystem factory id to subset connection list by. Only connections with a subsystem owned by this factory are listed, where id is a string specified in the plugin.xml file for the subsystem factory extension point definition. Specify this OR specify factory OR specify systemTypes OR specify factory category
factoryCategory - the subsystem factory category to subset connection list by. Only connections with a subsystem owned by a factory of this category are listed, where category is a string specified in the plugin.xml file for the subsystem factory extension point definition. Specify this OR specify factory OR specify factory Id OR specify systemTypes
defaultConnection - the connection to pre-select. Can be null.
horizontalSpan - number of columns this should span
newButton - true if the combo is to have a "New..." button beside it

createSystemTypeCombo

public static Combo createSystemTypeCombo(Composite parent,
                                          Listener listener)
Creates a readonly system type combination box. Does NOT create the leading prompt or anything except the combo.


createSystemTypeCombo

public static Combo createSystemTypeCombo(Composite parent,
                                          Listener listener,
                                          String[] systemTypes)
Creates a readonly system type combination box with the given system types. Does NOT create the leading prompt or anything except the combo.


createHostNameCombo

public static Combo createHostNameCombo(Composite parent,
                                        Listener listener,
                                        String systemType)
Creates a hostname combination box. It if prefilled with all previously specified hostnames for the given system type.

Does NOT create the leading prompt or anything except the combo.


createInheritButton

public static InheritControl createInheritButton(Composite parent,
                                                 SelectionListener listener)
Create a inherit/override switch button.

Parameters:
parent - composite to put the button into.
listener - object to listen for selection events. Can be null.

createInheritButton

public static InheritControl createInheritButton(Composite parent,
                                                 SelectionListener listener,
                                                 ResourceBundle bundle,
                                                 String toolTipId)
Create a inherit/override switch button with tooltip text

Parameters:
parent - composite to put the button into.
listener - object to listen for selection events. Can be null.
bundle - ResourceBundle of tooltip text

createInheritableTextField

public static InheritableEntryField createInheritableTextField(Composite parent,
                                                               ResourceBundle bundle,
                                                               String toggleToolTipId,
                                                               String entryToolTipId)
Create an entry field controlled by an inherit/override switch button

After creating the widget, call setLocal to set initial state, and setInheritedText/setLocalText to set inherited/local text

Parameters:
parent - composite to put the button into.
bundle - ResourceBundle of tooltip text. Can be null if no tool tips supplied
Returns:
The text field widget

lineUpPrompts

public static void lineUpPrompts(Composite composite)
Helper method to line up the leading prompts in a composite, taking into account composite prompts nested within.


getFirstColumnOneLabel

public static Label getFirstColumnOneLabel(Composite composite)
Given a composite that has been layed out, return the first label found in the first column.


setMnemonics

public static Mnemonics setMnemonics(Composite parent)
Given a Composite, this method walks all the children recursively and and sets the mnemonics uniquely for each child control where a mnemonic makes sense (eg, buttons). The letter/digit chosen for the mnemonic is unique for this Composite, so you should call this on as high a level of a composite as possible per Window. Call this after populating your controls.

Returns:
mnemonics object used for recording used-mnemonics. Use this as input to subsequent calls to setMnemonics for the same window/dialog.

setMnemonics

public static Mnemonics setMnemonics(Composite parent,
                                     boolean applyToPrecedingLabels)
Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.


setWizardPageMnemonics

public static Mnemonics setWizardPageMnemonics(Composite parent)
Same as above but specifically for wizard pages


setWizardPageMnemonics

public static Mnemonics setWizardPageMnemonics(Composite parent,
                                               boolean applyToPrecedingLabels)
Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.


setPreferencePageMnemonics

public static Mnemonics setPreferencePageMnemonics(Composite parent)
Same as above but specifically for preference pages


setPreferencePageMnemonics

public static Mnemonics setPreferencePageMnemonics(Composite parent,
                                                   boolean applyToPrecedingLabels)
Same as above but also whether to apply mnemonics to labels preceding text fields, combos and inheritable entry fields.


setCompositeHelp

public static void setCompositeHelp(Composite parent,
                                    String helpID)
Given a Composite, this method walks all the children recursively and and sets the infopop help id for each child control where help makes sense (eg, buttons, combos, entry fields, lists, trees).

Call this after populating your controls.


setHelp

public static void setHelp(Control c,
                           IViewPart view,
                           Object id)
Deprecated.  

Set the context id for a control on a view part


setHelp

public static void setHelp(Control c,
                           String id)
Set the context id for a control


appendColon

public static String appendColon(String label)
Appends a colon to a label, if the label doesn't already end in a colon of the proper size. If the wrong size colon is already there, it strips it first.

Parameters:
label -
Returns:
the label ending with a colon of the appropriate size

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.