com.sybase.uep.bobclient.controls.celltable
Class CellLabel

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.component.LabelField
          extended by com.sybase.uep.bobclient.controls.Label
              extended by com.sybase.uep.bobclient.controls.celltable.CellLabel
All Implemented Interfaces:
Control, IControlXYDraw, net.rim.device.api.ui.DrawStyle

public class CellLabel
extends Label
implements IControlXYDraw

Represents cell attribute that only contains text

Author:
congchen TODO: Changing based on BOB tooling's design of cell label

Field Summary
 
Fields inherited from class com.sybase.uep.bobclient.controls.Label
_controlID, _customEventsHandler, _dataParts, _orientation, _wrapText
 
Fields inherited from class net.rim.device.api.ui.component.LabelField
DEFAULT_POSITION
 
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
 
Fields inherited from interface net.rim.device.api.ui.DrawStyle
BASELINE, BOTTOM, ELLIPSIS, HALIGN_MASK, HCENTER, HDEFAULT, HFULL, LEADING, LEFT, RIGHT, TOP, TRAILING, TRUNCATE_BEGINNING, VALIGN_MASK, VCENTER, VDEFAULT, VFULL
 
Constructor Summary
CellLabel(long style)
           
CellLabel(java.lang.String label, long style)
           
 
Method Summary
 void addLabelItem(java.lang.Object value, int itemType)
          Adds cell label item to the label
 void addLabelItemConfig(CellLabelItemConfig labelItemConfig)
          Adds configuration of a label item to the label
 void draw(net.rim.device.api.ui.Graphics g, int relativeX, int relativeY, boolean isFocus)
          Draws the item that implements the interface
 int getAbsoluteXPos()
          Returns the cell label's absolute X position.
 int getAbsoluteXPosFocus()
          Returns the cell label's absolute X position when focused.
 int getAbsoluteYPos()
          Returns the cell label's absolute Y position.
 int getAbsoluteYPosFocus()
          Returns the cell label's absolute Y position when focused.
 CellLabelConfig getLabelConfig()
          Gets the label configuration
 int getPreferredWidth()
          (non-Javadoc)
 int getPreferredWidth(boolean isFocus)
          Returns preferred width based on whether focused
 int getXPosition(boolean isFocus)
          Gets the X coordinator of the drawing item
 int getYPosition(boolean isFocus)
          Gets the Y coordinator of the drawing item
 boolean isFocus()
           
 void setColSpan(int columnSpan)
          (non-Javadoc)
 void setFocus()
           
 void setFocusFontStyle(FontStyle focusFontStyle)
          Set the focus font style for this control
 void setLabelConfig(CellLabelConfig labelConfig)
          Sets label configuration
 void setLabelFocus(boolean isFocus)
          Sets the focus status
 void setOrder(int order)
          Sets the order of the label
 void setRowSpan(int rowSpan)
          (non-Javadoc)
 void setUnfocusFontStyle(FontStyle unfocusFontStyle)
          Sets unfocused font style
 void setWrapText(boolean isWrapText)
          Set if the text should wrap or not
 void setXPosition(int xPos, boolean isFocus)
          Sets the X coordinator of the drawing item
 void setYPosition(int yPos, boolean isFocus)
          Sets the Y coordinator of the drawing item
 
Methods inherited from class com.sybase.uep.bobclient.controls.Label
drawFocus, drawLabel, getColSpan, getControlID, getCustomEventsDelegate, getFocusFontStyle, getFontStyle, getHorizontalAlignment, getLabelWidth, getLayoutWidth, getName, getPreferredHeight, getRowSpan, getValue, getVerticalAlignment, layout, navigationClick, navigationMovement, navigationUnclick, onFocus, onUnfocus, paint, refresh, resetTextIfTruncated, setBackgroundColor, setControlID, setCustomEventsDelegate, setFontStyle, setFooterField, setIsGridType, setIsRequired, setLayoutHeight, setLayoutWidth, setProperty, setRequiredForegroundColor, setText, setVariableLabel, setWrapHeight, touchEvent
 
Methods inherited from class net.rim.device.api.ui.component.LabelField
getAccessibleContext, getPosition, getText, isSelectionCopyable, selectionCopy, setPosition, setText, setText, setText, 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, getFocusRect, 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, isFocusable, isMuddy, isPasteable, isSelectable, isSelecting, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, makeContextMenu, moveFocus, moveFocus, onDisplay, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onVisibilityChange, paintBackground, paste, select, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setDirty, setEditable, setExtent, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, trackwheelClick, trackwheelUnclick, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellLabel

public CellLabel(long style)

CellLabel

public CellLabel(java.lang.String label,
                 long style)
Method Detail

getPreferredWidth

