org.opensubsystems.patterns.thickclient.application.swt
Class NumberPadDialog

java.lang.Object
  extended by org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
      extended by org.opensubsystems.patterns.thickclient.application.swt.NumberPadDialog
All Implemented Interfaces:
org.opensubsystems.core.application.ThickClientDialogGui

public class NumberPadDialog
extends org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl

Dialog used to enter number using mouse or finger.

Version:
$Id: NumberPadDialog.java,v 1.9 2007/01/07 06:14:15 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
Miro Halas
Code reviewed:
1.7 2006/04/05 05:33:09 bastafidli

Field Summary
protected  NumberPad m_npad
          Number pad of this dialog
protected  java.util.Set m_setListeners
          Set where all listeners listening to the event notifications specific to this object are stored.
protected  java.lang.String m_text
          Variable to store number pad text
 
Fields inherited from class org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
m_client, m_oldClientLocation, m_outsideBoundingArea, m_parent, m_shell
 
Constructor Summary
NumberPadDialog()
           
 
Method Summary
 void addNumberPadListener(NumberPadListener listener)
          Add listener for this number pad.
protected  org.eclipse.swt.graphics.Point createClientArea(java.lang.String strFirstLineText, java.lang.String strSpecialButtonText, java.lang.String strInitialText, boolean bBigButtons, boolean bDecimalDot)
          Create the client area of the dialog.
protected  void displayDialog(java.lang.String strFirstLineText, java.lang.String strSpecialButtonText, int strMaxTextLength, java.lang.String strInitialText, boolean bBigButtons, boolean bDecimalDot, NumberPadListener specialButtonListener)
          Show the dialog.
 void displayDialog(org.opensubsystems.core.application.ThickClientDialog parentDialog, java.lang.String strTitle, java.lang.String strFirstLineText, java.lang.String strSpecialButtonText, int strMaxTextLength, java.lang.String strInitialText, boolean bBigButtons, boolean bDecimalDot, NumberPadListener specialButtonListener)
          Show the dialog.
 void displayDialog(org.opensubsystems.core.application.ThickClient client, java.lang.String strTitle, java.lang.String strFirstLineText, java.lang.String strSpecialButtonText, int strMaxTextLength, java.lang.String strInitialText, boolean bBigButtons, boolean bDecimalDot, NumberPadListener specialButtonListener)
          Show the dialog.
 java.lang.String getText()
          Get the number pad text
 void removeNumberPadListener(NumberPadListener listener)
          Remove listener from this number pad.
 void setText(java.lang.String string)
           
 boolean setTextLimit(int iLimit)
          This function sets maximal nuber of characters typed
 
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
 

Field Detail

m_setListeners

protected java.util.Set m_setListeners
Set where all listeners listening to the event notifications specific to this object are stored.


m_text

protected java.lang.String m_text
Variable to store number pad text


m_npad

protected NumberPad m_npad
Number pad of this dialog

Constructor Detail

NumberPadDialog

public NumberPadDialog()
Method Detail

displayDialog

public void displayDialog(org.opensubsystems.core.application.ThickClient client,
                          java.lang.String strTitle,
                          java.lang.String strFirstLineText,
                          java.lang.String strSpecialButtonText,
                          int strMaxTextLength,
                          java.lang.String strInitialText,
                          boolean bBigButtons,
                          boolean bDecimalDot,
                          NumberPadListener specialButtonListener)
Show the dialog.

Parameters:
client - - application displaying this dialog
strTitle - - title of the dialog
strFirstLineText - - text displayed in the first line of the dialog
strSpecialButtonText - - text on the button
strMaxTextLength - - maximal length of the text that can be entered
strInitialText - - initial text to put to the dialog
bBigButtons - - if true then the buttons will be displayed large otherwise they will be displayed middle size
bDecimalDot - - if true extra line with decimal dot will be added to dialog. If bDecimalDot id true, number of decimal places can be set
specialButtonListener - - listener executed when the button is clicked

displayDialog

public void displayDialog(org.opensubsystems.core.application.ThickClientDialog parentDialog,
                          java.lang.String strTitle,
                          java.lang.String strFirstLineText,
                          java.lang.String strSpecialButtonText,
                          int strMaxTextLength,
                          java.lang.String strInitialText,
                          boolean bBigButtons,
                          boolean bDecimalDot,
                          NumberPadListener specialButtonListener)
Show the dialog.

Parameters:
parentDialog - - dialog displaying this dialog
strTitle - - title of the dialog
strFirstLineText - - text displayed in the first line of the dialog
strSpecialButtonText - - text on the button
strMaxTextLength - - maximal length of the text that can be entered
strInitialText - - initial text to put to the dialog
bBigButtons - - if true then the buttons will be displayed large otherwise they will be displayed middle size
bDecimalDot - - if true extra line with decimal dot will be added to dialog. If bDecimalDot id true, number of decimal places can be set
specialButtonListener - - listener executed when the button is clicked

getText

public java.lang.String getText()
Get the number pad text

Returns:
String

setText

public void setText(java.lang.String string)
Parameters:
string - - number pad text

setTextLimit

public boolean setTextLimit(int iLimit)
This function sets maximal nuber of characters typed

Parameters:
iLimit - - maximal number of chracters
Returns:
boolean - sucess flag

addNumberPadListener

public void addNumberPadListener(NumberPadListener listener)
Add listener for this number pad.

Parameters:
listener - - listener to add

removeNumberPadListener

public void removeNumberPadListener(NumberPadListener listener)
Remove listener from this number pad.

Parameters:
listener - - listener to remove

displayDialog

protected void displayDialog(java.lang.String strFirstLineText,
                             java.lang.String strSpecialButtonText,
                             int strMaxTextLength,
                             java.lang.String strInitialText,
                             boolean bBigButtons,
                             boolean bDecimalDot,
                             NumberPadListener specialButtonListener)
Show the dialog.

Parameters:
strFirstLineText - - text displayed in the first line of the dialog
strSpecialButtonText - - text on the button
strMaxTextLength - - maximal length of the text that can be entered
strInitialText - - initial text to put to the dialog
bBigButtons - - if true then the buttons will be displayed large otherwise they will be displayed middle size
bDecimalDot - - if true extra line with decimal dot will be added to dialog. If bDecimalDot id true, number of decimal places can be set
specialButtonListener - - listener executed when the button is clicked

createClientArea

protected org.eclipse.swt.graphics.Point createClientArea(java.lang.String strFirstLineText,
                                                          java.lang.String strSpecialButtonText,
                                                          java.lang.String strInitialText,
                                                          boolean bBigButtons,
                                                          boolean bDecimalDot)
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:
strFirstLineText - - text displayed in the first line of the dialog
strSpecialButtonText - - text on the button
strInitialText - - initial text to put to the dialog
bBigButtons - - if true then the buttons will be displayed large otherwise they will be displayed middle size
bDecimalDot - - if true extra line with decimal dot will be added to dialog. If bDecimalDot id true, number of decimal places can be set TODO: Bug: SWT 3.1.2: This should be returning void, but due to the bug bellow we need to return the size so we can adjust the size of the window
Returns:
Point - size of the number pad component


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