|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vostok.vaadin.addon.dialog.WindowManagement
public class WindowManagement
WindowManagement is an helper class.
It can manager visible state of a window (including ActionWindow), i.e. is this dialog box already opened ? ; to do so it requires an unique name for each dialog box. It can help preventing opening the same dialog box twice.
It can also be used to dynamically instance window from class (com.vaadin.ui.Component
). If the window already exist, it will use it instead of creating a new instance.
Note a com.vaadin.ui.Component
will be wrapped into an org.vostok.vaadin.addon.dialog.ActionWindow
when a com.vaadin.ui.Window
will be used directly instead. You can also use paramaters as an java.lang.Object
Note WindowManagement will override window's Id .
Since version 1.5, WindowManagement has a new method public static void closeAll(String pattern)
This is another helper method you can use to close several window at once; specially useful to "clean up" before view change, as this application is doing. Check the java tab.
See sample at http://vaadin.vostoksystem.eu
Nested Class Summary | |
---|---|
static interface |
WindowManagement.Callback
Passing argument with constructor is not always practical. |
Constructor Summary | |
---|---|
WindowManagement()
|
Method Summary | |
---|---|
static void |
close(java.lang.String name)
close window with name name and remove resource from current ui pool. |
static void |
closeAll(java.lang.String pattern)
Close all window with name matching pattern, or all if pattern is null. |
static com.vaadin.ui.Window |
locate(java.lang.String name)
try to locate a window from the current ui pool. |
static com.vaadin.ui.Window |
show(java.lang.String name)
Tries to show window with name name . |
static com.vaadin.ui.Window |
show(java.lang.String name,
java.lang.Class type,
java.lang.Object argument)
Tries to show window with name name . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WindowManagement()
Method Detail |
---|
public static com.vaadin.ui.Window show(java.lang.String name, java.lang.Class type, java.lang.Object argument)
name
. If does not exist, create a new with name name
of type type
with initial parameters argument
.type
must implement com.vaadin.ui.Componentname
if type
does not extend com.vaadin.ui.Window, it will be wrap into an ActionWindow.type
implement WindowManagement.Callback, onLoad(argument) will then be fired
name
- unique name for the window. Mandatorytype
- class implementation, must implement com.vaadin.ui.Component at least, or extend com.vaadin.ui.Windowargument
- argument for constructor or onLoad method, can be null.
Window
, new ActionWindow
or current instance if already existActionWindow
,
WindowManagement.Callback
public static com.vaadin.ui.Window show(java.lang.String name)
name
.
name
- name
for window
Window
or nullpublic static void close(java.lang.String name)
name
and remove resource from current ui pool.
name
- name
for windowpublic static void closeAll(java.lang.String pattern)
pattern
- regexp for window's name to close or null for allpublic static com.vaadin.ui.Window locate(java.lang.String name)
name
- name
for window
Window
or null if not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |