|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog | +--javax.swing.JDialog | +--de.qfs.lib.gui.ModalDialog | +--de.qfs.lib.option.OptionDialog
This class offers a convenient way to bring up a dialog in which an application's options can be edited.
Since version 0.98.0 this class is based on ModalDialog
, so the buttons of the dialog can
be customized easily. Please see the documentation for ModalDialog about
the resources used.
OptionDialog defines one additional resource for each button:
dialog.button.name.set
. If true, pressing the button
causes the values the user entered to be read from the dialog and stored in
the options. If this fails due to illegal values, the action is aborted.
The default for the set
property is false.
If no name
resource is defined for the dialog, its AWT name is
set to "OptionDialog-<root>-<options>"
where
<root>
is the resource name of the root OptionGroup and
<options>
is the configurable name of the OptionSet
being edited.
Inner Class Summary | |
protected static class |
OptionDialog.OptionButtonData
Extend the structure that encapsulates the values for a button. |
Inner classes inherited from class de.qfs.lib.gui.ModalDialog |
ModalDialog.ButtonData |
Inner classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
Inner classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected OptionGroup |
optionGroup
The OptionGroup displayed in the dialog. |
protected OptionSet |
options
The Options to edit. |
protected java.awt.Window |
parent
The parent Window for the Dialog. |
protected java.lang.String |
root
The name of the root OptionGroup. |
Fields inherited from class de.qfs.lib.gui.ModalDialog |
buttons, CANCEL_OPTION, CLOSED_OPTION, defaultButtons, layout, mainComponent, mainPanel, minHeight, minWidth, name, NO_OPTION, OK_OPTION, panel, retval, YES_OPTION |
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, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
OptionDialog(java.awt.Frame parent,
java.lang.String title,
OptionSet options,
java.lang.String root)
Deprecated. Replaced with OptionDialog as of version 0.98.0. |
|
OptionDialog(java.lang.String name,
java.awt.Dialog parent,
OptionSet options,
java.lang.String root)
Create a new OptionDialog. |
|
OptionDialog(java.lang.String name,
java.awt.Frame parent,
OptionSet options,
java.lang.String root)
Create a new OptionDialog. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handler for a button press. |
boolean |
doModal()
Bring up the Dialog and wait for the user to finish editing. |
OptionGroup |
getGroup()
Get the OptionGroup of the dialog. |
int |
getResult()
Get the result for the last doModal operation. |
protected ModalDialog.ButtonData |
initButton(java.lang.String bname,
MapResourceBundle rb)
Initialize one button. |
protected void |
initComponent()
Initialize the OptionGroup. |
boolean |
readValues()
Read the current values from the dialog, store them in the options and notify the observers. |
void |
setParent(java.awt.Frame parent)
Deprecated. The window's owner cannot really be changed. To place the dialog relative to some component use doModal(Component,boolean) . |
void |
update(OptionSet options)
Update the display of the OptionGroups. |
Methods inherited from class de.qfs.lib.gui.ModalDialog |
buttonResName, doModal, findButton, fixSize, getButton, getButton, getButtonCount, init, initButtonNames, resName, setMainComponent, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened |
Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected OptionSet options
protected java.lang.String root
protected OptionGroup optionGroup
protected java.awt.Window parent
Constructor Detail |
public OptionDialog(java.awt.Frame parent, java.lang.String title, OptionSet options, java.lang.String root)
OptionDialog
as of version 0.98.0.
parent
- The parent Frame.title
- The title to display.options
- The Options to edit.root
- The resource name of the root of the OptionGroups. If
null, the configurable name of the OptionSet will be
used.public OptionDialog(java.lang.String name, java.awt.Frame parent, OptionSet options, java.lang.String root)
name
- The resource name of the dialog.parent
- The parent Frame.options
- The Options to edit.root
- The resource name of the root of the OptionGroups. If
null, the configurable name of the OptionSet will be
used.public OptionDialog(java.lang.String name, java.awt.Dialog parent, OptionSet options, java.lang.String root)
name
- The resource name of the dialog.parent
- The parent Dialog.options
- The Options to edit.root
- The resource name of the root of the OptionGroups. If
null, the configurable name of the OptionSet will be
used.Method Detail |
public boolean readValues()
public void update(OptionSet options)
options
- The Options to use. Null means use original Options.public boolean doModal()
To get the full benefit of the configurable buttons, use doModal(Component,boolean)
instead.
public void setParent(java.awt.Frame parent)
doModal(Component,boolean)
.
parent
- The parent Frame to set.public OptionGroup getGroup()
public final int getResult()
doModal
operation. This is
necessary to determine the button the user selected.protected void initComponent()
initComponent
in class ModalDialog
protected ModalDialog.ButtonData initButton(java.lang.String bname, MapResourceBundle rb)
initButton
in class ModalDialog
bname
- The resource name of the button.rb
- The resources to use.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in class ModalDialog
e
- The event containing the details.
|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |