GWTApplication.client
Class Main

java.lang.Object
  extended by GWTApplication.client.Main
All Implemented Interfaces:
com.google.gwt.core.client.EntryPoint, com.google.gwt.user.client.ui.TabListener, com.google.gwt.user.client.WindowCloseListener, com.google.gwt.user.client.WindowResizeListener, FDBLoginListener, java.util.EventListener

public class Main
extends java.lang.Object
implements com.google.gwt.core.client.EntryPoint, FDBLoginListener, com.google.gwt.user.client.ui.TabListener, com.google.gwt.user.client.WindowCloseListener, com.google.gwt.user.client.WindowResizeListener

This is the main entry point for the fault database application client. The code generates the user interface which will be translated to AJAX/java script which will be subsequently deployed into the web browsers.

Version:
$Id: Main.java,v 1.10 2008/01/14 17:00:47 cb Exp $
Author:
cb

Nested Class Summary
(package private)  class Main.QuickHelpListener
          This class is a listener class which is called when the user clicks upon the help link in the main panel and is used to display quick help associated with the application
 
Field Summary
private  BusyIndicator busyIndicator
          Indicator which will be used to show that we are busy
private  NewFaultForm createNewFaultPanel
          This is an instance of the new fault form object which will allow the user to enter a new fault into the system
private  FaultUpdateMonitor faultUpdateMonitor
          Used to check the database intermittingly and report back to listeners which faults they are displaying have changed so that they may update their view accordingly.
protected  InternationalizationConstants internationalizationConstants
          This class will be used for internationalization so that we can flick between the locales of English and Spanish.
private  LoginPanel loginPanel
          This is the login panel which the user will be greeted with he first logs onto the system
private  com.google.gwt.user.client.ui.TabPanel MainTabBar
          This is the main tab bar which will contain for each form in the Fault management system a tab which can be used to access that form
private  ManageSystem manageSystemPanel
          This is an instance of the managed system object which will allow the Privileged user to be able to administer the system.
private  ModifyFormPanel modifyFormPanel
          This is an instance of the Modify fault object which will allow the user to Update and append to an existing fault in the system.
private  QuickViewReport quickViewPanel
          This is an instance of the quick view report object which will form one tab
private  SearchForm searchPanel
          This is an instance of the search form object which will allow the user to perform a search across the data contained within the fault management system
protected  FaultServiceAsync svc
          This is the service which will be used to access the servlet which is running in the tomcat container
private  AuthenticationDetails UserAuthentication
          Contains the details of the authentication which was performed by the user.
 
Constructor Summary
Main()
           
 
Method Summary
 boolean onBeforeTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender, int tabIndex)
          Called before a tab is selected.
 void onModuleLoad()
          This is the entry point of the client side of the system.
 void onTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender, int tabIndex)
          Called when the tab has been selected but we do nothing
 void onWindowClosed()
          Called when the user closes down the window.
 java.lang.String onWindowClosing()
          Called when the user is about to close down the window, we need to make sure that he really does want to leave the page.
 void onWindowResized(int width, int height)
          Called when the main window is resized
 void userLoggedIn(AuthenticationDetails UserAuthentication)
          This implements the expected interface of the login listener which will be called when the user logs onto the system for the first time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

faultUpdateMonitor

private FaultUpdateMonitor faultUpdateMonitor
Used to check the database intermittingly and report back to listeners which faults they are displaying have changed so that they may update their view accordingly.


busyIndicator

private BusyIndicator busyIndicator
Indicator which will be used to show that we are busy


internationalizationConstants

protected InternationalizationConstants internationalizationConstants
This class will be used for internationalization so that we can flick between the locales of English and Spanish.


svc

protected FaultServiceAsync svc
This is the service which will be used to access the servlet which is running in the tomcat container


MainTabBar

private com.google.gwt.user.client.ui.TabPanel MainTabBar
This is the main tab bar which will contain for each form in the Fault management system a tab which can be used to access that form


quickViewPanel

private QuickViewReport quickViewPanel
This is an instance of the quick view report object which will form one tab


manageSystemPanel

private ManageSystem manageSystemPanel
This is an instance of the managed system object which will allow the Privileged user to be able to administer the system.


createNewFaultPanel

private NewFaultForm createNewFaultPanel
This is an instance of the new fault form object which will allow the user to enter a new fault into the system


searchPanel

private SearchForm searchPanel
This is an instance of the search form object which will allow the user to perform a search across the data contained within the fault management system


modifyFormPanel

private ModifyFormPanel modifyFormPanel
This is an instance of the Modify fault object which will allow the user to Update and append to an existing fault in the system.


loginPanel

private LoginPanel loginPanel
This is the login panel which the user will be greeted with he first logs onto the system


UserAuthentication

private AuthenticationDetails UserAuthentication
Contains the details of the authentication which was performed by the user.

Constructor Detail

Main

public Main()
Method Detail

onBeforeTabSelected

public boolean onBeforeTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender,
                                   int tabIndex)
Called before a tab is selected. We prevent the user selecting the update tab when there are no faults being edited.

Specified by:
onBeforeTabSelected in interface com.google.gwt.user.client.ui.TabListener
Parameters:
sender - The tab panel which sent the event
tabIndex - This is the index of the panel which was selected.
Returns:
boolean false if the user is to be blocked from selecting the tab selected.

onWindowClosing

public java.lang.String onWindowClosing()
Called when the user is about to close down the window, we need to make sure that he really does want to leave the page. This is to save the user unwillingly losing unsaved changes.

Specified by:
onWindowClosing in interface com.google.gwt.user.client.WindowCloseListener

onWindowClosed

public void onWindowClosed()
Called when the user closes down the window. We don't do anything here. This method does nothing and is simply to satisfy the interface requirements.

Specified by:
onWindowClosed in interface com.google.gwt.user.client.WindowCloseListener

onTabSelected

public void onTabSelected(com.google.gwt.user.client.ui.SourcesTabEvents sender,
                          int tabIndex)
Called when the tab has been selected but we do nothing

Specified by:
onTabSelected in interface com.google.gwt.user.client.ui.TabListener
Parameters:
sender - The tab panel which sent the event
tabIndex - This is the index of the panel which was selected.

userLoggedIn

public void userLoggedIn(AuthenticationDetails UserAuthentication)
This implements the expected interface of the login listener which will be called when the user logs onto the system for the first time. The main interface of the application will be built through this method.

Specified by:
userLoggedIn in interface FDBLoginListener
Parameters:
UserAuthentication - Contains the details of the user that has logged onto the system and his levels of priviledge

onWindowResized

public void onWindowResized(int width,
                            int height)
Called when the main window is resized

Specified by:
onWindowResized in interface com.google.gwt.user.client.WindowResizeListener

onModuleLoad

public void onModuleLoad()
This is the entry point of the client side of the system. This is the method which is called by the web browser when it is loaded for the first and boots the system.

Specified by:
onModuleLoad in interface com.google.gwt.core.client.EntryPoint