GWTApplication.client
Class PrintFaultDialog

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.PrintFaultDialog
All Implemented Interfaces:
com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.ClickListener

public class PrintFaultDialog
extends FaultDBForm
implements com.google.gwt.user.client.ui.ClickListener

This class will allow the user to print a fault. The dialog box will allow the user to select a valid printer from a list provided by the servlet (basically the printers which the tomcat host has been configured for) and then instructs it to print the fault specified in the constructor when the user presses the submit button.

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

Field Summary
private  com.google.gwt.user.client.ui.Button CancelButton
          This is the cancel button widget
private  int faultToPrint
          This is the fault to be printed
(package private)  java.lang.String LANDSCAPEMODE
          Used when storing in a cookie the orientation of the page to be printed.
(package private)  java.lang.String PORTRAITMODE
          Used when storing in a cookie the orientation of the page to be printed.
(package private)  com.google.gwt.user.client.ui.DialogBox PrintDialog
          This is the dialog box which will be displayed which will allow the user to select the printer
private  LabelListBox printerSelectionList
          Widget which is used by the user to select the printer
private  com.google.gwt.user.client.ui.CheckBox PrintModeCheckBox
          Checkbox in which the user can select if he wants to print in landscape or portrait mode.
(package private)  java.lang.String PRINTMODECOOKIE
          Name of the cookie in which we store the mode in which we want to print
private  com.google.gwt.user.client.ui.Button SubmitButton
          This is the submit button widget
 
Fields inherited from class GWTApplication.client.FaultDBForm
busyIndicator, internationalizationConstants, NOLENGTHCHECK, PrinterList, svc, UserAuthentication
 
Constructor Summary
PrintFaultDialog(FaultServiceAsync svc)
          Constructor
 
Method Summary
 void onClick(com.google.gwt.user.client.ui.Widget sender)
          This is the click handler which is called when the user calls presses one of the buttons on the print dialog.
 void showPrintDialog(int faultToPrint)
          Displays the new dialog which will allow the user to print this fault with the fault specified.
 
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

PRINTMODECOOKIE

final java.lang.String PRINTMODECOOKIE
Name of the cookie in which we store the mode in which we want to print

See Also:
Constant Field Values

LANDSCAPEMODE

final java.lang.String LANDSCAPEMODE
Used when storing in a cookie the orientation of the page to be printed.

See Also:
Constant Field Values

PORTRAITMODE

final java.lang.String PORTRAITMODE
Used when storing in a cookie the orientation of the page to be printed.

See Also:
Constant Field Values

printerSelectionList

private final LabelListBox printerSelectionList
Widget which is used by the user to select the printer


faultToPrint

private int faultToPrint
This is the fault to be printed


SubmitButton

private final com.google.gwt.user.client.ui.Button SubmitButton
This is the submit button widget


CancelButton

private final com.google.gwt.user.client.ui.Button CancelButton
This is the cancel button widget


PrintModeCheckBox

private final com.google.gwt.user.client.ui.CheckBox PrintModeCheckBox
Checkbox in which the user can select if he wants to print in landscape or portrait mode.


PrintDialog

com.google.gwt.user.client.ui.DialogBox PrintDialog
This is the dialog box which will be displayed which will allow the user to select the printer

Constructor Detail

PrintFaultDialog

PrintFaultDialog(FaultServiceAsync svc)
           throws java.lang.Exception
Constructor

Throws:
java.lang.Exception
Method Detail

onClick

public void onClick(com.google.gwt.user.client.ui.Widget sender)
This is the click handler which is called when the user calls presses one of the buttons on the print dialog. He can either press the print button or the cancel button.

Specified by:
onClick in interface com.google.gwt.user.client.ui.ClickListener
Parameters:
sender - This is the widget which created the event.

showPrintDialog

public void showPrintDialog(int faultToPrint)
Displays the new dialog which will allow the user to print this fault with the fault specified.

Parameters:
faultToPrint - This is the id. of the fault which is to be printed when the user presses the submit button