M
- What kind of model this dialog can showpublic abstract class AbstractPreferenceDialog<M extends PreferenceModel>
extends javax.swing.JPanel
PreferenceModel
. The
exact graphical user interface for the model depends on the subclass.destroy()
. The only time destroy()
has
not to be called is if the dialog was shown using openDialog(Component, boolean)
and destroyOnClose
was set to true
.javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier | Constructor and Description |
---|---|
|
AbstractPreferenceDialog(boolean destroyOnClose)
Creates a new dialog.
|
protected |
AbstractPreferenceDialog(boolean init,
M model,
boolean destroyOnClose)
A constructor which does not initialize this dialog.
|
|
AbstractPreferenceDialog(M model,
boolean destroyOnClose)
Creates a new dialog using the given model.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Makes the dialog invisible.
|
void |
destroy()
Allows this dialog to free any resources that it used.
|
void |
doApply()
Applies all changes but does not close the dialog.
|
void |
doCancel()
Closes the dialog without saving and changes
|
void |
doOk()
Applies all changes and closes the dialog.
|
void |
doReset()
Resets all preferences to the value they had when the dialog opened
|
protected abstract javax.swing.JComponent |
getContent()
Gets the component which will show the
model
of this dialog. |
M |
getModel()
Gets the model which is shown on this dialog.
|
protected void |
init(M model,
boolean destroyOnClose)
Creates the contents of this dialog.
|
boolean |
isDestroyOnClose()
Tells whether
destroy() is called automatically or not. |
void |
openDialog(java.awt.Component owner,
boolean modal)
Opens the dialog (if not yet open) and lets the user make the changes
of the preferences.
|
void |
setDestroyOnClose(boolean destroyOnClose)
|
void |
setModel(M model)
Sets the model of this dialog.
|
protected abstract void |
setModelForContent(M model)
Informs subclasses that the model has changed and that they might
setup the
content again. |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public AbstractPreferenceDialog(boolean destroyOnClose)
destroyOnClose
- if set to true
, then destroy()
is automatically called
if close()
is called. Clients have to call destroy()
manually if they are not
using openDialog(Component, boolean)
.public AbstractPreferenceDialog(M model, boolean destroyOnClose)
model
- the model to usedestroyOnClose
- if set to true
, then destroy()
is automatically called
if close()
is called. Clients have to call destroy()
manually if they are not
using openDialog(Component, boolean)
.protected AbstractPreferenceDialog(boolean init, M model, boolean destroyOnClose)
init(PreferenceModel, boolean)
to finish constructing this dialog.init
- whether to call init(PreferenceModel, boolean)
.model
- the model to use, can be null
destroyOnClose
- if set to true
, then destroy()
is automatically called
if close()
is called. Clients have to call destroy()
manually if they are not
using openDialog(Component, boolean)
.protected void init(M model, boolean destroyOnClose)
model
- the model to use, can be null
destroyOnClose
- if set to true
, then destroy()
is automatically called
if close()
is called. Clients have to call destroy()
manually if they are not
using openDialog(Component, boolean)
.protected abstract javax.swing.JComponent getContent()
model
of this dialog.protected abstract void setModelForContent(M model)
content
again.model
- the new model, can be null
public void setModel(M model)
model
- the new modelpublic M getModel()
public void openDialog(java.awt.Component owner, boolean modal)
PreferenceModel.read()
and
PreferenceModel.write()
to reset or to apply the changes of the user.owner
- the owner of the dialogmodal
- whether the dialog should be modalpublic void doOk()
public void doApply()
public void doCancel()
public void doReset()
public void close()
public void destroy()
public boolean isDestroyOnClose()
destroy()
is called automatically or not.setDestroyOnClose(boolean)
public void setDestroyOnClose(boolean destroyOnClose)
destroyOnClose
- whether to free resources