|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.client.screen.views.View
public abstract class View
| Nested Class Summary | |
|---|---|
static interface |
View.RenderCallback
|
| Field Summary | |
|---|---|
protected boolean |
active
|
protected FastList<ViewActivateHandler> |
attachHandlers
|
protected FastList<ViewDeactivateHandler> |
detachHandlers
|
protected String |
height
|
protected FastList<com.google.gwt.event.logical.shared.ValueChangeHandler<String>> |
historyHandlers
|
protected Map<String> |
lazyWidgets
|
protected boolean |
loaded
|
protected FastList<ViewLoadHandler> |
loadHandlers
|
protected FastList<OrientationChangeHandler> |
orientationHandlers
|
protected FastList<com.google.gwt.event.logical.shared.ResizeHandler> |
resizeHandlers
|
protected FastList<ViewUnloadHandler> |
unloadHandlers
|
protected FastMap<com.google.gwt.user.client.ui.Widget> |
widgets
|
protected String |
width
|
protected FastList<com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window>> |
windowCloseHandlers
|
protected FastList<com.google.gwt.user.client.Window.ClosingHandler> |
windowClosingHandlers
|
| Constructor Summary | |
|---|---|
View(String id)
Constructor |
|
| Method Summary | ||
|---|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
|
|
protected static void |
addResource(String id,
com.google.gwt.resources.client.ClientBundle resource)
|
|
static void |
addToHistory(String token)
Adds a new token for history control. |
|
static void |
addToHistory(String token,
boolean issueEvent)
Adds a new token for history control. |
|
com.google.gwt.event.shared.HandlerRegistration |
addViewActivateHandler(ViewActivateHandler handler)
|
|
com.google.gwt.event.shared.HandlerRegistration |
addViewDeactivateHandler(ViewDeactivateHandler handler)
|
|
com.google.gwt.event.shared.HandlerRegistration |
addViewLoadHandler(ViewLoadHandler handler)
|
|
com.google.gwt.event.shared.HandlerRegistration |
addViewUnloadHandler(ViewUnloadHandler handler)
|
|
void |
addWidget(String id,
com.google.gwt.user.client.ui.IsWidget widget)
Add a new widget into this view |
|
void |
addWidget(String id,
com.google.gwt.user.client.ui.Widget widget)
Add a new widget into this view |
|
com.google.gwt.event.shared.HandlerRegistration |
addWindowCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window> handler)
|
|
com.google.gwt.event.shared.HandlerRegistration |
addWindowClosingHandler(com.google.gwt.user.client.Window.ClosingHandler handler)
|
|
com.google.gwt.event.shared.HandlerRegistration |
addWindowHistoryChangedHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
|
|
com.google.gwt.event.shared.HandlerRegistration |
addWindowOrientationChangeHandler(OrientationChangeHandler handler)
|
|
protected void |
checkRuntimeLazyDependency(String id,
String lazyPanelId)
When we have multi-level inner lazy panels, the most inside panel is dependent from the most outside one. |
|
protected void |
cleanLazyDependentWidgets(String widgetId)
|
|
protected void |
clearViewObjects()
When view is unloaded, we must free its allocated memory. |
|
static boolean |
containsResource(String id)
Returns true if a resource associated with the given identifiers was loaded by application |
|
boolean |
containsWidget(String id)
Verify if the view contains an widget associated with the given identifier |
|
abstract DataSource<?> |
createDataSource(String dataSource)
Create a new DataSource instance |
|
protected abstract void |
createWidgets()
Called by View container to create the view widgets |
|
protected void |
fireHistoryChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent<String> event)
|
|
protected void |
fireLoadEvent(Object paramenter)
Fires the load event |
|
protected void |
fireOrientationEvent()
|
|
protected void |
fireResizeEvent(com.google.gwt.event.logical.shared.ResizeEvent event)
|
|
protected boolean |
fireUnloadEvent()
Fires the unload event. |
|
protected void |
fireWindowCloseEvent(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.Window> event)
|
|
protected void |
fireWindowClosingEvent(com.google.gwt.user.client.Window.ClosingEvent event)
|
|
ViewContainer |
getContainer()
Retrieve the container that holds this view |
|
|
getController(String controller)
Retrieve the requested controller from this view |
|
String |
getHeight()
Retrieve the view height; |
|
String |
getId()
Retrieve the view identifier |
|
abstract IocContainer |
getIocContainer()
Retrieve the IoCContainer instance associated with this view |
|
protected String |
getPrefix()
Retrieve the view prefix. |
|
abstract RegisteredControllers |
getRegisteredControllers()
Retrieve the list of controllers registered into this view |
|
static com.google.gwt.resources.client.ClientBundle |
getResource(String id)
Retrieve the client bundle associated with the given id. |
|
String |
getTitle()
Retrieve the view title |
|
static
|
getView(String id)
Retrieve the view by its identifier |
|
com.google.gwt.user.client.ui.Widget |
getWidget(String id)
Retrieve a widget contained on this view. |
|
com.google.gwt.user.client.ui.Widget |
getWidget(String id,
boolean checkLazyDependencies)
Retrieve a widget contained on this screen. |
|
|
getWidget(String id,
Class<T> clazz)
Retrieve a widget contained on this screen, casting it to the given class |
|
String |
getWidth()
Retrieve the view width; |
|
protected boolean |
hasHistoryHandlers()
|
|
protected boolean |
hasOrientationChangeHandlers()
|
|
protected boolean |
hasResizeHandlers()
|
|
protected boolean |
hasWindowCloseHandlers()
|
|
protected boolean |
hasWindowClosingHandlers()
|
|
protected abstract Map<String> |
initializeLazyDependencies()
Called when the view are loaded to initialize the lazy dependencies map |
|
protected boolean |
initializeLazyDependentWidget(String widgetId)
Call the LazyPanel.ensureWidget() method of the given lazyPanel. |
|
boolean |
isActive()
Reads the active property. |
|
boolean |
isLoaded()
Return true if the view was loaded into a container. |
|
static boolean |
isOrientationChangeSupported()
|
|
FastList<com.google.gwt.user.client.ui.Widget> |
listWidgets()
|
|
FastList<String> |
listWidgetsId()
|
|
protected void |
load(Object paramenter)
Called by the ViewContainer when the view is added to the container. |
|
static
|
of(Object viewAware)
Retrieve the current view associated with a controller, datasource, or other ViewAware object |
|
protected void |
prepareViewObjects()
|
|
protected void |
registerLoadedView()
Register current view into the loaded views list |
|
boolean |
removeFromContainer()
Remove the current view from its container, if the view is loaded into a container |
|
void |
removeWidget(String id)
Removes the given widget from this view. |
|
void |
removeWidget(String id,
boolean removeFromDOM)
Removes the given widget from this view. |
|
protected abstract void |
render(com.google.gwt.user.client.ui.Panel rootPanel,
View.RenderCallback renderCallback)
Called by View container to render the view into the screen |
|
protected void |
setActive(Object parameter)
Mark this view as active |
|
protected void |
setContainer(ViewContainer viewContainer)
Bind the view to a container. |
|
protected boolean |
setDeactivated(boolean skipEvent)
Mark this view as active |
|
void |
setHeight(String height)
Set the views height; |
|
void |
setTitle(String title)
|
|
void |
setWidth(String width)
Set the view width; |
|
protected boolean |
unload()
Called by the ViewContainer when the view is removed from the container. |
|
protected void |
unregisterLoadedView()
Remove current view from the loaded views list |
|
protected abstract void |
updateViewHeight(String height)
|
|
protected abstract void |
updateViewWidth(String width)
|
|
FastList<String> |
widgetsIdList()
Retrieve a list with all widgets identifiers present into this view |
|
FastList<com.google.gwt.user.client.ui.Widget> |
widgetsList()
Retrieve a list with all widgets present into this view |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String> lazyWidgets
protected FastMap<com.google.gwt.user.client.ui.Widget> widgets
protected boolean active
protected FastList<com.google.gwt.event.logical.shared.ResizeHandler> resizeHandlers
protected FastList<com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window>> windowCloseHandlers
protected FastList<com.google.gwt.user.client.Window.ClosingHandler> windowClosingHandlers
protected FastList<ViewActivateHandler> attachHandlers
protected FastList<ViewDeactivateHandler> detachHandlers
protected FastList<com.google.gwt.event.logical.shared.ValueChangeHandler<String>> historyHandlers
protected FastList<OrientationChangeHandler> orientationHandlers
protected FastList<ViewLoadHandler> loadHandlers
protected FastList<ViewUnloadHandler> unloadHandlers
protected boolean loaded
protected String width
protected String height
| Constructor Detail |
|---|
public View(String id)
id - | Method Detail |
|---|
public String getId()
public String getTitle()
public void setTitle(String title)
title - public boolean isLoaded()
public String getWidth()
public void setWidth(String width)
public String getHeight()
public void setHeight(String height)
protected abstract void updateViewHeight(String height)
protected abstract void updateViewWidth(String width)
public abstract DataSource<?> createDataSource(String dataSource)
dataSource - dataSource name, declared with @DataSource annotation
public void addWidget(String id,
com.google.gwt.user.client.ui.Widget widget)
id - widget identifierwidget - the widget
public void addWidget(String id,
com.google.gwt.user.client.ui.IsWidget widget)
id - widget identifierwidget - the widgetpublic boolean containsWidget(String id)
id - widget identifier
public static void addToHistory(String token)
token -
public static void addToHistory(String token,
boolean issueEvent)
token - issueEvent - public com.google.gwt.user.client.ui.Widget getWidget(String id)
lazyWidgets map) and try again.
id - widget identifier
public <T> T getController(String controller)
T - Controller typecontroller - Controller name
public ViewContainer getContainer()
public com.google.gwt.user.client.ui.Widget getWidget(String id,
boolean checkLazyDependencies)
id - widget identifiercheckLazyDependencies - if false, lazy dependencies will not be loaded
public <T extends com.google.gwt.user.client.ui.IsWidget> T getWidget(String id,
Class<T> clazz)
T - id - widget identifierclazz - The class to be used to cast the widget
public void removeWidget(String id)
id - widget identifier
public void removeWidget(String id,
boolean removeFromDOM)
id - widget identifierremoveFromDOM - if true, also removes the widget from this parent widgetpublic FastList<String> listWidgetsId()
public FastList<com.google.gwt.user.client.ui.Widget> listWidgets()
public boolean isActive()
isActive in interface HasViewActivateHandlerspublic com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
addResizeHandler in interface HasViewResizeHandlershandler -
public static boolean isOrientationChangeSupported()
public com.google.gwt.event.shared.HandlerRegistration addWindowOrientationChangeHandler(OrientationChangeHandler handler)
addWindowOrientationChangeHandler in interface HasOrientationChangeHandlerpublic com.google.gwt.event.shared.HandlerRegistration addWindowCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window> handler)
addWindowCloseHandler in interface HasWindowCloseHandlershandler -
public com.google.gwt.event.shared.HandlerRegistration addWindowClosingHandler(com.google.gwt.user.client.Window.ClosingHandler handler)
handler -
public com.google.gwt.event.shared.HandlerRegistration addViewActivateHandler(ViewActivateHandler handler)
addViewActivateHandler in interface HasViewActivateHandlerspublic com.google.gwt.event.shared.HandlerRegistration addViewDeactivateHandler(ViewDeactivateHandler handler)
addViewDeactivateHandler in interface HasViewActivateHandlerspublic com.google.gwt.event.shared.HandlerRegistration addViewLoadHandler(ViewLoadHandler handler)
addViewLoadHandler in interface HasViewLoadHandlerspublic com.google.gwt.event.shared.HandlerRegistration addViewUnloadHandler(ViewUnloadHandler handler)
addViewUnloadHandler in interface HasViewLoadHandlerspublic com.google.gwt.event.shared.HandlerRegistration addWindowHistoryChangedHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
handler -
public FastList<String> widgetsIdList()
public FastList<com.google.gwt.user.client.ui.Widget> widgetsList()
public boolean removeFromContainer()
protected boolean hasResizeHandlers()
protected boolean hasOrientationChangeHandlers()
protected boolean hasWindowCloseHandlers()
protected boolean hasWindowClosingHandlers()
protected boolean hasHistoryHandlers()
protected void fireResizeEvent(com.google.gwt.event.logical.shared.ResizeEvent event)
event - protected void fireOrientationEvent()
protected void fireWindowCloseEvent(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.Window> event)
event - protected void fireWindowClosingEvent(com.google.gwt.user.client.Window.ClosingEvent event)
event - protected void fireHistoryChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent<String> event)
event - protected void fireLoadEvent(Object paramenter)
protected boolean fireUnloadEvent()
protected void setActive(Object parameter)
parameter - to be passed to activate eventprotected boolean setDeactivated(boolean skipEvent)
skipEvent - protected void load(Object paramenter)
ViewContainer when the view is added to the container.
This method creates the view widgets
parameter - parameter sent to view and accessible through ViewLoadEvent eventprotected boolean unload()
ViewContainer when the view is removed from the container.
protected void registerLoadedView()
protected void unregisterLoadedView()
protected void prepareViewObjects()
protected void clearViewObjects()
protected void cleanLazyDependentWidgets(String widgetId)
widgetId -
protected void checkRuntimeLazyDependency(String id,
String lazyPanelId)
id - lazyPanelId - protected boolean initializeLazyDependentWidget(String widgetId)
LazyPanel.ensureWidget() method of the given lazyPanel.
This method can trigger other dependent lazyPanel initialization, through
a recursive call to View.getWidget(String).
widgetId - lazyPanel to be loaded
public abstract RegisteredControllers getRegisteredControllers()
public abstract IocContainer getIocContainer()
protected abstract void render(com.google.gwt.user.client.ui.Panel rootPanel,
View.RenderCallback renderCallback)
rootPanel - The root element where the view elements will be rendered.
protected abstract void createWidgets()
throws InterfaceConfigException
InterfaceConfigExceptionprotected abstract Map<String> initializeLazyDependencies()
protected String getPrefix()
protected void setContainer(ViewContainer viewContainer)
ViewContainer add method.
viewContainer - public static <T extends View> T getView(String id)
id - view identifier
public static <T extends View> T of(Object viewAware)
viewAware -
public static com.google.gwt.resources.client.ClientBundle getResource(String id)
Resource annotation
id -
protected static void addResource(String id,
com.google.gwt.resources.client.ClientBundle resource)
id - resource - public static boolean containsResource(String id)
id -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||