|
||||||||||
| 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.fife.ui.EscapableDialog
org.fife.ui.OptionsDialog
An options dialog similar to those found in many Microsoft Windows
applications. An OptionsDialog contains a list on its left-hand
side containing options categories; clicking on a category displays all
options related to that category.
Using this class along with OptionsDialogPanel will provide you
with a framework for creating an Options dialog with error checking and
instant-Apply functionality.
OptionsDialogPanel,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
| Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
| 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 | |
OptionsDialog(java.awt.Frame owner)
Creates a new options dialog with no options panels. |
|
OptionsDialog(java.awt.Frame owner,
OptionsDialogPanel[] optionsPanels)
Creates a new options dialog with the specified array of option panels. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Listens for action events in this dialog. |
boolean |
doApply(java.awt.Frame owner)
Automatically called when the user clicks the "Apply" button and when the user first clicks the "OK" button before the dialog goes away. |
protected void |
escapePressed()
Called when the Escape key is pressed in this dialog. |
java.lang.String |
getApplyButtonText()
Returns the text on the "Apply" button. |
java.lang.String |
getCancelButtonText()
Returns the text on the "Cancel" button. |
java.lang.String |
getOKButtonText()
Returns the text on the "OK" button. |
protected OptionsDialogPanel[] |
getOptionsDialogPanels()
Returns the option panels. |
void |
initialize()
Initializes all fields/radio buttons/etc. in this options dialog with their proper states as obtained from the owner of this options dialog (as passed into the constructor). |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Listens for a property change in one of the option panels. |
void |
setApplyButtonEnabled(boolean enabled)
Enables or disables the "Apply" button. |
void |
setApplyButtonText(java.lang.String text)
Sets the text on the "Apply" button. |
void |
setCancelButtonText(java.lang.String text)
Sets the text on the "Cancel" button. |
void |
setOKButtonText(java.lang.String text)
Sets the text on the "OK" button. |
void |
setOptionsPanels(OptionsDialogPanel[] optionsPanels)
Sets the options panels available on this options dialog. |
boolean |
setSelectedOptionsPanel(java.lang.String name)
Selects the options panel with the specified name. |
void |
setVisible(boolean visible)
This method is overridden to ensure that all nodes in the tree are expanded (as if they're not, the size of the window and its widgets may be incorrect; not enough room for the tree). |
void |
valueChanged(javax.swing.event.TreeSelectionEvent e)
Listens for the user to select values in the tree. |
| Methods inherited from class org.fife.ui.EscapableDialog |
setEscapeClosesDialog |
| Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public OptionsDialog(java.awt.Frame owner)
owner - The parent of this dialog.
public OptionsDialog(java.awt.Frame owner,
OptionsDialogPanel[] optionsPanels)
owner - The parent of this dialog.optionsPanels - The option panels to add to this options dialog.
Note that this array MUST have at least one panel in it;
otherwise, this constructor will throw a
NullPointerException.OptionsDialogPanel| Method Detail |
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerprotected void escapePressed()
escapePressed in class EscapableDialogpublic final boolean doApply(java.awt.Frame owner)
ensureValidInputs on all option panels; then it actually
applies the changes to the application. If all inputs were valid, then
the Apply button is disabled and the "unsaved changes" flag for all
Options panels is cleared. If there was a problem in any of the
inputs, an error dialog is displayed.
owner - The parent frame that was specified in the constructor.
true if all options checked out okay and the apply
was successful; false if at least one option
wasn't valid (and thus the Options dialog needs to stay up).public final java.lang.String getApplyButtonText()
setApplyButtonText(java.lang.String)public final java.lang.String getCancelButtonText()
setCancelButtonText(java.lang.String)public final java.lang.String getOKButtonText()
setOKButtonText(java.lang.String)protected OptionsDialogPanel[] getOptionsDialogPanels()
public void initialize()
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpublic void setApplyButtonEnabled(boolean enabled)
enabled - Whether or not the Apply button should be enabled.public void setApplyButtonText(java.lang.String text)
text - The text to use on the Apply button.getApplyButtonText()public void setCancelButtonText(java.lang.String text)
text - The text to use on the Cancel button.getCancelButtonText()public void setOKButtonText(java.lang.String text)
text - The text to use on the OK button.getOKButtonText()public void setOptionsPanels(OptionsDialogPanel[] optionsPanels)
optionsPanels - The options panels to be available.public boolean setSelectedOptionsPanel(java.lang.String name)
name - The name of the panel.
false if name is not the name of an
options panel added to this dialog.public void setVisible(boolean visible)
visible - Whether or not this dialog should be visible.public void valueChanged(javax.swing.event.TreeSelectionEvent e)
valueChanged in interface javax.swing.event.TreeSelectionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||