org.gwtiger.client.screen
Class BaseEntryScreen

java.lang.Object
  extended by org.gwtiger.client.screen.BaseEntryScreen
All Implemented Interfaces:
com.google.gwt.core.client.EntryPoint, com.google.gwt.user.client.HistoryListener, java.util.EventListener
Direct Known Subclasses:
MyApp

public abstract class BaseEntryScreen
extends java.lang.Object
implements com.google.gwt.core.client.EntryPoint, com.google.gwt.user.client.HistoryListener

The main class of your GWT project should inherit from BaseEntryScreen instead of implementing EntryPoint

This class provides lazy loading functionality and some utility functions

Author:
Aditya Kapur

Field Summary
static java.lang.String historyPrefix
           
 
Constructor Summary
BaseEntryScreen()
           
 
Method Summary
 void addHistorySupport()
          Call this method from onModuleLoad() to add support for history.
 void changeHistory(java.lang.String historyToken)
           
 BaseScreen getScreen(int index)
           
 void onHistoryChanged(java.lang.String historyToken)
           
 void reset_screens()
          This is to clear all the screens from memory
 void showLoading(boolean visible)
          This method allows you to show the "Loading..." message on the screen
 void showScreen(int index)
          This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized
 void showScreen(int index, java.lang.Object object)
          This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized
 void showScreen(int index, java.lang.String objectType, java.lang.Long objectId)
          This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized
 void showScreen(int index, java.lang.String objectType, java.lang.String objectId)
          This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.core.client.EntryPoint
onModuleLoad
 

Field Detail

historyPrefix

public static java.lang.String historyPrefix
Constructor Detail

BaseEntryScreen

public BaseEntryScreen()
Method Detail

addHistorySupport

public void addHistorySupport()
Call this method from onModuleLoad() to add support for history. Nothing else needs to be done


changeHistory

public void changeHistory(java.lang.String historyToken)

onHistoryChanged

public void onHistoryChanged(java.lang.String historyToken)
Specified by:
onHistoryChanged in interface com.google.gwt.user.client.HistoryListener

showLoading

public void showLoading(boolean visible)
This method allows you to show the "Loading..." message on the screen

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

showScreen

public void showScreen(int index)
This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized

Parameters:
index - ID of the screen to be loaded
See Also:
load

showScreen

public void showScreen(int index,
                       java.lang.Object object)
This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized

Parameters:
index - ID of the screen to be loaded
See Also:
load

showScreen

public void showScreen(int index,
                       java.lang.String objectType,
                       java.lang.Long objectId)
This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized
 showScreen(CUSTOMER_SCREEN, "CUSTOMER", CustId);
 
Where CUSTOMER_SCREEN is a static int variable identifying the screen "CUSTOMER" is a parameter passed to the screen to help it identify what objectID that is being passed CustId is a variable that could potentially be the primary key of the customer table. The expected behavior is that the screen displayed and the customer is loaded

Parameters:
index - ID of the screen to be loaded.
objectType - This is a parameter that is passed to the screen that is being loaded.
objectId - This is a parameter passed to the screen.
See Also:
load

showScreen

public void showScreen(int index,
                       java.lang.String objectType,
                       java.lang.String objectId)
This method opens the screen identified by the index
If the screen has not been loaded earlier, it is initialized
 showScreen(CUSTOMER_SCREEN, "CUSTOMER", CustId);
 
Where CUSTOMER_SCREEN is a static int variable identifying the screen "CUSTOMER" is a parameter passed to the screen to help it identify what objectID that is being passed CustId is a variable that could potentially be the primary key of the customer table. In this method the ID is a string that is converted to a Long variable. The expected behavior is that the screen displayed and the customer is loaded

Parameters:
index - ID of the screen to be loaded.
objectType - This is a parameter that is passed to the screen that is being loaded.
objectId - This is a parameter passed to the screen.

getScreen

public BaseScreen getScreen(int index)

reset_screens

public void reset_screens()
This is to clear all the screens from memory