org.gwtiger.client.screen
Class BaseScreen

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.gwtiger.client.screen.BaseScreen
All Implemented Interfaces:
com.google.gwt.user.client.EventListener
Direct Known Subclasses:
BaseMyAppScreen

public abstract class BaseScreen
extends com.google.gwt.user.client.ui.Composite

All screens should inherit from BaseScreen This will help all the screens have consistant look and feel.

This also has utility methods to show the Loading message and error messages whenever required.

Author:
Aditya Kapur

Constructor Summary
BaseScreen()
          Constructor
 
Method Summary
 void clear()
           
 void close()
          Close/Hide the screen
 java.lang.String getCookie(java.lang.String cookieName)
          Helper function to get the value from the cookie
static GWTigerMessages getGWTigerMessages()
          This method is used to return Internationalized messages
static com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text, int screenId)
           
 com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text, int screenId, java.lang.String objectType, long objectId)
           
static com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text, java.lang.String screenName)
           
 com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text, java.lang.String screenName, java.lang.String objectType, java.lang.String objectId)
           
static GWTigerImageBundle getImages()
           
 void load()
          This method should be defined in all the inherited screens.
This is called each time the screen is loaded.
 void load(java.lang.Object object)
           
 void load(java.lang.String objectType, java.lang.Long objectId)
          This method should be defined in all the inherited screens.
This is called each time the screen is loaded.
 void setCookie(java.lang.String cookieName, java.lang.String value)
          Helper function to save Cookie.
static void setCookie(java.lang.String cookieName, java.lang.String value, int days)
          Helper function to save Cookie
 void setErrorStyle(java.lang.String style)
          This method sets the style for the error message
 void setErrorText(java.lang.String errorText)
          Sets the error string to the given string.
 void setLoadingText(java.lang.String loadingText)
          This method should be used to override the default loading message of
 void setTitleStyle(java.lang.String style)
          This method should be used to override the default style of the title text
 void setTitleText(java.lang.String title)
          Sets the title for the screen
 void showError(boolean visible)
          Method to show or hide the Error Message
static void showLoading(boolean visible)
          Method to show or hide the Loading message
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, onBrowserEvent, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseScreen

public BaseScreen()
Constructor

Method Detail

close

public void close()
Close/Hide the screen


getGWTigerMessages

public static GWTigerMessages getGWTigerMessages()
This method is used to return Internationalized messages

Returns:
handler

getImages

public static GWTigerImageBundle getImages()

setErrorStyle

public void setErrorStyle(java.lang.String style)
This method sets the style for the error message

Parameters:
style - style as used in the stylesheet

setErrorText

public void setErrorText(java.lang.String errorText)
Sets the error string to the given string. If the string is not empty then it is displayed

Parameters:
errorText - the error message to be displayed.

setTitleText

public void setTitleText(java.lang.String title)
Sets the title for the screen

Parameters:
title - The text that should be set as the title for the screen

setTitleStyle

public void setTitleStyle(java.lang.String style)
This method should be used to override the default style of the title text

Parameters:
style - name of the style

setLoadingText

public void setLoadingText(java.lang.String loadingText)
This method should be used to override the default loading message of
 Loading...
 

Parameters:
loadingText - the text that will be used for the Loading message

showError

public void showError(boolean visible)
Method to show or hide the Error Message

Parameters:
visible - if
 true
 
then the error message is displayed, hidden when
 false
 

showLoading

public static void showLoading(boolean visible)
Method to show or hide the Loading message

Parameters:
visible - if
 true
 
then the Loading message is displayed, hidden when
 false
 

load

public void load()
This method should be defined in all the inherited screens.
This is called each time the screen is loaded. This is to preload any data if required

See Also:
showScreen

clear

public void clear()

load

public void load(java.lang.String objectType,
                 java.lang.Long objectId)
This method should be defined in all the inherited screens.
This is called each time the screen is loaded. This is to preload any data if required

Parameters:
objectType - This parameter is passed to the screen. Is used to identify which Object to load
objectId - This is the parameter that identifies the ID of the object to be loaded
See Also:
showScreen

load

public void load(java.lang.Object object)

setCookie

public static void setCookie(java.lang.String cookieName,
                             java.lang.String value,
                             int days)
Helper function to save Cookie

Parameters:
cookieName - name of the cookie
value - - value to be saved in the cookie
days - - number of days this cookie should be kept alive

setCookie

public void setCookie(java.lang.String cookieName,
                      java.lang.String value)
Helper function to save Cookie. The cookie will be saved for 30 days by default

Parameters:
cookieName - name of the cookie
value - - value to be saved in the cookie

getCookie

public java.lang.String getCookie(java.lang.String cookieName)
Helper function to get the value from the cookie

Parameters:
cookieName - Name of the cookie
Returns:
value of the cookie

getHyperlink

public static com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text,
                                                                   java.lang.String screenName)

getHyperlink

public static com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text,
                                                                   int screenId)

getHyperlink

public com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text,
                                                            java.lang.String screenName,
                                                            java.lang.String objectType,
                                                            java.lang.String objectId)

getHyperlink

public com.google.gwt.user.client.ui.Hyperlink getHyperlink(java.lang.String text,
                                                            int screenId,
                                                            java.lang.String objectType,
                                                            long objectId)