org.opensubsystems.inventory.application.swt
Class SWTIdentificationDialogGui

java.lang.Object
  extended by org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
      extended by org.opensubsystems.inventory.application.swt.SWTIdentificationDialogGui
All Implemented Interfaces:
org.opensubsystems.core.application.ThickClientDialogGui, IdentificationDialogGui

public class SWTIdentificationDialogGui
extends org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
implements IdentificationDialogGui

GUI for dialog used to add or modify identifications implemented using SWT. TODO: ThickApp: This dialog doesn't open character and number pad automatically to enter data. This should be implemented.

Version:
$Id: SWTIdentificationDialogGui.java,v 1.5 2007/01/07 06:14:07 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
Miro Halas
Code reviewed:
1.3 2006/03/30 07:43:58 bastafidli

Field Summary
protected static int COMMENTS_FIELD
          Offset of field in the field arrays
protected static int COST_FIELD
          Offset of field in the field arrays
protected static int EXTERNAL_NUMBER_FIELD
          Offset of field in the field arrays
protected static int INTERNAL_NUMBER_FIELD
          Offset of field in the field arrays
protected  org.eclipse.swt.widgets.Button m_actionButton
          Action button on the bottom of the dialog.
protected  org.eclipse.swt.widgets.Button[] m_buttons
          Set of buttons next to the controls to edit the data.
protected  org.eclipse.swt.widgets.Button m_cancelButton
          Cancel button.
protected  IdentificationDialog m_identificationDialog
          Dialog this gui is representing.
protected  org.eclipse.swt.widgets.Label[] m_labels
          Set of labels next to the controls.
protected  org.eclipse.swt.widgets.Text[] m_texts
          Set of text edit fields to edit data in.
protected static int RENTER_ID_FIELD
          Offset of field in the field arrays
protected static int RETIRED_FIELD
          Offset of field in the field arrays
 
Fields inherited from class org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
m_client, m_oldClientLocation, m_outsideBoundingArea, m_parent, m_shell
 
Constructor Summary
SWTIdentificationDialogGui()
           
 
Method Summary
protected  void createClientArea(boolean bModify, Identification identificationData, java.util.List lstAvoidExternalNumbers, java.util.List lstAvoidInternalNumbers, IdentificationDialogListener dialogListener)
          Create the client area of the dialog.
 void displayDialog(IdentificationDialog identificationDialog, boolean bModify, Identification identificationData, java.util.List lstAvoidExternalNumbers, java.util.List lstAvoidInternalNumbers, IdentificationDialogListener dialogListener)
          Display the dialog.
protected  void startCharacterPad(java.lang.String strTitle, java.lang.String strFirstLineText, int iFieldToEdit, java.util.List lstAvoidValues)
          Starts character pad dialog to edit textual value of a field.
protected  void startNumberPad(java.lang.String strTitle, java.lang.String strFirstLineText, int iFieldToEdit, boolean bDecimalDot)
          Starts number pad dialog to edit numeric value of a field.
 
Methods inherited from class org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
createDialogWindow, createDialogWindow, createDialogWindow, displayDialogWindow, displayMessage, getClient, getShell, interactWithUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensubsystems.core.application.ThickClientDialogGui
displayMessage
 

Field Detail

EXTERNAL_NUMBER_FIELD

protected static final int EXTERNAL_NUMBER_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

INTERNAL_NUMBER_FIELD

protected static final int INTERNAL_NUMBER_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

COMMENTS_FIELD

protected static final int COMMENTS_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

COST_FIELD

protected static final int COST_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

RENTER_ID_FIELD

protected static final int RENTER_ID_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

RETIRED_FIELD

protected static final int RETIRED_FIELD
Offset of field in the field arrays

See Also:
Constant Field Values

m_identificationDialog

protected IdentificationDialog m_identificationDialog
Dialog this gui is representing.


m_labels

protected org.eclipse.swt.widgets.Label[] m_labels
Set of labels next to the controls.


m_texts

protected org.eclipse.swt.widgets.Text[] m_texts
Set of text edit fields to edit data in.


m_buttons

protected org.eclipse.swt.widgets.Button[] m_buttons
Set of buttons next to the controls to edit the data.


m_actionButton

protected org.eclipse.swt.widgets.Button m_actionButton
Action button on the bottom of the dialog.


m_cancelButton

protected org.eclipse.swt.widgets.Button m_cancelButton
Cancel button.

Constructor Detail

SWTIdentificationDialogGui

public SWTIdentificationDialogGui()
Method Detail

displayDialog

public void displayDialog(IdentificationDialog identificationDialog,
                          boolean bModify,
                          Identification identificationData,
                          java.util.List lstAvoidExternalNumbers,
                          java.util.List lstAvoidInternalNumbers,
                          IdentificationDialogListener dialogListener)
Display the dialog. This method shouldn't return until the dialog is closed.

Specified by:
displayDialog in interface IdentificationDialogGui
Parameters:
identificationDialog - - dialog displaying this gui
bModify - - if this flag is true, then the dialog will act as modify dialog otherwise it will act as a create dialog. This will allow us to modify data, which were not yet created in the persistence store, but are held in memory and modified before they are stored
identificationData - - data to be created or edited, but never null. When creating new identification load the template data from the backend and then use the template data in this dialog.
lstAvoidExternalNumbers - - list of external numbers which cannot be used, since they may have already been used
lstAvoidInternalNumbers - - list of internal numbers which cannot be used, since they may have already been used
dialogListener - - listener which needs to be notified about changes and actions on the gui

createClientArea

protected void createClientArea(boolean bModify,
                                Identification identificationData,
                                java.util.List lstAvoidExternalNumbers,
                                java.util.List lstAvoidInternalNumbers,
                                IdentificationDialogListener dialogListener)
Create the client area of the dialog. This needs to be a separate method instead of being in constructor since when this class in instantiated dynamically we do not have option to pass parameters to constructor.

Parameters:
bModify - - if this flag is true, then the dialog will act as modify dialog otherwise it will act as a create dialog. This will allow us to modify items which were not yet created in the persistence store, but are held in memory and modified before they are stored
identificationData - - identification data to be created or edited, but never null. When creating new identification load the template data from the backend and then use the template data in this dialog.
lstAvoidExternalNumbers - - list of external numbers which cannot be used, since they may have already been used
lstAvoidInternalNumbers - - list of internal numbers which cannot be used, since they may have already been used
dialogListener - - listener which needs to be notified about changes and actions on the gui

startCharacterPad

protected void startCharacterPad(java.lang.String strTitle,
                                 java.lang.String strFirstLineText,
                                 int iFieldToEdit,
                                 java.util.List lstAvoidValues)
Starts character pad dialog to edit textual value of a field.

Parameters:
strTitle - - text to display in the title of the dialog
strFirstLineText - - text displayed above the entry area
iFieldToEdit - - what field should be edited
lstAvoidValues - - list of values which should be avoided

startNumberPad

protected void startNumberPad(java.lang.String strTitle,
                              java.lang.String strFirstLineText,
                              int iFieldToEdit,
                              boolean bDecimalDot)
Starts number pad dialog to edit numeric value of a field.

Parameters:
strTitle - - text to display on the dialog
strFirstLineText - - text displayed above the entry area
iFieldToEdit - - what field should be edited
bDecimalDot - - if true display decimal dot button in number pad


Copyright © 2003 - 2006 OpenSubsystems s.r.o.