|
JAPI 0_6-alpha-2 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)
|
protected Object |
clone()
|
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(Window window)
window - Window to be disposed when this action is activated| Method Detail |
|---|
public static DisposeAction install(JDialog dialog)
dialog - JDialog to install to
public void actionPerformed(ActionEvent e)
protected Object clone()
throws CloneNotSupportedException
clone in class AbstractActionCloneNotSupportedException
|
JAPI Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||