public abstract class ViewContainer
extends com.google.gwt.user.client.ui.Composite
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
logger |
protected FastMap<View> |
views |
| Constructor and Description |
|---|
ViewContainer(com.google.gwt.user.client.ui.Widget mainWidget)
Constructor
|
ViewContainer(com.google.gwt.user.client.ui.Widget mainWidget,
boolean clearPanelsForDeactivatedViews)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
activate(View view,
com.google.gwt.user.client.ui.Panel containerPanel,
Object parameter)
This method must be called by subclasses when any of your views is rendered.
|
boolean |
add(View view)
Loads a new view into the container
|
protected boolean |
add(View view,
boolean render,
Object parameter)
Loads a new view into the container
|
boolean |
addLazy(String viewName)
Adds a new view into the container, but does not load the view.
|
boolean |
addLazy(String viewName,
String viewId)
Adds a new view into the container, but does not load the view.
|
boolean |
addLazy(View view)
Adds a new view into the container, but does not load the view.
|
protected boolean |
addView(View view,
boolean lazy,
Object parameter) |
protected void |
adoptView(View view) |
protected void |
bindToDOM()
This method must be called by subclasses when the container is attached to DOM
|
void |
clear()
Remove all view inside this container
|
static void |
createView(String viewName,
String viewId,
ViewFactory.CreateCallback callback)
Creates the view referenced by the given name and associate a custom identifier with the view created
|
static void |
createView(String viewName,
ViewFactory.CreateCallback callback)
Creates the view referenced by the given name
|
protected boolean |
deactivate(View view,
com.google.gwt.user.client.ui.Panel containerPanel,
boolean skipEvent)
This method must be called by subclasses when any of your views currently rendered is removed from view.
|
protected boolean |
doAdd(View view,
boolean lazy,
Object parameter)
Loads a new view into the container
|
protected boolean |
doRemove(View view,
boolean skipEvent) |
protected abstract com.google.gwt.user.client.ui.Panel |
getContainerPanel(View view) |
protected <T extends com.google.gwt.user.client.ui.Widget> |
getMainWidget() |
View |
getView(String viewId)
Retrieve the view associated to viewId
|
static ViewFactory |
getViewFactory()
Retrieve the views factory associated with this screen.
|
protected abstract void |
handleViewTitle(String title,
com.google.gwt.user.client.ui.Panel containerPanel,
String viewId) |
protected abstract boolean |
hasHistoryHandlers() |
protected abstract boolean |
hasOrientationChangeHandlers() |
protected abstract boolean |
hasResizeHandlers() |
protected abstract boolean |
hasWindowCloseHandlers() |
protected abstract boolean |
hasWindowClosingHandlers() |
protected void |
loadAndRenderView(String viewName,
String viewId,
Object parameter) |
void |
loadView(String viewName,
boolean render)
Loads a view into the current container
|
void |
loadView(String viewName,
String viewId,
boolean render)
Loads a view into the current container
|
protected void |
loadView(String viewName,
String viewId,
boolean render,
Object parameter)
Loads a view into the current container
|
protected abstract void |
notifyViewsAboutHistoryChange(com.google.gwt.event.logical.shared.ValueChangeEvent<String> event) |
protected abstract void |
notifyViewsAboutOrientationChange() |
protected abstract void |
notifyViewsAboutWindowClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.Window> event) |
protected abstract void |
notifyViewsAboutWindowClosing(com.google.gwt.user.client.Window.ClosingEvent event) |
protected abstract void |
notifyViewsAboutWindowResize(com.google.gwt.event.logical.shared.ResizeEvent event) |
boolean |
remove(View view)
Remove the view from this container
|
boolean |
remove(View view,
boolean skipEvents)
Remove the view from this container
|
protected boolean |
renderView(View view,
Object parameter)
Render the view into the container
|
void |
showView(String viewName)
Render the requested view into the container.
|
protected void |
showView(String viewName,
Object parameter)
Render the requested view into the container.
|
void |
showView(String viewName,
String viewId)
Render the requested view into the container.
|
protected void |
showView(String viewName,
String viewId,
Object parameter)
Render the requested view into the container.
|
protected void |
unbindToDOM()
This method must be called by subclasses when the container is detached from DOM
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringpublic ViewContainer(com.google.gwt.user.client.ui.Widget mainWidget)
mainWidget - main widget on this containerpublic ViewContainer(com.google.gwt.user.client.ui.Widget mainWidget,
boolean clearPanelsForDeactivatedViews)
mainWidget - Main widget on this containerclearPanelsForDeactivatedViews - If true, makes the container clear the container panel for a view, when the view is deactivated.public boolean add(View view)
view - View to be addedpublic boolean addLazy(String viewName)
viewName - Name of the View to be addedpublic boolean addLazy(String viewName, String viewId)
viewName - Name of the View to be addedviewId - ID of the View to be addedpublic boolean addLazy(View view)
view - View to be addedpublic void clear()
public boolean remove(View view)
view - View to be removedpublic boolean remove(View view, boolean skipEvents)
view - View to be removedskipEvents - skip the events fired during view removalpublic void showView(String viewName)
viewName - View namepublic void showView(String viewName, String viewId)
viewId - View identifierviewId - View namepublic View getView(String viewId)
viewId - View identifierpublic static ViewFactory getViewFactory()
public static void createView(String viewName, ViewFactory.CreateCallback callback)
viewName - View namecallback - Called when the view creation is completed.public static void createView(String viewName, String viewId, ViewFactory.CreateCallback callback)
viewName - View nameviewId - View identifiercallback - Called when the view creation is completed.public void loadView(String viewName, boolean render)
viewName - View namerender - If true also render the viewpublic void loadView(String viewName, String viewId, boolean render)
viewName - View nameviewId - View identifierrender - If true also render the viewprotected void loadView(String viewName, String viewId, boolean render, Object parameter)
viewName - View nameviewId - View identifierparameter - A parameter passed that will be bound to the view load and activate eventsrender - If true also render the viewprotected boolean add(View view, boolean render, Object parameter)
view - View to be addedrender - If true, call the render methodparameter - A parameter passed that will be bound to the view load and activate eventsprotected void showView(String viewName, Object parameter)
viewName - View nameparameter - to be passed to activate eventprotected void showView(String viewName, String viewId, Object parameter)
viewId - View identifierviewId - View nameparameter - to be passed to activate eventprotected void loadAndRenderView(String viewName, String viewId, Object parameter)
protected <T extends com.google.gwt.user.client.ui.Widget> T getMainWidget()
protected void bindToDOM()
protected void unbindToDOM()
protected boolean activate(View view, com.google.gwt.user.client.ui.Panel containerPanel, Object parameter)
view - containerPanel - parameter - protected boolean deactivate(View view, com.google.gwt.user.client.ui.Panel containerPanel, boolean skipEvent)
view - containerPanel - skipEvent - protected boolean doAdd(View view, boolean lazy, Object parameter)
view - View to be addedprotected boolean doRemove(View view, boolean skipEvent)
view - skipEvent - protected boolean renderView(View view, Object parameter)
view - parameter - protected boolean addView(View view, boolean lazy, Object parameter)
view - lazy - protected void adoptView(View view)
view - protected abstract boolean hasResizeHandlers()
protected abstract boolean hasWindowCloseHandlers()
protected abstract boolean hasWindowClosingHandlers()
protected abstract boolean hasOrientationChangeHandlers()
protected abstract boolean hasHistoryHandlers()
protected abstract void notifyViewsAboutWindowResize(com.google.gwt.event.logical.shared.ResizeEvent event)
protected abstract void notifyViewsAboutWindowClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.Window> event)
protected abstract void notifyViewsAboutWindowClosing(com.google.gwt.user.client.Window.ClosingEvent event)
protected abstract void notifyViewsAboutOrientationChange()
protected abstract void notifyViewsAboutHistoryChange(com.google.gwt.event.logical.shared.ValueChangeEvent<String> event)
protected abstract com.google.gwt.user.client.ui.Panel getContainerPanel(View view)
Copyright © 2015. All rights reserved.