org.eclipse.corona.ui.tools
Class GUIUtility

java.lang.Object
  extended by org.eclipse.corona.ui.tools.GUIUtility

public class GUIUtility
extends java.lang.Object

The PluginGUI contains various methods to create SWT widgets. These widgets are used to create the various COS plugin display fields.


Constructor Summary
GUIUtility()
           
 
Method Summary
static org.eclipse.swt.widgets.Button createCheckBox(org.eclipse.swt.widgets.Composite parent, java.lang.String checkBoxText, org.eclipse.swt.events.SelectionListener selectionListener)
          Method that creates a check box instance and sets the default layout data.
static org.eclipse.swt.widgets.Combo createCombo(org.eclipse.swt.widgets.Composite parent, java.lang.String name)
          Method that creates a combo box instance and sets the default layout data.
static org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent, int numColumns)
          Creates composite control and sets the default layout data.
static org.eclipse.swt.widgets.Label createDescriptionLabel(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
          Method that creates a label instance and sets the default layout data.
static org.eclipse.swt.widgets.Control createEmptySpace(org.eclipse.swt.widgets.Composite parent, int span)
          Creates a spacer control with the given span.
static org.eclipse.swt.widgets.Composite createGroupComposite(org.eclipse.swt.widgets.Composite parent, java.lang.String title, int numColumns)
          Creates a group composite control and sets the default layout data.
static org.eclipse.swt.widgets.Label createImage(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Image image)
          Method that create an image.
static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, java.lang.String text)
          Method that creates a label instance and sets the default layout data.
static org.eclipse.swt.widgets.Button createPushButton(org.eclipse.swt.widgets.Composite parent, java.lang.String buttonText, org.eclipse.swt.events.SelectionListener selectionListener)
          Method that creates a push button instance and sets the default layout data.
static org.eclipse.swt.widgets.Button createRadioButton(org.eclipse.swt.widgets.Composite parent, java.lang.String checkBoxText, org.eclipse.swt.events.SelectionListener selectionListener)
          Method that creates a radio button instance and sets the default layout data.
static org.eclipse.swt.widgets.Text createTextField(org.eclipse.swt.widgets.Composite parent, java.lang.String name, java.lang.String value)
          Method that creates a text field instance and sets the default layout data.
static org.eclipse.swt.widgets.Text createTextField(org.eclipse.swt.widgets.Composite parent, java.lang.String name, java.lang.String value, org.eclipse.swt.graphics.Color foregroundColor, org.eclipse.swt.graphics.Color backgroundColor)
           
static java.lang.String showDirectorySelectionDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String filterPath, java.lang.String messageText)
          This method display a dialog box that allows the user to select a directory.
static java.lang.String showFileSelectionDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String filterPath, java.lang.String[] extensions, java.lang.String titleText)
          This method display a dialog box that allows the user to select a directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GUIUtility

public GUIUtility()
Method Detail

createComposite

public static org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent,
                                                                int numColumns)
Creates composite control and sets the default layout data. This Composite is local to the Preference page and is used to format a set of controls on the page.

Parameters:
parent - the parent of the new composite
numColumns - the number of columns for the new composite
Returns:
the newly-created coposite

createGroupComposite

public static org.eclipse.swt.widgets.Composite createGroupComposite(org.eclipse.swt.widgets.Composite parent,
                                                                     java.lang.String title,
                                                                     int numColumns)
Creates a group composite control and sets the default layout data. This Composite is local to the Preference page and is used to format a set of controls on the page.

Parameters:
parent - The parent of the new composite
numColumns - The number of columns for the new composite
Returns:
the newly-created coposite

createLabel

public static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                        java.lang.String text)
Method that creates a label instance and sets the default layout data.

Parameters:
parent - the parent for the new label
text - the text for the new label
Returns:
the new label

createDescriptionLabel

public static org.eclipse.swt.widgets.Label createDescriptionLabel(org.eclipse.swt.widgets.Composite parent,
                                                                   java.lang.String text)
