com.sdm.quasar.client.swing.commands.adapters
Class WindowClosingCommandAdapter

java.lang.Object
  extended bycom.sdm.quasar.client.core.commands.AbstractCommandAdapter
      extended bycom.sdm.quasar.client.swing.commands.adapters.WindowClosingCommandAdapter
All Implemented Interfaces:
CommandAdapter, Disposable

public class WindowClosingCommandAdapter
extends AbstractCommandAdapter

The WindowClosingCommandAdapter is an adapter between a Windowsand a Command:

It trigges the Command, when a WindowEvent is fired signalling the closing of the window.

Author:
Thomas Wolf, Martin Haft

Constructor Summary
WindowClosingCommandAdapter(java.lang.String name, java.awt.Window window, Command command)
          Creates a new WindowClosingCommandAdapter.
WindowClosingCommandAdapter(java.awt.Window window, Command command)
          Creates a new WindowClosingCommandAdapter.
 
Method Summary
 void dispose()
          Disposes the component.
 java.awt.Window getWindow()
          Returns the Window adapted to the command.
 void setWindow(java.awt.Window window)
          Sets the Window to adapt to the command.
 
Methods inherited from class com.sdm.quasar.client.core.commands.AbstractCommandAdapter
executeCommand, getCommand, getName, setCommand, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowClosingCommandAdapter

public WindowClosingCommandAdapter(java.awt.Window window,
                                   Command command)
Creates a new WindowClosingCommandAdapter.


WindowClosingCommandAdapter

public WindowClosingCommandAdapter(java.lang.String name,
                                   java.awt.Window window,
                                   Command command)
Creates a new WindowClosingCommandAdapter.

Parameters:
name -
Method Detail

getWindow

public java.awt.Window getWindow()
Returns the Window adapted to the command.


setWindow

public void setWindow(java.awt.Window window)
Sets the Window to adapt to the command.

Parameters:
window - the Window to adapt

dispose

public void dispose()
             throws DisposeException
Description copied from interface: Disposable
Disposes the component.

Important:
This method is called by an administrating component and must never be called directly.

The implementation should release any resources or objects allocated and any services registered. Furthermore, this method should be developed carefully to free a maximum of resources even when the system may have become unstable. In case of one or multiple errors, you should collect them in a DisposeException, continue with the execution, and throw it at the end of the method.

Note: The implementation must not return before the component is disposed. Any threads or asynchronous calls started must be completed before this method returns.

Throws:
DisposeException - if there was one or more errors while disposing the component.
See Also:
Disposable.dispose()