|
JAPI 0.9.0 Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
net.sf.japi.swing.DisposeAction
public final class DisposeAction
An Action implementation that disposes a window when activated. Usually, you'd put an instance of this class in an actionmap, eventually pointing an inputmap to it. Usage example:
JDialog d = new JDialog();
DisposeAction da = new DisposeAction(d);
d.getRootPane().getActionMap().put("close", da);
d.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
The convenience method install(JDialog) will do exactly that for an existing JDialog.
| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
DisposeAction(Window window)
Create a DisposeAction. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Invoked when an action occurs. |
protected Object |
clone()
Clones the abstract action. |
static DisposeAction |
install(JDialog dialog)
Install the DisposeAction to a JDialog for the ESCAPE key. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DisposeAction(@NotNull
Window window)
window - Window to be disposed when this action is activated| Method Detail |
|---|
public static DisposeAction install(@NotNull
JDialog dialog)
dialog - JDialog to install to
public void actionPerformed(@NotNull
ActionEvent e)
protected Object clone()
throws CloneNotSupportedException
Object.clone().
clone in class AbstractActionCloneNotSupportedException - if the object's class does not
support the Cloneable interface. Subclasses
that override the clone method can also
throw this exception to indicate that an instance cannot
be cloned.Cloneable
|
JAPI Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||