org.cruxframework.crux.core.client.screen
Class Screen

java.lang.Object
  extended by org.cruxframework.crux.core.client.screen.Screen

public class Screen
extends Object

Abstraction for the entire page. It references the root view and declare methods to act on the entire application page.

Author:
Thiago da Rosa de Bustamante

Field Summary
protected  FastList<com.google.gwt.dom.client.Element> blockingDivs
           
protected  String id
           
protected  org.cruxframework.crux.core.client.screen.RootViewContainer rootViewContainer
           
protected  URLRewriter urlRewriter
           
 
Constructor Summary
protected Screen(String id)
           
 
Method Summary
static void add(String id, com.google.gwt.user.client.ui.IsWidget widget)
           
static void add(String id, com.google.gwt.user.client.ui.Widget widget)
           
static com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window> handler)
           
static com.google.gwt.event.shared.HandlerRegistration addClosingHandler(com.google.gwt.user.client.Window.ClosingHandler handler)
           
static com.google.gwt.event.shared.HandlerRegistration addHistoryChangedHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
           
static com.google.gwt.event.shared.HandlerRegistration addOrientationChangeHandler(OrientationChangeHandler handler)
           
static com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
           
static void addToHistory(String token)
           
static void addToHistory(String token, boolean issueEvent)
           
protected  void addTokenToHistory(String token)
           
protected  void addTokenToHistory(String token, boolean issueEvent)
           
protected  void addWidget(String id, com.google.gwt.user.client.ui.IsWidget widget)
           
protected  void addWidget(String id, com.google.gwt.user.client.ui.Widget widget)
           
protected  com.google.gwt.event.shared.HandlerRegistration addWindowCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window> handler)
           
protected  com.google.gwt.event.shared.HandlerRegistration addWindowClosingHandler(com.google.gwt.user.client.Window.ClosingHandler handler)
           
protected  com.google.gwt.event.shared.HandlerRegistration addWindowHistoryChangedHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
           
protected  com.google.gwt.event.shared.HandlerRegistration addWindowOrientationChangeHandler(OrientationChangeHandler handler)
           
protected  com.google.gwt.event.shared.HandlerRegistration addWindowResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
           
static void blockToUser()
           
static void blockToUser(String blockingDivStyleName)
           
static void configureViewport(String content)
          Configure a viewport using given content
static void configureViewport(String smallDisplayContent, String largeDisplayContent)
          Configure a viewport using given contents for small and large displays
static boolean contains(String id)
           
protected  boolean containsWidget(String id)
           
static DataSource<?> createDataSource(String dataSource)
           
protected  void createRootView(String id)
           
static void ensureDebugId(com.google.gwt.user.client.ui.Widget widget, String id)
          If the given widget does not have a non-empty ID attribute, sets the given id into it.
static Screen get()
          Gets the current screen
static com.google.gwt.user.client.ui.Widget get(String id)
          Gets a widget on the current screen
static
<T extends com.google.gwt.user.client.ui.IsWidget>
T
get(String id, Class<T> clazz)
           
static DeviceAdaptive.Device getCurrentDevice()
           
static String getCurrentHistoryItem()
           
protected  String getCurrentHistoryToken()
           
static String getId()
           
protected  String getIdentifier()
           
static String getLocale()
           
 RegisteredControllers getRegisteredControllers()
           
static View getRootView()
           
protected  View getView()
           
protected  com.google.gwt.user.client.ui.Widget getWidget(String id)
          Retrieve a widget contained on this screen.
protected
<T extends com.google.gwt.user.client.ui.IsWidget>
T
getWidget(String id, Class<T> clazz)
          Generic version of getWidget method
protected  void hideBlockDiv()
          Hides the DIV that is blocking the Screen contents
static boolean isAndroid()
           
static boolean isIos()
           
static FastList<String> listWidgetIds()
           
static FastList<com.google.gwt.user.client.ui.Widget> listWidgets()
           
static void reload()
           
static void remove(String id)
          Remove a widget on the current screen
static void remove(String id, boolean removeFromDOM)
          Remove a widget on the current screen
protected  void removeWidget(String id)
           
protected  void removeWidget(String id, boolean removeFromDOM)
           
static String rewriteUrl(String url)
           
protected  String rewriteURL(String url)
           
static void setRefreshEnabled(boolean enabled)
          Enable or disable the browser refresh support.
protected  void showBlockDiv(String blockingDivStyleName)
          Creates and shows a DIV over the screen contents
static void unblockToUser()
           
protected  FastList<String> widgetsIdList()
           
protected  FastList<com.google.gwt.user.client.ui.Widget> widgetsList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootViewContainer

protected org.cruxframework.crux.core.client.screen.RootViewContainer rootViewContainer

blockingDivs

protected FastList<com.google.gwt.dom.client.Element> blockingDivs

id

protected String id

urlRewriter

protected URLRewriter urlRewriter
Constructor Detail

Screen

protected Screen(String id)
Method Detail

createRootView

protected void createRootView(String id)
Parameters:
id -

addTokenToHistory

protected void addTokenToHistory(String token)
Parameters:
token -

addTokenToHistory

protected void addTokenToHistory(String token,
                                 boolean issueEvent)
Parameters:
token -
issueEvent -

addWidget

protected void addWidget(String id,
                         com.google.gwt.user.client.ui.Widget widget)
Parameters:
id -
widget -

getView

protected View getView()
Returns:

addWidget

protected void addWidget(String id,
                         com.google.gwt.user.client.ui.IsWidget widget)
Parameters:
id -
widget -

addWindowCloseHandler

protected com.google.gwt.event.shared.HandlerRegistration addWindowCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window> handler)
Parameters:
handler -
Returns:

