GWTApplication.client
Class ModifyFault

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 GWTApplication.client.FaultDBForm
                  extended by GWTApplication.client.ModifyFault
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.ClickListener, FaultUpdatedListener

 class ModifyFault
extends FaultDBForm
implements com.google.gwt.user.client.ui.ClickListener, FaultUpdatedListener

This class will be used to generate a form from which the user may be able to modify and update existing faults within the fault management system. In order to perform such duties, the user must have authenticated himself against the system and have sufficient privileges to perform such actions.

In addition to being able to modify the details of a fault, the user will be able to associate with a fault, a comment, a workaround or a solution.

Version:
$Id: ModifyFault.java,v 1.12 2008/01/15 11:08:15 cb Exp $
Author:
Craige Bevil

Field Summary
(package private)  com.google.gwt.user.client.ui.Button CancelFormButton
          This button will be used to cancel the form
(package private)  com.google.gwt.user.client.ui.TabPanel FaultAdditionPanel
          This tab panel is located at the foot of the form and will allow the user to add a comment, a solution or a workarounds to the fault
(package private)  Fault FaultBeingEdited
          This is the details of the fault which is being edited as they came from the database
(package private)  FaultComment FaultCommentPanel
          This is an instance of the object which will allow the user to enter the details of the comments which will be associated with the fault
(package private)  com.google.gwt.user.client.ui.TabPanel FaultContainerPanel
          This is the tab panel which contains the update fault form
(package private)  int FaultNumber
          This is the fault number which is associated with the fault which is being edited
(package private)  FaultSolution FaultSolutionPanel
          This is an instance of the object which will allow the user to associate with the fault, the details of the solution which has been performed
(package private)  FaultWorkAround FaultWorkAroundPanel
          This is an instance of the object which will allow the user to associate with a fault, the details of a workaround which has been performed
(package private)  java.util.HashMap InputFieldWidgets
          This is a hash map which contains the details of all of the widgets which are contained within the form
private  com.google.gwt.user.client.ui.TabPanel MainTabPanel
          This is the main tab panel
(package private)  com.google.gwt.user.client.ui.FlexTable ModifyFaultTable
          This table is used to hold all of the widgets within the form.
(package private)  int noOfSubTasksCompleted
          A count of the number of asynchronous subtasks which are performed when the form is created.
(package private)  com.google.gwt.user.client.ui.Button ResetFaultModificationsButton
          Button which will be used to reject any changes which have been made to the form and reset them to the default values in the database.
(package private)  com.google.gwt.user.client.ui.Button SubmitFaultModificationsButton
          Button which is used for submitting the changes which have been made to a fault to the servlet container
 
Fields inherited from class GWTApplication.client.FaultDBForm
busyIndicator, internationalizationConstants, NOLENGTHCHECK, PrinterList, svc, UserAuthentication
 
Constructor Summary
ModifyFault(int FaultNumber, FaultServiceAsync svc, InternationalizationConstants internationalizationConstants, com.google.gwt.user.client.ui.TabPanel FaultContainerPanel, AuthenticationDetails UserAuthentication, com.google.gwt.user.client.ui.TabPanel MainTabPanel)
          This is used to create the form which will be used to enter the modify the details of the fault.
 
Method Summary
 void faultUpdatedEvent(int faultNumber)
          The obligation of the fault update listener interface which is called when one of the components in this interface updates a fault.
 int getFaultNumber()
          Return the fault number which is associated with this panel to the caller
 void onClick(com.google.gwt.user.client.ui.Widget sender)
          This is implements the obligation of the ClickListener interface and will be called when the user presses various buttons on the interface.
private  void removeUpdateTab()
          This method will be used to remove the current update tab and return the user to the quick view panel if there is not another fault open for edit
(package private)  void resetFormToDefaultValues()
          Discard the exisiting changes that the user has made to the form and rest the contents to the values from the database.
 
Methods inherited from class GWTApplication.client.FaultDBForm
createEmailLink, fillListBoxWithCurrentInstruments, fillListBoxWithDutyTechnicians, fillListBoxWithFaultType, fillListBoxWithInstruments, fillListBoxWithSeverity, fillListBoxWithSites, fillListBoxWithStaffMembers, fillListBoxWithStates, fillListBoxWithSupportAstronomers, fillListBoxWithSystems, fillListBoxWithTelescopeOperators, getCurrentDate, getCurrentTime, getFullUserNameFromEmailAddress, selectDefaultListOption, setSelectedItemInListbox, stringContainsText, verifyDateFormat, verifyDateNotInFuture, verifyText, verifyTimeFormat
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement, getWidget, initWidget, isAttached, onAttach, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, onBrowserEvent, onLoad, onUnload, removeFromParent, setElement
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MainTabPanel

