public final class NoopWindowManager extends java.lang.Object implements WindowManager<java.lang.Object>
Constructor and Description |
---|
NoopWindowManager(GriffonApplication application) |
Modifier and Type | Method and Description |
---|---|
void |
attach(java.lang.String name,
java.lang.Object 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)
Asks this handler if the application's shutdown sequence can proceed or not.
|
int |
countVisibleWindows()
Counts how many Windows are visible regardless of their attached status to this WindowManager.
|
void |
detach(java.lang.String name)
Removes the window from the list of manages windows if and only if it
is registered with this manager.
|
java.lang.Object |
findWindow(java.lang.String name)
Finds a Window by name.
|
java.lang.String |
findWindowName(java.lang.Object window)
Lookups a name related to a Window.
|
java.lang.Object |
getAt(int index)
Convenience method to get a managed Window by index.
|
java.lang.Object |
getStartingWindow()
Finds the Window that should be displayed during the Ready phase of an application.
|
java.util.Set<java.lang.String> |
getWindowNames()
Returns a set of names related to all windows managed by this manager.
|
java.util.Collection<java.lang.Object> |
getWindows()
Returns the collection of windows managed by this manager.
|
void |
hide(java.lang.Object window)
Hides the window.
|
void |
hide(java.lang.String name)
Hides the window.
|
int |
indexOf(java.lang.Object window)
Lookups the index related to a Window.
|
boolean |
isAutoShutdown()
Returns the value of the "application.autoShutdown" configuration flag.
|
void |
onShutdown(GriffonApplication app)
Hides all visible windows
|
void |
show(java.lang.Object window)
Shows the window.
|
void |
show(java.lang.String name)
Shows the window.
|
@Inject public NoopWindowManager(@Nonnull GriffonApplication application)
@Nullable public java.lang.Object findWindow(@Nonnull java.lang.String name)
WindowManager
findWindow
in interface WindowManager<java.lang.Object>
name
- the value of the of the Window's name@Nullable public java.lang.Object getAt(int index)
WindowManager
Follows the Groovy conventions for overriding the [] operator.
getAt
in interface WindowManager<java.lang.Object>
index
- the index of the Window to be retrieved@Nullable public java.lang.Object getStartingWindow()
WindowManager
The WindowManager expects a configuration flag 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:
getStartingWindow
in interface WindowManager<java.lang.Object>
@Nonnull public java.util.Collection<java.lang.Object> getWindows()
WindowManager
getWindows
in interface WindowManager<java.lang.Object>
@Nonnull public java.util.Set<java.lang.String> getWindowNames()
WindowManager
getWindowNames
in interface WindowManager<java.lang.Object>
@Nullable public java.lang.String findWindowName(@Nonnull java.lang.Object window)
WindowManager
findWindowName
in interface WindowManager<java.lang.Object>
window
- the window to be looked uppublic int indexOf(@Nonnull java.lang.Object window)
WindowManager
indexOf
in interface WindowManager<java.lang.Object>
window
- the window to be looked uppublic void attach(@Nonnull java.lang.String name, @Nonnull java.lang.Object window)
WindowManager
attach
in interface WindowManager<java.lang.Object>
name
- the value of the of the Window's namewindow
- the window to be added to the list of managed windowspublic void detach(@Nonnull java.lang.String name)
WindowManager
detach
in interface WindowManager<java.lang.Object>
name
- the value of the of the Window's namepublic void show(@Nonnull java.lang.Object window)
WindowManager
This method is executed SYNCHRONOUSLY in the UI thread.
show
in interface WindowManager<java.lang.Object>
window
- the window to showpublic void show(@Nonnull java.lang.String name)
WindowManager
This method is executed SYNCHRONOUSLY in the UI thread.
show
in interface WindowManager<java.lang.Object>
name
- the name of window to showpublic void hide(@Nonnull java.lang.Object window)
WindowManager
This method is executed SYNCHRONOUSLY in the UI thread.
hide
in interface WindowManager<java.lang.Object>
window
- the window to hidepublic void hide(@Nonnull java.lang.String name)
WindowManager
This method is executed SYNCHRONOUSLY in the UI thread.
hide
in interface WindowManager<java.lang.Object>
name
- the name of window to hidepublic boolean canShutdown(@Nonnull GriffonApplication app)
ShutdownHandler
Return false if the shutdown sequence must be aborted.
canShutdown
in interface ShutdownHandler
canShutdown
in interface WindowManager<java.lang.Object>
app
- the current running applicationpublic void onShutdown(@Nonnull GriffonApplication app)
WindowManager
onShutdown
in interface ShutdownHandler
onShutdown
in interface WindowManager<java.lang.Object>
app
- the current running applicationpublic int countVisibleWindows()
WindowManager
countVisibleWindows
in interface WindowManager<java.lang.Object>
public boolean isAutoShutdown()
WindowManager
isAutoShutdown
in interface WindowManager<java.lang.Object>