public int getPreferredWidth()
Description copied from class: Label
(non-Javadoc)

Specified by:
getPreferredWidth in interface Control
Overrides:
getPreferredWidth in class Label
Returns:
int value of the available layout width
See Also:
Control.getPreferredWidth()

getPreferredWidth

public int getPreferredWidth(boolean isFocus)
Returns preferred width based on whether focused

Parameters:
isFocus - whether it is focused
Returns:
preferred width based on whether focused

setLabelFocus

public void setLabelFocus(boolean isFocus)
Sets the focus status

Parameters:
isFocus -

setFocus

public void setFocus()
Overrides:
setFocus in class net.rim.device.api.ui.Field

isFocus

public boolean isFocus()
Overrides:
isFocus in class net.rim.device.api.ui.Field

draw

public void draw(net.rim.device.api.ui.Graphics g,
                 int relativeX,
                 int relativeY,
                 boolean isFocus)
Description copied from interface: IControlXYDraw
Draws the item that implements the interface

Specified by:
draw in interface IControlXYDraw
Parameters:
g - - Graphics object
relativeX - - relative X coordinator
relativeY - - relative Y coordinator
isFocus - - true means the control is focused

getXPosition

public int getXPosition(boolean isFocus)
Description copied from interface: IControlXYDraw
Gets the X coordinator of the drawing item

Specified by:
getXPosition in interface IControlXYDraw
Parameters:
isFocus - - true means the method returns the position when the control is focused
Returns:
the X coordinator

setXPosition

public void setXPosition(int xPos,
                         boolean isFocus)
Description copied from interface: IControlXYDraw
Sets the X coordinator of the drawing item

Specified by:
setXPosition in interface IControlXYDraw
Parameters:
xPos - - X coordinator
isFocus - - true means xPos is the position when the control is focused

getYPosition

public int getYPosition(boolean isFocus)
Description copied from interface: IControlXYDraw
Gets the Y coordinator of the drawing item

Specified by:
getYPosition in interface IControlXYDraw
Parameters:
isFocus - - true means the method returns the position when the control is focused
Returns:
the Y coordinator

setYPosition

public void setYPosition(int yPos,
                         boolean isFocus)
Description copied from interface: IControlXYDraw
Sets the Y coordinator of the drawing item

Specified by:
setYPosition in interface IControlXYDraw
Parameters:
yPos - - Y coordinator
isFocus - - true means yPos is the position when the control is focused

getLabelConfig

public CellLabelConfig getLabelConfig()
Gets the label configuration

Returns:
CellLabelConfig

setLabelConfig

public void setLabelConfig(CellLabelConfig labelConfig)
Sets label configuration

Parameters:
labelConfig -

setFocusFontStyle

public void setFocusFontStyle(FontStyle focusFontStyle)
Description copied from class: Label
Set the focus font style for this control

Overrides:
setFocusFontStyle in class Label
Parameters:
focusFontStyle - FontStyle font style object
See Also:
FontStyle

setUnfocusFontStyle

public void setUnfocusFontStyle(FontStyle unfocusFontStyle)
Sets unfocused font style

Parameters:
unfocusFontStyle -

setRowSpan

public void setRowSpan(int rowSpan)
Description copied from class: Label
(non-Javadoc)

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

setColSpan

public void setColSpan(int columnSpan)
Description copied from class: Label
(non-Javadoc)

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

addLabelItemConfig

public void addLabelItemConfig(CellLabelItemConfig labelItemConfig)
Adds configuration of a label item to the label

Parameters:
labelItemConfig -

setWrapText

public void setWrapText(boolean isWrapText)
Description copied from class: Label
Set if the text should wrap or not

Overrides:
setWrapText in class Label
Parameters:
isWrapText - true if text should auto wrap, otherwise false

setOrder

public void setOrder(int order)
Sets the order of the label

Parameters:
order - - used among cell attributes to determine display position

addLabelItem

public void addLabelItem(java.lang.Object value,
                         int itemType)
Adds cell label item to the label

Parameters:
value -
itemType - - defined in ICellAttributeTypeConstants

getAbsoluteXPos

public int getAbsoluteXPos()
Returns the cell label's absolute X position.

Returns:
the cell label's absolute X position.

getAbsoluteYPos

public int getAbsoluteYPos()
Returns the cell label's absolute Y position.

Returns:
the cell label's absolute Y position.

getAbsoluteXPosFocus

public int getAbsoluteXPosFocus()
Returns the cell label's absolute X position when focused.

Returns:
the cell label's absolute X position when focused.

getAbsoluteYPosFocus

public int getAbsoluteYPosFocus()
Returns the cell label's absolute Y position when focused.

Returns:
the cell label's absolute Y position when focused.