addWindowClosingHandler

protected com.google.gwt.event.shared.HandlerRegistration addWindowClosingHandler(com.google.gwt.user.client.Window.ClosingHandler handler)
Parameters:
handler -
Returns:

addWindowHistoryChangedHandler

protected com.google.gwt.event.shared.HandlerRegistration addWindowHistoryChangedHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
Parameters:
handler -
Returns:

addWindowResizeHandler

protected com.google.gwt.event.shared.HandlerRegistration addWindowResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
Parameters:
handler -
Returns:

addWindowOrientationChangeHandler

protected com.google.gwt.event.shared.HandlerRegistration addWindowOrientationChangeHandler(OrientationChangeHandler handler)
Parameters:
handler -
Returns:

getCurrentHistoryToken

protected String getCurrentHistoryToken()
Returns:

getIdentifier

protected String getIdentifier()
Returns:

getWidget

protected com.google.gwt.user.client.ui.Widget getWidget(String id)
Retrieve a widget contained on this screen.

Parameters:
id -
Returns:

getWidget

protected <T extends com.google.gwt.user.client.ui.IsWidget> T getWidget(String id,
                                                                         Class<T> clazz)
Generic version of getWidget method

Type Parameters:
T -
Parameters:
id -
clazz -
Returns:

hideBlockDiv

protected void hideBlockDiv()
Hides the DIV that is blocking the Screen contents


removeWidget

protected void removeWidget(String id)

removeWidget

protected void removeWidget(String id,
                            boolean removeFromDOM)

containsWidget

protected boolean containsWidget(String id)

rewriteURL

protected String rewriteURL(String url)

showBlockDiv

protected void showBlockDiv(String blockingDivStyleName)
Creates and shows a DIV over the screen contents

Parameters:
blockingDivStyleName -

widgetsIdList

protected FastList<String> widgetsIdList()
Returns:

widgetsList

protected FastList<com.google.gwt.user.client.ui.Widget> widgetsList()
Returns:

getRootView

public static View getRootView()
Returns:

add

public static void add(String id,
                       com.google.gwt.user.client.ui.Widget widget)
Parameters:
id -
widget -

add

public static void add(String id,
                       com.google.gwt.user.client.ui.IsWidget widget)
Parameters:
id -
widget -

addCloseHandler

public static com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.Window> handler)
Parameters:
handler -
Returns:

addClosingHandler

public static com.google.gwt.event.shared.HandlerRegistration addClosingHandler(com.google.gwt.user.client.Window.ClosingHandler handler)
Parameters:
handler -
Returns:

addHistoryChangedHandler

public static com.google.gwt.event.shared.HandlerRegistration addHistoryChangedHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
Parameters:
handler -
Returns:

addResizeHandler

public static com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
Parameters:
handler -
Returns:

addOrientationChangeHandler

public static com.google.gwt.event.shared.HandlerRegistration addOrientationChangeHandler(OrientationChangeHandler handler)
Parameters:
handler -
Returns:

addToHistory

public static void addToHistory(String token)
Parameters:
token -

addToHistory

public static void addToHistory(String token,
                                boolean issueEvent)
Parameters:
token -
issueEvent -

rewriteUrl

public static String rewriteUrl(String url)
Parameters:
url -
Returns:

blockToUser

public static void blockToUser()

blockToUser

public static void blockToUser(String blockingDivStyleName)

contains

public static boolean contains(String id)
Parameters:
id -
Returns:

createDataSource

public static DataSource<?> createDataSource(String dataSource)
Parameters:
dataSource -
Returns:

getRegisteredControllers

public RegisteredControllers getRegisteredControllers()
Returns:

ensureDebugId

public static void ensureDebugId(com.google.gwt.user.client.ui.Widget widget,
                                 String id)
If the given widget does not have a non-empty ID attribute, sets the given id into it.

Parameters:
widget -
id -

get

public static Screen get()
Gets the current screen

Returns:

get

public static com.google.gwt.user.client.ui.Widget get(String id)
Gets a widget on the current screen

Parameters:
id -
Returns:

get

public static <T extends com.google.gwt.user.client.ui.IsWidget> T get(String id,
                                                                       Class<T> clazz)
Type Parameters:
T -
Parameters:
id -
clazz -
Returns:

getCurrentHistoryItem

public static String getCurrentHistoryItem()
Returns:

getCurrentDevice

public static DeviceAdaptive.Device getCurrentDevice()
Returns:

getId

public static String getId()
Returns:

getLocale

public static String getLocale()
Returns:
the locale specified or null

configureViewport

public static void configureViewport(String smallDisplayContent,
                                     String largeDisplayContent)
Configure a viewport using given contents for small and large displays

Parameters:
smallDisplayContent -
largeDisplayContent -

configureViewport

public static void configureViewport(String content)
Configure a viewport using given content

Parameters:
content -

listWidgetIds

public static FastList<String> listWidgetIds()
Returns:

listWidgets

public static FastList<com.google.gwt.user.client.ui.Widget> listWidgets()
Returns:

remove

public static void remove(String id)
Remove a widget on the current screen

Parameters:
id -

remove

public static void remove(String id,
                          boolean removeFromDOM)
Remove a widget on the current screen

Parameters:
id -
removeFromDOM -

unblockToUser

public static void unblockToUser()

isIos

public static boolean isIos()
Returns:

isAndroid

public static boolean isAndroid()
Returns:

reload

public static void reload()

setRefreshEnabled

public static void setRefreshEnabled(boolean enabled)
Enable or disable the browser refresh support.

Parameters:
enabled -


Copyright © 2014. All rights reserved.