com.sybase.uep.bobclient.controls
Class NumericChoice

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.component.ChoiceField
          extended by net.rim.device.api.ui.component.NumericChoiceField
              extended by com.sybase.uep.bobclient.controls.NumericChoice
All Implemented Interfaces:
Control

public class NumericChoice
extends net.rim.device.api.ui.component.NumericChoiceField
implements Control

This is the Check box control

Author:
tdang

Field Summary
 
Fields inherited from class net.rim.device.api.ui.component.ChoiceField
CONTEXT_CHANGE_OPTION
 
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
NumericChoice(java.lang.String name)
          NumericChoice constructor
NumericChoice(java.lang.String label, int begin, int end, int increment)
          NumericChoice constructor
 
Method Summary
protected  void drawFocus(net.rim.device.api.ui.Graphics g, boolean on)
          (non-Javadoc)
 int getColSpan()
          (non-Javadoc)
 int getFieldIndex()
          Retrieve the edit index for this numeric choice
 FontStyle getFontStyle()
          Retrieve this control's font style
 long getHorizontalAlignment()
          (non-Javadoc)
 java.lang.String getName()
          (non-Javadoc)
 int getPreferredHeight()
          (non-Javadoc)
 int getPreferredWidth()
          (non-Javadoc)
 int getRowSpan()
          (non-Javadoc)
 java.lang.String getType()
          Retrieve the type for this numeric choice
 ValidationObject getValidationObj()
          Retrieve the validation object set on this checkbox
 java.lang.Object getValue()
          (non-Javadoc)
 long getVerticalAlignment()
          (non-Javadoc)
 boolean hasValidation()
          Check if there is a validation object assigned to this control
 boolean isRequired()
          Check if this numeric choice is required
protected  void layout(int width, int height)
          (non-Javadoc)
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 setColSpan(int colspan)
          (non-Javadoc)
 void setFieldIndex(int index)
          Set field index
 void setFontStyle(FontStyle fontStyle)
          Set the font style for this control
 void setFooterField(FooterField field)
          Set the footer field
 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 setRequired(boolean required)
          Set if this numeric choice is required
 void setRowSpan(int rowspan)
          (non-Javadoc)
 void setStyle(long style)
          Set style
 void setType(java.lang.String type)
          Set type
 void setValidationObj(ValidationObject obj)
          Set validation object
 void setValue(java.lang.String value)
          Set the value for this numeric choice
 void setVariableLabel(ControlVariable variable)
          Set the control variable object for the label
 
Methods inherited from class net.rim.device.api.ui.component.NumericChoiceField
getChoice, getSelectedValue, keyChar, keyControl, keyRepeat, keyStatus, makeContextMenu, navigationClick, onUnfocus, setSelectedValue, setSelectedValue
 
Methods inherited from class net.rim.device.api.ui.component.ChoiceField
getAccessibleContext, getFocusRect, getHeightOfChoices, getLabel, getSelectedIndex, getSize, getWidthOfChoice, invokeAction, moveFocus, setLabel, setSelectedIndex, setSelectedIndex, setSelectedIndex, setSize, toString
 
Methods inherited from class net.rim.device.api.ui.Field
drawHighlightRegion, fieldChangeNotify, 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, isDataValid, isDirty, isEditable, isFocus, isFocusable, isMuddy, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyDown, keyUp, makeContextMenu, moveFocus, navigationMovement, navigationUnclick, onDisplay, onExposed, onFocus, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onVisibilityChange, paintBackground, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocus, setFocusListener, setFont, 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
 

Constructor Detail

NumericChoice

public NumericChoice(java.lang.String name)
NumericChoice constructor

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

NumericChoice

public NumericChoice(java.lang.String label,
                     int begin,
                     int end,
                     int increment)
NumericChoice constructor

Parameters:
label - String value for the label for the Checkbox that goes to the left
begin - int value for the first value in the range.
end - int value for the last value in the range.
increment - int value for the amount to increase between each choice value.
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)

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()

setVariableLabel

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

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

getFontStyle

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

Returns:
FontStyle font style 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

setValue

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

Parameters:
value - String value to be set

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()

getFieldIndex

public int getFieldIndex()
Retrieve the edit index for this numeric choice

Returns:
int value for the field index

getType

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

Returns:
String value for the control 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 numeric choice is required

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

isRequired

public boolean isRequired()
Check if this numeric choice 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)

getPreferredWidth

public int getPreferredWidth()
(non-Javadoc)

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

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()

layout

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

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

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.ChoiceField
Returns:
int value of the available layout height
See Also:
Control.getPreferredHeight()

drawFocus

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

Overrides:
drawFocus in class net.rim.device.api.ui.Field
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.ChoiceField
See Also:
Field.paint(Graphics g)

refresh

public void refresh()
(non-Javadoc)

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

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 value to be display in the footer

setType

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

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

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

setValidationObj

public void setValidationObj(ValidationObject obj)
Set validation object

Parameters:
obj - ValidationObject validation object
See Also:
ValidationObject

setFieldIndex

public void setFieldIndex(int index)
Set field index

Parameters:
index - int value for the edit index

setStyle

public void setStyle(long style)
Set style

Parameters:
style - long value for the style of this control eg. Field.FIELD_LEFT, Field.FIELD_RIGHT, Field.FIELD_HCENTER, etc.
See Also:
Field

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