private final com.google.gwt.user.client.ui.TabPanel MainTabPanel
This is the main tab panel


SubmitFaultModificationsButton

com.google.gwt.user.client.ui.Button SubmitFaultModificationsButton
Button which is used for submitting the changes which have been made to a fault to the servlet container


ResetFaultModificationsButton

com.google.gwt.user.client.ui.Button ResetFaultModificationsButton
Button which will be used to reject any changes which have been made to the form and reset them to the default values in the database.


CancelFormButton

com.google.gwt.user.client.ui.Button CancelFormButton
This button will be used to cancel the form


FaultContainerPanel

com.google.gwt.user.client.ui.TabPanel FaultContainerPanel
This is the tab panel which contains the update fault form


FaultNumber

int FaultNumber
This is the fault number which is associated with the fault which is being edited


FaultBeingEdited

Fault FaultBeingEdited
This is the details of the fault which is being edited as they came from the database


InputFieldWidgets

java.util.HashMap InputFieldWidgets
This is a hash map which contains the details of all of the widgets which are contained within the form


ModifyFaultTable

com.google.gwt.user.client.ui.FlexTable ModifyFaultTable
This table is used to hold all of the widgets within the form.


FaultAdditionPanel

com.google.gwt.user.client.ui.TabPanel FaultAdditionPanel
This tab panel is located at the foot of the form and will allow the user to add a comment, a solution or a workarounds to the fault


FaultCommentPanel

final FaultComment FaultCommentPanel
This is an instance of the object which will allow the user to enter the details of the comments which will be associated with the fault


FaultSolutionPanel

final FaultSolution FaultSolutionPanel
This is an instance of the object which will allow the user to associate with the fault, the details of the solution which has been performed


FaultWorkAroundPanel

final FaultWorkAround FaultWorkAroundPanel
This is an instance of the object which will allow the user to associate with a fault, the details of a workaround which has been performed


noOfSubTasksCompleted

int noOfSubTasksCompleted
A count of the number of asynchronous subtasks which are performed when the form is created. There are two subtasks which are involved, one of creating the form and the second is the retrieval of the fault data from the servlet.

Constructor Detail

ModifyFault

ModifyFault(int FaultNumber,
            FaultServiceAsync svc,
            InternationalizationConstants internationalizationConstants,
            com.google.gwt.user.client.ui.TabPanel FaultContainerPanel,
            AuthenticationDetails UserAuthentication,
            com.google.gwt.user.client.ui.TabPanel MainTabPanel)
This is used to create the form which will be used to enter the modify the details of the fault. It will get back from the servlet the details of the fault and then populate the form accordingly.

Parameters:
FaultNumber - This is the number of the defect fault which is to be edited.
svc - This is a service reference which will be used to access the servlet in the tomcat container
internationalizationConstants - Used for internationalization of the interface
FaultContainerPanel - This is the tab panel in which the form is to be packed.
MainTabPanel - This is the main tab panel, on occasion we need to be able to select tabs in this panel.
Method Detail

onClick

public void onClick(com.google.gwt.user.client.ui.Widget sender)
This is implements the obligation of the ClickListener interface and will be called when the user presses various buttons on the interface. It is a callback for the following buttons.

  1. The Submit button
  2. The Cancel form button
  3. The Reset form button

Specified by:
onClick in interface com.google.gwt.user.client.ui.ClickListener
Parameters:
sender - The widget which was responsible for firing the click event.

resetFormToDefaultValues

void resetFormToDefaultValues()
Discard the exisiting changes that the user has made to the form and rest the contents to the values from the database.


removeUpdateTab

private void removeUpdateTab()
This method will be used to remove the current update tab and return the user to the quick view panel if there is not another fault open for edit


getFaultNumber

public int getFaultNumber()
Return the fault number which is associated with this panel to the caller


faultUpdatedEvent

public void faultUpdatedEvent(int faultNumber)
The obligation of the fault update listener interface which is called when one of the components in this interface updates a fault. We need to know if the user updates the fault from this interface in any way as the if a solution/workaround/comment is added to the fault in the database, the lastModified field will be updated and so when we get around to saving the details of the fault, the database will complain the fault is out of date.

Specified by:
faultUpdatedEvent in interface FaultUpdatedListener
Parameters:
faultNumber - This is the fault which has been updated