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

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

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

Dialog used to enter text using mouse or finger.

Version:
$Id: CharacterPadDialog.java,v 1.10 2007/01/07 06:14:15 bastafidli Exp $
Author:
Martin Cerba
Code reviewer:
Miro Halas
Code reviewed:
1.7 2006/04/05 05:32:11 bastafidli

Field Summary
protected  CharacterPad m_chpad
          character pad for this dialog
protected  int m_iCancelButtonId
          What is the ID of the cancel button.
protected  java.lang.String m_initialText
          initial text for CharacterPad
protected  java.util.Set m_setListeners
          Set where all listeners listening to the event notifications specific to this object are stored.
 
Fields inherited from class org.opensubsystems.core.application.swt.SWTThickClientDialogGuiImpl
m_client, m_oldClientLocation, m_outsideBoundingArea, m_parent, m_shell
 
Constructor Summary
CharacterPadDialog()
           
 
Method Summary
 void addCharacterPadListener(CharacterPadListener listener)
          Add listener for this character pad.
protected  org.eclipse.swt.graphics.Point createClientArea(java.lang.String strFirstLineText, java.lang.String[] specialButtons, CharacterPad.CharacterPadLayout keyboardLayout, int specialFlags, boolean bBigButtons)
          Create the client area of the dialog.
protected  void displayDialog(java.lang.String strFirstLineText, java.lang.String[] arSpecialButtonText, CharacterPad.CharacterPadLayout keyboardLayout, int strMaxTextLength, java.lang.String strInitialText, boolean bBigButtons, CharacterPadListener specialButtonListener)
          Show the dialog.
 void displayDialog(org.opensubsystems.core.application.ThickClientDialog parentDialog, java.lang.String strTitle, java.lang.String strFirstLineText, java.lang.String[] arSpecialButtonText, CharacterPad.CharacterPadLayout keyboardLayout, int strMaxTextLength, java.lang.String strInitialText, boolean bBigButtons, CharacterPadListener specialButtonListener)
          Show the dialog.
 void displayDialog(org.opensubsystems.core.application.ThickClient client, java.lang.String strTitle, java.lang.String strFirstLineText, java.lang.String[] arSpecialButtonText, CharacterPad.CharacterPadLayout keyboardLayout, int strMaxTextLength, java.lang.String strInitialText, boolean bBigButtons, CharacterPadListener specialButtonListener)
          Show the dialog.
 void removeCharacterPadListener(CharacterPadListener listener)
          Remove listener from this ncharacter pad.
 void setText(java.lang.String initialText)
          Set the initial text for the dialog.
 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_chpad

protected CharacterPad m_chpad
character pad for this dialog


m_initialText

protected java.lang.String m_initialText
initial text for CharacterPad


m_iCancelButtonId

protected int m_iCancelButtonId
What is the ID of the cancel button.

Constructor Detail

CharacterPadDialog

public CharacterPadDialog()
Method Detail

displayDialog

public void displayDialog(org.opensubsystems.core.application.ThickClient client,
                          java.lang.String strTitle,
                          java.lang.String strFirstLineText,
                          java.lang.String[] arSpecialButtonText,
                          CharacterPad.CharacterPadLayout keyboardLayout,
                          int strMaxTextLength,
                          java.lang.String strInitialText,
                          boolean bBigButtons,
                          CharacterPadListener 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
arSpecialButtonText - - texts on the buttons
keyboardLayout - - layout of keys for the keyboard pad, see the CharacterPad.KEY_LAYOUT_XXX constants
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
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[] arSpecialButtonText,
                          CharacterPad.CharacterPadLayout keyboardLayout,
                          int strMaxTextLength,
                          java.lang.String strInitialText,
                          boolean bBigButtons,
                          CharacterPadListener specialButtonListener)
Show the dialog.

Parameters:
parentDialog - - parent dialog displaying this dialog
strTitle - - title of the dialog
strFirstLineText - - text displayed in the first line of the dialog
arSpecialButtonText - - texts on the buttons
keyboardLayout - - layout of keys for the keyboard pad, see the CharacterPad.KEY_LAYOUT_XXX constants
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
specialButtonListener - - listener executed when the button is clicked

setText

public void setText(java.lang.String initialText)
Set the initial text for the dialog.

Parameters:
initialText - - initial text displayed in CharacterPad

setTextLimit

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

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

addCharacterPadListener

public void addCharacterPadListener(CharacterPadListener listener)
Add listener for this character pad.

Parameters:
listener - - listener to add

removeCharacterPadListener

public void removeCharacterPadListener(CharacterPadListener listener)
Remove listener from this ncharacter pad.

Parameters:
listener - - listener to remove

displayDialog

protected void displayDialog(java.lang.String strFirstLineText,
                             java.lang.String[] arSpecialButtonText,
                             CharacterPad.CharacterPadLayout keyboardLayout,
                             int strMaxTextLength,
                             java.lang.String strInitialText,
                             boolean bBigButtons,
                             CharacterPadListener specialButtonListener)
Show the dialog.

Parameters:
strFirstLineText - - text displayed in the first line of the dialog
arSpecialButtonText - - texts on the buttons
keyboardLayout - - layout of keys for the keyboard pad, see the CharacterPad.KEY_LAYOUT_XXX constants
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
specialButtonListener - - listener executed when the button is clicked

createClientArea

protected org.eclipse.swt.graphics.Point createClientArea(java.lang.String strFirstLineText,
                                                          java.lang.String[] specialButtons,
                                                          CharacterPad.CharacterPadLayout keyboardLayout,
                                                          int specialFlags,
                                                          boolean bBigButtons)
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
specialButtons - - array of strings for special action buttons displayed on the bottom of the dialog
keyboardLayout - - layout of keys for the keyboard pad, see the CharacterPad.KEY_LAYOUT_XXX constants
specialFlags - - special styles for character pad, combination of CHP_XXX values
bBigButtons - - if true then the buttons will be displayed large otherwise they will be displayed middle size 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.