com.sybase.uep.bobclient.controls
Class EmailAddressInput

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.component.TextField
          extended by net.rim.device.api.ui.component.BasicEditField
              extended by net.rim.device.api.ui.component.EditField
                  extended by net.rim.device.api.ui.component.EmailAddressEditField
                      extended by com.sybase.uep.bobclient.controls.EmailAddressInput
All Implemented Interfaces:
Control, net.rim.device.internal.ui.Formatter.TextRenderer

public class EmailAddressInput
extends net.rim.device.api.ui.component.EmailAddressEditField
implements Control

This is the email address input control

Author:
tdang

Field Summary
 
Fields inherited from class net.rim.device.api.ui.component.BasicEditField
FILTER_DEFAULT, FILTER_EMAIL, FILTER_FILENAME, FILTER_HEXADECIMAL, FILTER_INTEGER, FILTER_LOWERCASE, FILTER_NUMERIC, FILTER_PHONE, FILTER_PIN_ADDRESS, FILTER_REAL_NUMERIC, FILTER_UPPERCASE, FILTER_URL
 
Fields inherited from class net.rim.device.api.ui.component.TextField
CONSUME_INPUT, DEFAULT_MAXCHARS, JUMP_FOCUS_AT_END, NO_COMPLEX_INPUT, NO_EDIT_MODE_INPUT, NO_LEARNING, NO_NEWLINE, NO_SWITCHING_INPUT
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, EDITABLE, EDITABLE_MASK, FIELD_BOTTOM, FIELD_HALIGN_MASK, FIELD_HCENTER, FIELD_LEADING, FIELD_LEFT, FIELD_RIGHT, FIELD_TOP, FIELD_TRAILING, FIELD_VALIGN_MASK, FIELD_VCENTER, FOCUSABLE, FOCUSABLE_MASK, HIGHLIGHT_FOCUS, HIGHLIGHT_SELECT, NON_FOCUSABLE, NON_SPELLCHECKABLE, READONLY, SPELLCHECKABLE, SPELLCHECKABLE_MASK, STATUS_MOVE_FOCUS_HORIZONTALLY, STATUS_MOVE_FOCUS_VERTICALLY, USE_ALL_HEIGHT, USE_ALL_WIDTH, VISUAL_STATE_ACTIVE, VISUAL_STATE_DISABLED, VISUAL_STATE_DISABLED_FOCUS, VISUAL_STATE_FOCUS, VISUAL_STATE_NORMAL
 
Constructor Summary
EmailAddressInput(java.lang.String label, java.lang.String defaultValue, int maxNumChars, long style)
          Constructor to create the email address input
 
Method Summary
 void addMenuItem(net.rim.device.api.ui.MenuItem menu)
          Add Menu Item
 void clearMenuItems()
          Remove all the menu items
 void disableGridIcon()
          Disable the grid icon
protected  void drawFocus(net.rim.device.api.ui.Graphics g, boolean on)
          (non-Javadoc)
 int getColSpan()
          (non-Javadoc)
 java.lang.String getDisplayName()
          Retrieve the display name
 int getFieldIndex()
          Retrieve the edit index for this checkbox
 FontStyle getFontStyle()
          Retrieve this control's font style
 long getHorizontalAlignment()
          (non-Javadoc)
 java.lang.String getName()
          (non-Javadoc)
static int getNumberSplitParts(java.lang.String str, net.rim.device.api.ui.Font f, int width)
          Split the label into pieces if it's too long
 int getPreferredHeight()
          (non-Javadoc)
 int getPreferredWidth()
          (non-Javadoc)
 int getRowSpan()
          (non-Javadoc)
 java.lang.String getText()
          Retrieve the current text value in this input
 java.lang.String getType()
          Retrieve the type for this checkbox
 ValidationObject getValidationObj()
          Retrieve the validation object set on this checkbox
 java.lang.Object getValue()
          (non-Javadoc)
 long getVerticalAlignment()
          (non-Javadoc)
 java.lang.String getWid()
          Retrieve wid for this email address input
 boolean hasValidation()
          Check if there is a validation object assigned to this control
 boolean isRequired()
          Check if this checkbox is required
protected  void layout(int width, int height)
          (non-Javadoc)
protected  void makeContextMenu(net.rim.device.api.ui.ContextMenu menu)
          (non-Javadoc)
protected  void onFocus(int direction)
          (non-Javadoc)
protected  void onUnfocus()
           
protected  void paint(net.rim.device.api.ui.Graphics g)
          (non-Javadoc)
 void refresh()
          (non-Javadoc)
 void refreshFooter(java.lang.String valueToBeDisplay)
          Refresh the footer field from the screen that contains the text of the button.
 void setBackgroundColor(int bgcolor)
          (non-Javadoc)
 void setBorderColor(int borderColor)
          Set the border color
 void setColSpan(int colspan)
          (non-Javadoc)
 void setDisplayName(java.lang.String name)
          Set display name
 void setFieldIndex(int index)
          Set edit index
 void setFontStyle(FontStyle fontStyle)
          Set the font style for this control
 void setFooterField(FooterField field)
          Set the footer field
 void setGridType(boolean gridType)
          Set grid type
 void setLayoutHeight(int height)
          (non-Javadoc)
 void setLayoutWidth(int width)
          (non-Javadoc)
 void setName(java.lang.String name)
          Set a key name for this control
 void setProperty(int key, java.lang.String value)
          Set the property values for this email address input
 void setRequired(boolean required)
          Set if this checkbox is required
 void setRowSpan(int rowspan)
          (non-Javadoc)
 void setShowBorder(boolean bol)
          Set if to show the border
 void setText(java.lang.String text)
          Set the text value in this input
 void setType(java.lang.String type)
          Set type
 void setValidationObject(ValidationObject obj)
          Set validation object
 void setValue(java.lang.String value)
          Set the value for this input
 void setVariableInput(ControlVariable variable)
          Set the control variable object for the input value
 void setVariableLabel(ControlVariable variable)
          Set the control variable object for the label
 void setWindowId(java.lang.String windowId)
          Set window id
 
Methods inherited from class net.rim.device.api.ui.component.EmailAddressEditField
backspace, insert, insert, keyChar
 
Methods inherited from class net.rim.device.api.ui.component.EditField
isEnteringRollerCharacter, keyDown, keyRepeat, moveFocus
 
Methods inherited from class net.rim.device.api.ui.component.BasicEditField
backspace, backspace, charAt, clear, displayFieldFullMessage, getCursorPosition, getFilter, getLabel, getLabelLength, getMaxSize, getText, getText, getTextAbstractString, getTextLength, insert, isSymbolScreenAllowed, keyControl, moveFocus, paste, selectionDelete, setCursorPosition, setCursorPosition, setFilter, setFont, setLabel, setMaxSize, setText, update, wipe
 
Methods inherited from class net.rim.device.api.ui.component.TextField
drawText, fieldChangeNotify, getAccessibleContext, getComposedTextEnd, getComposedTextStart, getDisplayLineCount, getFocusRect, getText, insert, insert, insert, insert, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionDeleteable, navigationClick, navigationUnclick, onUndisplay, select, selectionCopy, setPreLayoutInternal, setSelection, toString
 
Methods inherited from class net.rim.device.api.ui.Field
drawHighlightRegion, focusAdd, focusChangeNotify, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeafFieldWithFocus, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getScreen, getState, getStyle, getTop, getVisualState, getWidth, invalidate, invalidate, invalidateAll, invokeAction, isDataValid, isDirty, isEditable, isFocus, isFocusable, isMuddy, isSelectionCutable, isSpellCheckable, isStyle, isVisible, keyStatus, keyUp, makeContextMenu, navigationMovement, onDisplay, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paintBackground, selectionCut, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocus, setFocusListener, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, touchEvent, trackwheelClick, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.rim.device.internal.ui.Formatter.TextRenderer
getFont
 

Constructor Detail

EmailAddressInput

public EmailAddressInput(java.lang.String label,
                         java.lang.String defaultValue,
                         int maxNumChars,
                         long style)
Constructor to create the email address input

Parameters:
label - String value for the label in the input
defaultValue - String value for the default value
maxNumChars - int value for the max number of characters allow for user to enter
style - long value for the style of the input
Method Detail

setBackgroundColor

public void setBackgroundColor(int bgcolor)
(non-Javadoc)

Specified by:
setBackgroundColor in interface Control
Parameters:
bgcolor - int value of the color in HEX. For example: 0x00000000, 0x00FF0000, 0x00FFFFFF
See Also:
Control.setBackgroundColor(int bgcolor)

setColSpan

public void setColSpan(int colspan)
(non-Javadoc)

Specified by:
setColSpan in interface Control
Parameters:
colspan - int value of the column span
See Also:
Control.setColSpan(int colspan)

getColSpan

public int getColSpan()
(non-Javadoc)

Specified by:
getColSpan in interface Control
Returns:
int value of the column span
See Also:
Control.getColSpan()

setRowSpan

public void setRowSpan(int rowspan)
(non-Javadoc)

Specified by:
setRowSpan in interface Control
Parameters:
rowspan - int value of the row span
See Also:
Control.setRowSpan(int rowspan)

getRowSpan

public int getRowSpan()
(non-Javadoc)

Specified by:
getRowSpan in interface Control
Returns:
int value of the row span
See Also:
Control.getRowSpan()

getHorizontalAlignment

public long getHorizontalAlignment()
(non-Javadoc)

Specified by:
getHorizontalAlignment in interface Control
Returns:
long value of the horizontal alignment. Possible values could be Field.FIELD_HCENTER, Field.FIELD_RIGHT, or Field.FIELD_LEFT
See Also:
Control.getHorizontalAlignment()

getVerticalAlignment

public long getVerticalAlignment()
(non-Javadoc)

Specified by:
getVerticalAlignment in interface Control
Returns:
long value of the vertical alignment Possible values could be Field.FIELD_TOP, Field.FIELD_BOTTOM, or Field.FIELD_VCENTER
See Also:
Control.getVerticalAlignment()

setBorderColor

public void setBorderColor(int borderColor)
Set the border color

Parameters:
color - int HEX value for the border color. Examples of colors are 0x00FFFFFF, 0x00FF0000, 0x00000000

setShowBorder

public void setShowBorder(boolean bol)
Set if to show the border

Parameters:
bol - true to show border around text input, otherwise false

setVariableInput

public void setVariableInput(ControlVariable variable)
Set the control variable object for the input value

Parameters:
variable - ControlVariable control variable object
See Also:
ControlVariable

setVariableLabel

public void setVariableLabel(ControlVariable variable)
Set the control variable object for the label

Parameters:
variable - ControlVariable control variable object

getFontStyle

public FontStyle getFontStyle()
Retrieve this control's font style

Returns:
FontStyle object
See Also:
FontStyle

setFontStyle

public void setFontStyle(FontStyle fontStyle)
Set the font style for this control

Parameters:
fontStyle - FontStyle font style object
See Also:
FontStyle

getFieldIndex

public int getFieldIndex()
Retrieve the edit index for this checkbox

Returns:
int value for the field index

getDisplayName

public java.lang.String getDisplayName()
Retrieve the display name

Returns:
String value of the display name

getType

public java.lang.String getType()
Retrieve the type for this checkbox

Returns:
String value for the input type

getName

public java.lang.String getName()
(non-Javadoc)

Specified by:
getName in interface Control
Returns:
String value of the key name
See Also:
Control.getName()

getValidationObj

public ValidationObject getValidationObj()
Retrieve the validation object set on this checkbox

Returns:
ValidationObject validation object
See Also:
ValidationObject

hasValidation

public boolean hasValidation()
Check if there is a validation object assigned to this control

Returns:
true if there is validation object set, otherwise false

setRequired

public void setRequired(boolean required)
Set if this checkbox is required

Parameters:
required - true if control is required, otherwise false

isRequired

public boolean isRequired()
Check if this checkbox is required

Returns:
true if required, otherwise false

setLayoutWidth

public void setLayoutWidth(int width)
(non-Javadoc)

Specified by:
setLayoutWidth in interface Control
Parameters:
width - int value of the available layout width
See Also:
Control.setLayoutWidth(int width)

onFocus

protected void onFocus(int direction)
(non-Javadoc)

Overrides:
onFocus in class net.rim.device.api.ui.component.TextField
See Also:
Field.onFocus(int direction)

getPreferredWidth

public int getPreferredWidth()
(non-Javadoc)

Specified by:
getPreferredWidth in interface Control
Overrides:
getPreferredWidth in class net.rim.device.api.ui.component.BasicEditField
Returns:
int value of the available layout width
See Also:
Control.getPreferredWidth()

setLayoutHeight

public void setLayoutHeight(int height)
(non-Javadoc)

Specified by:
setLayoutHeight in interface Control
Parameters:
height - int value of the available layout height
See Also:
Control.setLayoutHeight(int height)

getPreferredHeight

public int getPreferredHeight()
(non-Javadoc)

Specified by:
getPreferredHeight in interface Control
Overrides:
getPreferredHeight in class net.rim.device.api.ui.component.BasicEditField
Returns:
int value of the available layout height
See Also:
Control.getPreferredHeight()

getText

public java.lang.String getText()
Retrieve the current text value in this input

Overrides:
getText in class net.rim.device.api.ui.component.BasicEditField
Returns:
String value of the input text

setText

public void setText(java.lang.String text)
Set the text value in this input

Overrides:
setText in class net.rim.device.api.ui.component.BasicEditField
Parameters:
text - string value for the email address input

setValue

public void setValue(java.lang.String value)
Set the value for this input

Parameters:
value - String value for the input text

getValue

public java.lang.Object getValue()
(non-Javadoc)

Specified by:
getValue in interface Control
Returns:
Object of the value set for this control
See Also:
Control.getValue()

getWid

public java.lang.String getWid()
Retrieve wid for this email address input

Returns:
String value of the window ID

disableGridIcon

public void disableGridIcon()
Disable the grid icon


onUnfocus

protected void onUnfocus()
Overrides:
onUnfocus in class net.rim.device.api.ui.component.BasicEditField

layout

protected void layout(int width,
                      int height)
(non-Javadoc)

Overrides:
layout in class net.rim.device.api.ui.component.BasicEditField
See Also:
Field.layout(int width, int height)

drawFocus

protected void drawFocus(net.rim.device.api.ui.Graphics g,
                         boolean on)
(non-Javadoc)

Overrides:
drawFocus in class net.rim.device.api.ui.component.BasicEditField
See Also:
Field.drawFocus(Graphics g, boolean on)

paint

protected void paint(net.rim.device.api.ui.Graphics g)
(non-Javadoc)

Overrides:
paint in class net.rim.device.api.ui.component.BasicEditField
See Also:
Field.paint(Graphics g)

addMenuItem

public void addMenuItem(net.rim.device.api.ui.MenuItem menu)
Add Menu Item

Parameters:
menu - MenuItem menu object
See Also:
MenuItem

clearMenuItems

public void clearMenuItems()
Remove all the menu items


makeContextMenu

protected void makeContextMenu(net.rim.device.api.ui.ContextMenu menu)
(non-Javadoc)

Overrides:
makeContextMenu in class net.rim.device.api.ui.component.BasicEditField
See Also:
Field.makeContextMenu(ContextMenu menu)

refresh

public void refresh()
(non-Javadoc)

Specified by:
refresh in interface Control
See Also:
Control.refresh()

setProperty

public void setProperty(int key,
                        java.lang.String value)
Set the property values for this email address input

Parameters:
key - int int value for the key of a specific attribute
value - String value for this attribute

refreshFooter

public void refreshFooter(java.lang.String valueToBeDisplay)
Refresh the footer field from the screen that contains the text of the button.

Parameters:
valueToBeDisplay - String value for the text to be display in the footer

getNumberSplitParts

public static int getNumberSplitParts(java.lang.String str,
                                      net.rim.device.api.ui.Font f,
                                      int width)
Split the label into pieces if it's too long

Parameters:
str - String value of the label
f - Font object to used
width - int value of the label width
Returns:
int value for the array size of the split up label

setFooterField

public void setFooterField(FooterField field)
Set the footer field

Parameters:
{@link - FooterField} footer field to put the text of the textinput into. This is useful for long text, so it can be displayed in the footer. null value if there is no footer.
See Also:
FooterField

setName

public void setName(java.lang.String name)
Set a key name for this control

Parameters:
name - String value for the key name for this control

setWindowId

public void setWindowId(java.lang.String windowId)
Set window id

Parameters:
windowId - String value for the window id

setGridType

public void setGridType(boolean gridType)
Set grid type

Parameters:
gridType - true if control has a grid lookup, otherwise false

setValidationObject

public void setValidationObject(ValidationObject obj)
Set validation object

Parameters:
obj - ValidationObject validation object
See Also:
ValidationObject

setFieldIndex

public void setFieldIndex(int index)
Set edit index

Parameters:
index - int value for the edit index

setDisplayName

public void setDisplayName(java.lang.String name)
Set display name

Parameters:
name - String value for the display name

setType

public void setType(java.lang.String type)
Set type

Parameters:
type - String value for the type of the update