|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgriffon.swt.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.HideHelper
Listener that triggers application events when a window is hidden. |
private class |
WindowManager.ShowHelper
Listener that triggers application events when a window is shown. |
private class |
WindowManager.WindowHelper
WindowAdapter that invokes hide() when the window is about to be closed. |
| Field Summary | |
|---|---|
private static org.slf4j.Logger |
LOG
|
private SWTGriffonApplication |
app
|
private WindowManager.HideHelper |
hideHelper
|
private WindowManager.ShowHelper |
showHelper
|
private WindowManager.WindowHelper |
windowHelper
|
private Map |
windows
|
| Constructor Summary | |
WindowManager(SWTGriffonApplication app)
Creates a new WindowManager tied to an specific application. |
|
| Method Summary | |
|---|---|
void
|
attach(String name, org.eclipse.swt.widgets.Shell window)
Registers a window on this manager if an only if the window is not null and it's not registered already. |
boolean
|
canShutdown(GriffonApplication app)
|
void
|
detach(org.eclipse.swt.widgets.Shell window)
Removes the window from the list of manages windows if and only if it is registered with this manager. |
org.eclipse.swt.widgets.Shell
|
findWindow(String name)
Finds a Window by name. |
String
|
findWindowName(org.eclipse.swt.widgets.Shell window)
|
org.eclipse.swt.widgets.Shell
|
getStartingWindow()
Finds the Window that should be displayed during the Ready phase of an application. |
Collection
|
getWindows()
Returns the list of windows managed by this manager. |
void
|
handleClose(org.eclipse.swt.widgets.Widget widget)
|
void
|
hide(org.eclipse.swt.widgets.Shell window)
Hides the window. |
void
|
onShutdown(GriffonApplication app)
Hides all visible windows |
void
|
show(org.eclipse.swt.widgets.Shell window)
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 SWTGriffonApplication app
private final WindowManager.HideHelper hideHelper
private final WindowManager.ShowHelper showHelper
private final WindowManager.WindowHelper windowHelper
private final Map windows
| Constructor Detail |
|---|
public WindowManager(SWTGriffonApplication app)
app - an application
| Method Detail |
|---|
public void attach(String name, org.eclipse.swt.widgets.Shell window)
window - the window to be added to the list of managed windows
public boolean canShutdown(GriffonApplication app)
public void detach(org.eclipse.swt.widgets.Shell window)
window - the window to be removed
public org.eclipse.swt.widgets.Shell findWindow(String name)
name - the value of the name: property
public String findWindowName(org.eclipse.swt.widgets.Shell window)
public org.eclipse.swt.widgets.Shell getStartingWindow()
The WindowManager expects a configuration flag swt.windowManager.startingWindow to be present in order to
determine which Window will be displayed during the Ready phase. If no configuration is found the WindowManmager will pick the
first Window found in the list of managed windows.
The configuration flag accepts two value types:
public Collection getWindows()
public void handleClose(org.eclipse.swt.widgets.Widget widget)
public void hide(org.eclipse.swt.widgets.Shell window)
This method is executed SYNCHRONOUSLY in the UI thread.
window - the window to hide
public void onShutdown(GriffonApplication app)
public void show(org.eclipse.swt.widgets.Shell window)
This method is executed SYNCHRONOUSLY in the UI thread.
window - the window to show
Groovy Documentation