|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.progeeks.util.swing.WindowManager
public class WindowManager
Manages a list of swing windows that are associated with specific ViewContexts from an ObservableList. When new contexts are added, an appropriate WindowFactory is found that can create the Window/ContextView for the specified context. It is expected that the ObservableList implementation is responsible for ensuring that contexts are not removed prematurely if that is a requirement. When the window is closed, the WindowManager will attempt to remove the window's context from the list. If that succeeds then the window will be closed and removed. ContextList can be used for CloseableContexts to be sure that their canClose() method is called.
| Field Summary | |
|---|---|
static WindowFactory |
NULL_FACTORY
A factory that can be registered with types to define a no-op behavior. |
| Constructor Summary | |
|---|---|
WindowManager()
|
|
WindowManager(ObservableList contexts)
|
|
WindowManager(ObservableList contexts,
ClassRegistry factories)
|
|
| Method Summary | |
|---|---|
void |
createInitialViews()
Initializes any pre-existing windows that were in the context list before the window manager was created. |
boolean |
getCascade()
|
ObservableList |
getContextList()
Returns the observable list of contexts for which this manager is responsible. |
boolean |
getExitWhenLastViewRemoved()
|
ClassRegistry |
getViewFactories()
Returns the mapping of context classes to view factories. |
void |
registerWindowFactory(java.lang.Class contextType,
WindowFactory factory)
Registers the specified WindowFactory to handle the specified context class. |
void |
setCascade(boolean cascade)
|
void |
setContextList(ObservableList contexts)
Sets the observable list of contexts for which this manager is responsible. |
void |
setExitWhenLastViewRemoved(boolean exitWhenLastViewRemoved)
|
void |
setViewFactories(ClassRegistry factories)
Sets a mapping of context classes to view factories. |
protected void |
viewAdded(ViewContext context)
|
protected void |
viewRemoved(ViewContext context)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final WindowFactory NULL_FACTORY
| Constructor Detail |
|---|
public WindowManager()
public WindowManager(ObservableList contexts)
public WindowManager(ObservableList contexts,
ClassRegistry factories)
| Method Detail |
|---|
public void setContextList(ObservableList contexts)
setContextList in interface ViewManagerpublic ObservableList getContextList()
getContextList in interface ViewManagerpublic void setViewFactories(ClassRegistry factories)
setViewFactories in interface ViewManagerpublic ClassRegistry getViewFactories()
getViewFactories in interface ViewManagerpublic void setExitWhenLastViewRemoved(boolean exitWhenLastViewRemoved)
public boolean getExitWhenLastViewRemoved()
public void setCascade(boolean cascade)
public boolean getCascade()
public void createInitialViews()
createInitialViews in interface ViewManager
public void registerWindowFactory(java.lang.Class contextType,
WindowFactory factory)
protected void viewAdded(ViewContext context)
protected void viewRemoved(ViewContext context)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||