public class AutoReleaseListener extends Object implements WindowListener
A specialized WindowListener implementation for implementing the
auto release mechanism supported by builders.
The results produced by a Builder usually need to be released when
they are no longer needed to free the resources used by them. This can be
done manually by invoking the Builder.release(BuilderData) method
with the BuilderData object used for specifying the parameters of the
builder operation.
When a window is generated by a builder script, there is an alternative: it
is possible to let the framework perform the release() invocation
automatically when the window is closed. This is often useful, for instance
when a dialog window is created from a builder script: when the user closes
the dialog all resources associated with it (including beans defined in the
script) are no more needed and can be released. To enable this mechanism the
autoRelease property of BuilderData has to be set to
true.
This class implements the functionality for automatically releasing a
BuilderData object when a window (i.e. the main window produced by
the builder script) is closed. It does not rely on a concrete Builder
implementation and thus can be used with arbitrary implementations. Concrete
implementations of the Builder interface only need to create an
instance and register it at the main window of the builder results.
Client code typically will not have to use this class directly. The framework
will create and initialize and instance behind the scenes when a
BuilderData object configured appropriately is passed to a
Builder.
| Constructor and Description |
|---|
AutoReleaseListener(BuilderData data)
Creates a new instance of
AutoReleaseListener and sets the
BuilderData object to be released automatically. |
| Modifier and Type | Method and Description |
|---|---|
void |
windowActivated(WindowEvent event)
Window activated event.
|
void |
windowClosed(WindowEvent event)
The window was closed.
|
void |
windowClosing(WindowEvent event)
Window closing event.
|
void |
windowDeactivated(WindowEvent event)
Window deactivated event.
|
void |
windowDeiconified(WindowEvent event)
Window deiconified event.
|
void |
windowIconified(WindowEvent event)
Window iconified event.
|
void |
windowOpened(WindowEvent event)
Window opened event.
|
public AutoReleaseListener(BuilderData data)
AutoReleaseListener and sets the
BuilderData object to be released automatically. This object must
be fully initialized.data - the BuilderData object (must not be null)IllegalArgumentException - if the data object is null or
properties required are not setpublic void windowActivated(WindowEvent event)
windowActivated in interface WindowListenerevent - the eventpublic void windowClosed(WindowEvent event)
BuilderData object to
be released.windowClosed in interface WindowListenerevent - the eventpublic void windowDeactivated(WindowEvent event)
windowDeactivated in interface WindowListenerevent - the eventpublic void windowDeiconified(WindowEvent event)
windowDeiconified in interface WindowListenerevent - the eventpublic void windowIconified(WindowEvent event)
windowIconified in interface WindowListenerevent - the eventpublic void windowOpened(WindowEvent event)
windowOpened in interface WindowListenerevent - the eventpublic void windowClosing(WindowEvent event)
windowClosing in interface WindowListenerevent - the eventCopyright © 2016 The JGUIraffe Team. All rights reserved.