Method that creates a label instance and sets the default layout data.

Parameters:
parent - the parent for the new label
text - the text for the new label
Returns:
the new label

createImage

public static org.eclipse.swt.widgets.Label createImage(org.eclipse.swt.widgets.Composite parent,
                                                        org.eclipse.swt.graphics.Image image)
Method that create an image.

Parameters:
parent - The parent for the new label
image - The image to be displayed
Returns:
The newly created Label instance.

createTextField

public static org.eclipse.swt.widgets.Text createTextField(org.eclipse.swt.widgets.Composite parent,
                                                           java.lang.String name,
                                                           java.lang.String value)
Method that creates a text field instance and sets the default layout data.

Parameters:
parent - the parent of the new text field
Returns:
the new text field

createTextField

public static org.eclipse.swt.widgets.Text createTextField(org.eclipse.swt.widgets.Composite parent,
                                                           java.lang.String name,
                                                           java.lang.String value,
                                                           org.eclipse.swt.graphics.Color foregroundColor,
                                                           org.eclipse.swt.graphics.Color backgroundColor)

createCombo

public static org.eclipse.swt.widgets.Combo createCombo(org.eclipse.swt.widgets.Composite parent,
                                                        java.lang.String name)
Method that creates a combo box instance and sets the default layout data.

Parameters:
parent - the parent of the new text field
name - (optional)
Returns:
the new combo box

createPushButton

public static org.eclipse.swt.widgets.Button createPushButton(org.eclipse.swt.widgets.Composite parent,
                                                              java.lang.String buttonText,
                                                              org.eclipse.swt.events.SelectionListener selectionListener)
Method that creates a push button instance and sets the default layout data.

Parameters:
parent - The parent composite.
buttonText - The text to be display within the button.
selectionListener - The selection listener for the button.
Returns:
The newly created button instance.

createCheckBox

public static org.eclipse.swt.widgets.Button createCheckBox(org.eclipse.swt.widgets.Composite parent,
                                                            java.lang.String checkBoxText,
                                                            org.eclipse.swt.events.SelectionListener selectionListener)
Method that creates a check box instance and sets the default layout data.

Parameters:
parent - The parent composite.
buttonText - The text to be display within the button.
selectionListener - The selection listener for the button.
Returns:
The newly created button instance.

createRadioButton

public static org.eclipse.swt.widgets.Button createRadioButton(org.eclipse.swt.widgets.Composite parent,
                                                               java.lang.String checkBoxText,
                                                               org.eclipse.swt.events.SelectionListener selectionListener)
Method that creates a radio button instance and sets the default layout data.

Parameters:
parent - The parent composite.
buttonText - The text to be display within the button.
selectionListener - The selection listener for the button.
Returns:
The newly created button instance.

createEmptySpace

public static org.eclipse.swt.widgets.Control createEmptySpace(org.eclipse.swt.widgets.Composite parent,
                                                               int span)
Creates a spacer control with the given span. The composite is assumed to have GridLayout as layout.

Parameters:
parent - The parent composite

showDirectorySelectionDialog

public static java.lang.String showDirectorySelectionDialog(org.eclipse.swt.widgets.Shell parentShell,
                                                            java.lang.String filterPath,
                                                            java.lang.String messageText)
This method display a dialog box that allows the user to select a directory.

Parameters:
parentShell - Parent Shell.
filterPath - Path to use to filter selection.
messageText - Text to be display to the user. Describes what user should do.
Returns:
The seelected directory. null is returned if the user did not select a directory.

showFileSelectionDialog

public static java.lang.String showFileSelectionDialog(org.eclipse.swt.widgets.Shell parentShell,
                                                       java.lang.String filterPath,
                                                       java.lang.String[] extensions,
                                                       java.lang.String titleText)
This method display a dialog box that allows the user to select a directory.

Parameters:
parentShell - Parent Shell.
filterPath - Path to use to filter selection.
titleText - Text to be display as the title. Describes what user should do.
Returns:
The selected file name. null is returned if the user did not select a file.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.