|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.gui.dialog.DialogUtility
public class DialogUtility
This class provides utilities to make a dialog box.
Method Summary | |
---|---|
static void |
createButtons(Shell parent,
Listener selectionListener,
int indent)
Creates a OK button and a cancel button to the shell. |
static void |
createButtons(Shell parent,
Listener selectionListener,
int indent,
java.lang.String label,
int columns)
Creates a OK button and a cancel button to the shell. |
static Tree |
createCustomFeedTree(Composite parent,
Folder root,
int style)
Creates a Tree object with provided root and style. |
static Tree |
createFeedTree(Composite parent,
Folder root,
int style)
Creates a Tree object with provided root and style. |
static Tree |
createFolderTree(Composite parent,
Folder root,
int style)
Creates a Tree object with provided root and style. |
static Tree |
createFolderTreeWithLabel(Composite parent,
java.lang.String label,
int labelSpan,
Folder root,
int height)
Creates a label and a folder tree, and retrurns the created tree. |
static Text |
createLargeTextWithLabel(Composite parent,
java.lang.String label,
int labelSpan,
int height)
Creates a label and text field with given layout, label, labelSpan. |
static java.util.List<Button> |
createRadioButtonsWithLabel(Composite parent,
java.lang.String label,
java.util.List<java.lang.String> buttonLabels,
int buttonsPerLine)
Creates radio buttons in one group, and returns buttons as a list. |
static Text |
createTextWithLabel(Composite parent,
java.lang.String label,
int labelSpan)
Creates a label and text field with given layout, label, labelSpan. |
static Text |
createTextWithLabel(Composite parent,
java.lang.String label,
int labelSpan,
int fieldSpan)
Creates a label and text field with given layout, label, labelSpan, and fieldSpan, and returns text field object. |
static Tree |
createTree(Composite parent,
Folder root,
int style,
fable.gui.dialog.DialogUtility.ConstructTreeStrategy strategy)
Create a tree with specified parent composite, root of the tree structure, style, and strategy to build the tree. |
static void |
error(Shell parent,
java.lang.String message)
Pop up a message box notifies users that there is some error. |
static Shell |
initializeShell(Dialog dialog,
java.lang.String title,
int style,
int numColumns)
Initializes shell of the dialog box and return it. |
static void |
launchShell(Dialog dialog,
Shell shell)
This method shows the shell until it is disposed. |
static void |
launchShell(Dialog dialog,
Shell shell,
fable.gui.dialog.DialogUtility.Action action)
This method shows the shell, but just before it opens the shell, it does some special action, and opens the shell until it is disposed. |
static void |
message(Shell parent,
java.lang.String message,
int style,
java.lang.String title)
Pop up a message box notifies users. |
static void |
selectCurrentPosition(Tree tree,
java.lang.Object currentPosition)
Let the tree select a current position as default. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Shell initializeShell(Dialog dialog, java.lang.String title, int style, int numColumns)
dialog
- dialog object that will use the shell.title
- title of the dialog box.style
- style of the dialog box. Some of the styles are already
specified here, such as SWT.DIALOG_TRIM and SWT.APPLICATION_MODAL.numColumns
- number of columns that the grid layout of this
dialog box will have.
public static void launchShell(Dialog dialog, Shell shell)
dialog
- dialog object that will be shownshell
- shell of the dialog objectpublic static void launchShell(Dialog dialog, Shell shell, fable.gui.dialog.DialogUtility.Action action)
dialog
- dialog object that will be shown.shell
- shell of the dialog object.action
- action that will be done just before openning the dialog
box.public static Tree createTree(Composite parent, Folder root, int style, fable.gui.dialog.DialogUtility.ConstructTreeStrategy strategy)
parent
- parent composite of a tree.root
- root of a tree structure.style
- style of a treestrategy
- strategy to build a tree
public static Tree createFolderTree(Composite parent, Folder root, int style)
parent
- parent dialog box shell of the tree.root
- root of the tree.style
- style of the tree.
public static Tree createFeedTree(Composite parent, Folder root, int style)
parent
- parent dialog box shell of the tree.root
- root of the tree.style
- style of the tree.
public static Tree createCustomFeedTree(Composite parent, Folder root, int style)
parent
- parent dialog box shell of the tree.root
- root of the tree.style
- style of the tree.
public static void createButtons(Shell parent, Listener selectionListener, int indent, java.lang.String label, int columns)
parent
- parent shell of the buttons.selectionListener
- listener that will be associated with the OK
button.indent
- indentation that the OK button and cancel button will have.label
- label of the Ok button, if another name is desirable.columns
- number of columns to be filled, if not whole line should
be filled.public static void createButtons(Shell parent, Listener selectionListener, int indent)
parent
- parent shell of the buttons.selectionListener
- listener that will be associated with the OK
button.indent
- indentation that the OK button and cancel button will have.public static Text createTextWithLabel(Composite parent, java.lang.String label, int labelSpan, int fieldSpan)
parent
- parent dialog box shell of the label and text field.label
- label string.labelSpan
- number of cells that the label will consume.fieldSpan
- number of cells that the field will consume.
public static Text createTextWithLabel(Composite parent, java.lang.String label, int labelSpan)
parent
- parent dialog box shell of the label and text field.label
- label string.labelSpan
- number of cells that the label will consume.
public static Text createLargeTextWithLabel(Composite parent, java.lang.String label, int labelSpan, int height)
parent
- parent dialog box shell of the label and text field.label
- label string.labelSpan
- number of cells that the label will consume.
public static Tree createFolderTreeWithLabel(Composite parent, java.lang.String label, int labelSpan, Folder root, int height)
parent
- parent dialog box shell of the label and the tree.label
- label string.labelSpan
- number of cells that the label will consume.root
- root of the tree.height
- minimum height of the tree.
public static java.util.List<Button> createRadioButtonsWithLabel(Composite parent, java.lang.String label, java.util.List<java.lang.String> buttonLabels, int buttonsPerLine)
parent
- parent dialog box shell of the group.label
- label of the group.buttonLabels
- labels of the buttons.buttonsPerLine
- the number of buttons in one line.
public static void error(Shell parent, java.lang.String message)
parent
- parent shell of the message box.message
- message to show.public static void selectCurrentPosition(Tree tree, java.lang.Object currentPosition)
tree
- tree to select a node.currentPosition
- a data associated with the desired TreeItem.public static void message(Shell parent, java.lang.String message, int style, java.lang.String title)
parent
- parent shell of the message box.message
- message to show.style
- style of the message box.title
- title of the message box.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |