|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.Command
com.pietschy.command.ActionCommand
com.pietschy.command.CloseWindowCommand<T>
public class CloseWindowCommand<T extends java.awt.Window>
Provides common funcitonality used for closing windows. This command performs the following,
WindowListener to the window to handle close requests direct
from the window managerComponent.setVisible(boolean) and optionally
calls Window.dispose() if isDisposeOnClose() returns true.
Subclasses can alter the behaviour of the command by overriding the #handleClose(T) method.
The following is an example using a JDialog.
#configuration
close-dialog@face.text=_Close@ESCAPE
CloseWindowCommand<JDialog> command = new CloseWindowCommand<JDialog&rt;("close-dialog");
command.setWindow(myDialog);
| Field Summary |
|---|
| Fields inherited from class com.pietschy.command.ActionCommand |
|---|
PARAMETER_ACTION_EVENT, PARAMETER_INVOKER, PARAMETER_INVOKER_WINDOW, PARAMETER_MODIFIERS |
| Fields inherited from class com.pietschy.command.Command |
|---|
internalLog, PROPERTY_ENABLED, PROPERTY_VISIBLE |
| Constructor Summary | |
|---|---|
CloseWindowCommand()
Creates a new anonymous instance. |
|
CloseWindowCommand(java.lang.String id)
Creates a new instance with the specified id. |
|
CloseWindowCommand(java.lang.String id,
T window)
Creates a new instance with the specified id and that closes the specified window. |
|
CloseWindowCommand(T window)
Creates a new anonymous instance that closes the specified window. |
|
| Method Summary | |
|---|---|
T |
getTargetWindow()
Gets the window associated with this command. |
protected void |
handleClose(T window)
Called to close the specified window. |
protected void |
handleExecute()
Invokes #handleClose(T). |
boolean |
isDisposeOnClose()
Checks if the window should be disposed on close. |
void |
setDisposeOnClose(boolean disposeOnClose)
Configures this command to dispose the window on close. |
void |
setTargetWindow(T newWindow)
Sets the window that this command will close. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.pietschy.command.ActionCommandExecutor |
|---|
addPropertyChangeListener, addPropertyChangeListener, isEnabled, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.pietschy.command.Identifiable |
|---|
getId |
| Constructor Detail |
|---|
public CloseWindowCommand()
#setWindow(T)public CloseWindowCommand(java.lang.String id)
id - the command id.#setWindow(T)
public CloseWindowCommand(java.lang.String id,
T window)
id - the command id.window - the window to close.public CloseWindowCommand(T window)
window - the window to close.| Method Detail |
|---|
public void setTargetWindow(T newWindow)
newWindow - the new window to close.protected void handleExecute()
#handleClose(T).
handleExecute in class ActionCommandprotected void handleClose(T window)
false and invokes Window.dispose() if
isDisposeOnClose() returns true.
Subclasses can override to perform application specific close operations.
window - the window to close.public T getTargetWindow()
public boolean isDisposeOnClose()
true to dispose the window on
close, false otherwise.public void setDisposeOnClose(boolean disposeOnClose)
disposeOnClose - true to invoke Window.dispose()
during #handleClose(T), false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||