|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgriffon.swing.WindowManager
public final class WindowManager extends Object
Controls a set of windows that belong to the application.
Windows that are controlled by a WindowManager can be shown/hidden
using a custom strategy (WindowDisplayHandler)
| Nested Class Summary | |
|---|---|
private class |
WindowManager.ComponentHelper
ComponentAdapter that triggers application events when a window is shown/hidden. |
private class |
WindowManager.InternalFrameHelper
InternalFrameAdapter that triggers application events when a window is shown/hidden, it also invokes hide() when the window is about to be closed. |
private class |
WindowManager.WindowHelper
WindowAdapter that optionally invokes hide() when the window is about to be closed. |
| Field Summary | |
|---|---|
private static org.slf4j.Logger |
LOG
|
private SwingGriffonApplication |
app
|
private WindowManager.ComponentHelper |
componentHelper
|
private boolean |
hideBeforeHandler
|
private WindowManager.InternalFrameHelper |
internalFrameHelper
|
private List |
internalFrames
|
private WindowManager.WindowHelper |
windowHelper
|
private List |
windows
|
| Constructor Summary | |
WindowManager(SwingGriffonApplication app)
Creates a new WindowManager tied to an specific application. |
|
| Method Summary | |
|---|---|
void
|
attach(Window window)
Registers a window on this manager if an only if the window is not null and it's not registered already. |
void
|
attach(JInternalFrame internalFrame)
Registers an internal frame on this manager if an only if the internal frame is not null and it's not registered already. |
boolean
|
canShutdown(GriffonApplication app)
|
int
|
countVisibleWindows()
Counts how many Windows are visible regardless of their attached status to this WindowManager. |
void
|
detach(Window window)
Removes the window from the list of manages windows if and only if it is registered with this manager. |
void
|
detach(JInternalFrame internalFrame)
Removes the internal frame from the list of manages internal frames if and only if it is registered with this manager. |
JInternalFrame
|
findInternalFrame(String name)
Finds a JInternalFrame by name. |
Window
|
findWindow(String name)
Finds a Window by name. |
Window
|
getAt(int index)
Convenience method to get a managed Window by index. |
List
|
getInternalFrames()
Returns the list of internal frames managed by this manager. |
Window
|
getStartingWindow()
Finds the Window that should be displayed during the Ready phase of an application. |
List
|
getWindows()
Returns the list of windows managed by this manager. |
void
|
hide(Window window)
Hides the window. |
void
|
hide(JInternalFrame internalFrame)
Hides the internal frame. |
void
|
hide(String name)
Hides the window. |
boolean
|
isAutoShutdown()
Returns the value of the "application.autoShutdown" configuration flag. |
boolean
|
isHideBeforeHandler()
Should the window be hidden before all ShutdownHandlers be called ? |
void
|
onShutdown(GriffonApplication app)
Hides all visible windows |
void
|
setHideBeforeHandler(boolean hideBeforeHandler)
Set if the window should be hidden before all ShutdownHandler be called. |
void
|
show(Window window)
Shows the window. |
void
|
show(JInternalFrame internalFrame)
Shows the internal frame. |
void
|
show(String name)
Shows the window. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private static final org.slf4j.Logger LOG
private final SwingGriffonApplication app
private final WindowManager.ComponentHelper componentHelper
private boolean hideBeforeHandler
private final WindowManager.InternalFrameHelper internalFrameHelper
private final List internalFrames
private final WindowManager.WindowHelper windowHelper
private final List windows
| Constructor Detail |
|---|
public WindowManager(SwingGriffonApplication app)
app - an application
| Method Detail |
|---|
public void attach(Window window)
window - the window to be added to the list of managed windows
public void attach(JInternalFrame internalFrame)
internalFrame - the internal frame to be added to the list of managed internal frames
public boolean canShutdown(GriffonApplication app)
public int countVisibleWindows()
public void detach(Window window)
window - the window to be removed
public void detach(JInternalFrame internalFrame)
internalFrame - the internal frame to be removed
public JInternalFrame findInternalFrame(String name)
name - the value of the name: property
public Window findWindow(String name)
name - the value of the name: property
public Window getAt(int index)
Follows the Groovy conventions for overriding the [] operator.
index - the index of the Window to be retrieved
public List getInternalFrames()
public Window getStartingWindow()
The WindowManager expects a configuration flag swing.windowManager.startingWindow to be
present in order to determine which Window will be displayed during the Ready phase. If no configuration
is found the WindowManager will pick the first Window found in the list of managed windows.
The configuration flag accepts two value types:
public List getWindows()
public void hide(Window window)
This method is executed SYNCHRONOUSLY in the UI thread.
window - the window to hide
public void hide(JInternalFrame internalFrame)
This method is executed SYNCHRONOUSLY in the UI thread.
internalFrame - the internal frame to hide
public void hide(String name)
This method is executed SYNCHRONOUSLY in the UI thread.
name - the name of window to hide
public boolean isAutoShutdown()
public boolean isHideBeforeHandler()
public void onShutdown(GriffonApplication app)
public void setHideBeforeHandler(boolean hideBeforeHandler)
hideBeforeHandler - new value
public void show(Window window)
This method is executed SYNCHRONOUSLY in the UI thread.
window - the window to show
public void show(JInternalFrame internalFrame)
This method is executed SYNCHRONOUSLY in the UI thread.
internalFrame - the internal frame to show
public void show(String name)
This method is executed SYNCHRONOUSLY in the UI thread.
name - the name of window to show
Groovy Documentation