|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.ceryle.ui.OptionDialog
public class OptionDialog
Extends JDialog providing a set of radio buttons for making a multiple-option decision. The result is returned as an int (indicating which of the options was selected) via getResult(), -1 if none were selected or the dialog was cancelled.
The supplied options can be in one of two forms, either a List of Strings, or a List of String[] arrays, the latter pairings where the first String is the displayed item, the second descriptive text that shows up in a Help box when the item is selected. If the help text is a single token it will be treated as the ID of a Help tutorial, such that clicking the Help button will instead load that tutorial.
Note that if one of the list options is akin to "Cancel this operation.", the display of the Cancel button should be suppressed with a "false" parameter value for includeCancel, since selecting this option means the same thing.
The help text area supports simple HTML 3.2-era presentational markup.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JDialog |
|---|
JDialog.AccessibleJDialog |
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static boolean |
defaultHelpVisible
A flag indicating the initial visibility of help. |
static int |
dlog_width
The preferred width of the dialog. |
static int |
scroll_minimum
The maximum number of list items prior to using a scrolling list. |
| Fields inherited from class javax.swing.JDialog |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
OptionDialog(Desktop desktop,
String title,
String message,
List options,
boolean[] enables,
int defaultOption,
String help,
boolean includeCancel)
Constructor for a dialog box for selecting amongst a set of options. |
|
OptionDialog(Desktop desktop,
String title,
String message,
List options,
int defaultOption,
String help,
boolean includeCancel)
Constructor for a dialog box for selecting amongst a set of options. |
|
OptionDialog(String title,
String message,
List options,
int defaultOption,
String help,
boolean includeCancel)
Constructor for a dialog box for selecting amongst a set of options. |
|
| Method Summary | |
|---|---|
int |
getSelected()
Returns the number of the selected option (starting at 1, not 0). |
void |
setSelected(JRadioButton button)
Sets the selected option. |
void |
setVisible(boolean visible)
Overrides the superclass to additionally re-set the graph display priority. |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean defaultHelpVisible
public static int scroll_minimum
public static int dlog_width
| Constructor Detail |
|---|
public OptionDialog(String title,
String message,
List options,
int defaultOption,
String help,
boolean includeCancel)
title - the dialog titlemessage - the message or question, which can include HTML markupoptions - the List of Strings, a List of String[] or Object[]defaultOption - the number of the default (selected) choice, -1 if none.help - optional help text, or if a single token, the Help ID.includeCancel - include cancel button?
public OptionDialog(Desktop desktop,
String title,
String message,
List options,
int defaultOption,
String help,
boolean includeCancel)
desktop - the parent applicationtitle - the dialog titlemessage - the message or question, which can include HTML markupoptions - the List of Strings, a List of String[] or Object[]defaultOption - the number of the default (selected) choice, -1 if none.help - optional help text, or if a single token, the Help ID.includeCancel - include cancel button?
public OptionDialog(Desktop desktop,
String title,
String message,
List options,
boolean[] enables,
int defaultOption,
String help,
boolean includeCancel)
desktop - the parent applicationtitle - the dialog titlemessage - the message or question, which can include HTML markupoptions - the List of Strings, a List of String[] or Object[]enables - an optional boolean array (size must match count of objects or is ignored)defaultOption - the number of the default (selected) choice, -1 if none.help - optional help text, or if a single token, the Help ID.includeCancel - include cancel button?| Method Detail |
|---|
public void setVisible(boolean visible)
setVisible in class Componentpublic int getSelected()
public void setSelected(JRadioButton button)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||