public class WindowManager extends Object implements RegisterEvent.HasRegisterHandlers<Widget>, UnregisterEvent.HasUnregisterHandlers<Widget>
An object that represents a group of Widget
instances and provides
z-order management and window activation behavior. By default, WindowManager
only provides these features for the Window
class, as Widget
s
don't have a concept of activation or moving to the front.
Can be extended and replaced to support non-Window
classes - the main
extension points will be the activateLast()
and setActiveWin(Widget)
methods, which should be made general enough for the specific use case. Then,
the global WindowManager
can be replaced with the subclass in the project
module file:
<replace-with class="com.example.project.client.ReplacementWindowManager">
<when-type-is class="com.sencha.gxt.widget.core.client.WindowManager" />
</replace-with>
Modifier and Type | Field and Description |
---|---|
protected AccessStack<Widget> |
accessList |
protected SimpleEventBus |
eventBus |
protected Widget |
front |
protected static WindowManager |
instance |
protected List<Widget> |
widgets |
Constructor and Description |
---|
WindowManager()
Creates a window manager.
|
Modifier and Type | Method and Description |
---|---|
protected void |
activateLast()
Activates the top window in the stack.
|
boolean |
activateNext(Widget widget)
Activates the next window in the access stack.
|
boolean |
activatePrevious(Widget widget)
Activates the previous widget in the access stack.
|
HandlerRegistration |
addRegisterHandler(RegisterEvent.RegisterHandler<Widget> handler)
Adds a
RegisterEvent handler. |
HandlerRegistration |
addUnregisterHandler(UnregisterEvent.UnregisterHandler<Widget> handler)
Adds a
UnregisterEvent handler. |
boolean |
bringToFront(Widget widget)
Brings the specified widget to the front of any other active widgets.
|
protected void |
focus(Widget widget) |
static WindowManager |
get()
Returns the singleton instance.
|
Widget |
getActive()
Gets the currently-active widget in the group.
|
Stack<Widget> |
getStack()
Returns the ordered widgets.
|
List<Widget> |
getWindows()
Returns the visible widgets.
|
void |
hideAll()
Hides all widgets that are registered to this WindowManager.
|
void |
register(Widget widget)
Registers the window with the WindowManager.
|
void |
sendToBack(Widget widget)
Sends the specified window to the back of other active widgets.
|
protected void |
setActiveWin(Widget window)
Indicates that this window should be made active.
|
void |
unregister(Widget widget)
Unregisters the window with the WindowManager.
|
protected static WindowManager instance
protected AccessStack<Widget> accessList
protected Widget front
protected List<Widget> widgets
protected SimpleEventBus eventBus
public static WindowManager get()
public boolean activateNext(Widget widget)
widget
- the reference windowpublic boolean activatePrevious(Widget widget)
widget
- the reference windowpublic HandlerRegistration addRegisterHandler(RegisterEvent.RegisterHandler<Widget> handler)
RegisterEvent.HasRegisterHandlers
RegisterEvent
handler.addRegisterHandler
in interface RegisterEvent.HasRegisterHandlers<Widget>
handler
- the handlerpublic HandlerRegistration addUnregisterHandler(UnregisterEvent.UnregisterHandler<Widget> handler)
UnregisterEvent.HasUnregisterHandlers
UnregisterEvent
handler.addUnregisterHandler
in interface UnregisterEvent.HasUnregisterHandlers<Widget>
handler
- the handlerpublic boolean bringToFront(Widget widget)
Window
instances will automatically call this method when focused,
all other types must call manually.widget
- the windowpublic Widget getActive()
public Stack<Widget> getStack()
public List<Widget> getWindows()
public void hideAll()
public void register(Widget widget)
Window
instances will
automatically register and unregister themselves. All other types must
register / unregister manually.widget
- the windowpublic void sendToBack(Widget widget)
widget
- the widgetpublic void unregister(Widget widget)
widget
- the widgetprotected void activateLast()
protected void focus(Widget widget)
protected void setActiveWin(Widget window)
window
- Copyright © 2018. All rights reserved.