com.sybase.uep.bobclient.controls
Class HyperLinkRichField

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.RichTextField
              extended by net.rim.device.api.ui.component.ActiveRichTextField
                  extended by com.sybase.uep.bobclient.controls.HyperLinkRichField
All Implemented Interfaces:
Control, net.rim.device.api.ui.component.CookieProvider, net.rim.device.api.ui.DrawStyle, net.rim.device.internal.ui.Formatter.TextRenderer

public class HyperLinkRichField
extends net.rim.device.api.ui.component.ActiveRichTextField
implements net.rim.device.api.ui.DrawStyle, Control

This is the hyper link control. This difference between HyperLinkRichField and HyperLink is that this will use Blackberries rich context matching to handle phone and email options.

Author:
tdang

Nested Class Summary
 
Nested classes/interfaces inherited from class net.rim.device.api.ui.component.ActiveRichTextField
net.rim.device.api.ui.component.ActiveRichTextField.RegionQueue
 
Field Summary
 
Fields inherited from class net.rim.device.api.ui.component.ActiveRichTextField
_cookieID, INVALID_COOKIE_ID, SCANFLAG_DISABLE_ALL_THREADING, SCANFLAG_THREAD_ON_CREATE
 
Fields inherited from class net.rim.device.api.ui.component.RichTextField
TEXT_ALIGN_HCENTER, TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, USE_TEXT_WIDTH
 
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
 
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
HyperLinkRichField(int labelRID, long style)
          HyperLinkRichField constructor
HyperLinkRichField(int labelRID, long style, boolean showBackgroundColor)
          HyperLinkRichField constructor
HyperLinkRichField(java.lang.String label, long style)
          HyperLinkRichField constructor
HyperLinkRichField(java.lang.String label, long style, boolean showBackgroundColor)
          HyperLinkRichField constructor
 
Method Summary
protected  void drawFocus(net.rim.device.api.ui.Graphics g, boolean on)
          (non-Javadoc)
 IBOBAction getAction()
          Retrieve the action assigned to this hyperlink
 int getColSpan()
          (non-Javadoc)
 FontStyle getFocusFontStyle()
          Retrieve focus font style
 long getHorizontalAlignment()
          (non-Javadoc)
 int getHyperLinkWidth()
          Retrieve hyperlink width
 java.lang.String getName()
          (non-Javadoc)
 int getPreferredHeight()
          (non-Javadoc)
 int getPreferredWidth()
          (non-Javadoc)
 int getRowSpan()
          (non-Javadoc)
 FontStyle getUnfocusFontStyle()
          Retrieve unfocus font style
 java.lang.Object getValue()
          (non-Javadoc)
 long getVerticalAlignment()
          (non-Javadoc)
protected  void layout(int width, int height)
          (non-Javadoc)
protected  void makeContextMenu(net.rim.device.api.ui.ContextMenu menu)
          (non-Javadoc)
protected  void onUnfocus()
          Invoked when a field loses the focus
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 runAction()
          Run the action assigned to this hyperlink
 void setAction(IBOBAction action)
          Set the action assigned to this hyperlink
 void setBackgroundColor(int bgcolor)
          (non-Javadoc)
 void setColSpan(int colspan)
          (non-Javadoc)
 void setFocusFontStyle(FontStyle fontStyle)
          Set the focus 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 setProperty(int key, java.lang.String value)
          Set the property values for this hyperlink
 void setRowSpan(int rowspan)
          (non-Javadoc)
 void setText(java.lang.String text)
          Set the label value ActiveRichTextField: different method signature than LabelField
 void setUnfocusFontStyle(FontStyle fontStyle)
          Set the unfocus font style for this control
 void setVariableLabel(ControlVariable variable)
          Set the control variable object for the label
 
Methods inherited from class net.rim.device.api.ui.component.ActiveRichTextField
drawText, executeBackgroundScan, getContextMenuContext, getCookieWithFocus, getFocusRect, getMainScreenManager, getRegionCookie, getRegionCookie, getScanFlags, getText, invokeAction, keyDown, regionHasCookie, regionHasCookie, scrollVertically, selectionCopy, setAttributes, setScanFlags, setText, setText, setText, setText
 
Methods inherited from class net.rim.device.api.ui.component.RichTextField
charAt, getAttributes, getBackgroundColors, getCursorPosition, getFonts, getFonts, getForegroundColors, getOffsets, getRegion, getRegionFont, getRegionFont, getRegionText, getRegionText, getText, getTextLength, isSelectable, keyChar, moveFocus, setCursorPosition, setFont, setFont, setText, setText
 
Methods inherited from class net.rim.device.api.ui.component.TextField
backspace, backspace, backspace, clear, displayFieldFullMessage, drawText, fieldChangeNotify, getAccessibleContext, getComposedTextEnd, getComposedTextStart, getDisplayLineCount, getFilter, getLabel, getLabelLength, getMaxSize, getText, getText, getTextAbstractString, insert, insert, insert, insert, insert, insert, insert, isPasteable, isSelecting, isSelectionCopyable, isSelectionDeleteable, isSymbolScreenAllowed, keyControl, moveFocus, navigationClick, navigationUnclick, onFocus, onUndisplay, paste, select, selectionDelete, setCursorPosition, setFilter, setLabel, setMaxSize, setPreLayoutInternal, setSelection, setText, toString, update, wipe
 
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, isDataValid, isDirty, isEditable, isFocus, isFocusable, isMuddy, isSelectionCutable, isSpellCheckable, isStyle, isVisible, keyRepeat, 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

HyperLinkRichField

public HyperLinkRichField(int labelRID,
                          long style)
HyperLinkRichField constructor

Parameters:
labelRID - int value for the localization resource ID of the label value to be displayed
style - long value for the style of this control eg. Field.FIELD_LEFT, Field.FIELD_RIGHT, Field.FIELD_HCENTER, etc.
See Also:
Field

HyperLinkRichField

public HyperLinkRichField(java.lang.String label,
                          long style)
HyperLinkRichField constructor

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

HyperLinkRichField

public HyperLinkRichField(int labelRID,
                          long style,
                          boolean showBackgroundColor)
HyperLinkRichField constructor

Parameters:
labelRID - int value for the localization resource ID of the label value to be displayed
style - long value for the style of this control eg. Field.FIELD_LEFT, Field.FIELD_RIGHT, Field.FIELD_HCENTER, etc.
showBackgroundColor - true to show background color, otherwise false
See Also:
Field

HyperLinkRichField

public HyperLinkRichField(java.lang.String label,
                          long style,
                          boolean showBackgroundColor)
HyperLinkRichField constructor

Parameters:
label - String value for the label to be displayed
style - long value for the style of this control eg. Field.FIELD_LEFT, Field.FIELD_RIGHT, Field.FIELD_HCENTER, etc.
showBackgroundColor - true to show background color, otherwise false
See Also:
Field
Method Detail

makeContextMenu

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

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

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

setVariableLabel

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

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

getUnfocusFontStyle

public FontStyle getUnfocusFontStyle()
Retrieve unfocus font style

Returns:
FontStyle font style object
See Also:
FontStyle

setUnfocusFontStyle

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

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

getFocusFontStyle

public FontStyle getFocusFontStyle()
Retrieve focus font style

Returns:
FontStyle font style object
See Also:
FontStyle

setFocusFontStyle

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

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

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

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

getAction

public IBOBAction getAction()
Retrieve the action assigned to this hyperlink

Returns:
IBOBAction action to perform
See Also:
IBOBAction

setAction

public void setAction(IBOBAction action)
Set the action assigned to this hyperlink

Parameters:
action - IBOBAction action object to be perform when the hyperlink is clicked on
See Also:
IBOBAction

runAction

public void runAction()
Run the action assigned to this hyperlink


setText

public void setText(java.lang.String text)
Set the label value ActiveRichTextField: different method signature than LabelField

Overrides:
setText in class net.rim.device.api.ui.component.ActiveRichTextField
Parameters:
text - String value for the label

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)

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)

getPreferredWidth

public int getPreferredWidth()
(non-Javadoc)

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

getHyperLinkWidth

public int getHyperLinkWidth()
Retrieve hyperlink width

Returns:
int value for the width link text

getPreferredHeight

public int getPreferredHeight()
(non-Javadoc)

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

layout

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

Overrides:
layout in class net.rim.device.api.ui.component.RichTextField
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.ActiveRichTextField
See Also:
Field.drawFocus(Graphics g, boolean on)

onUnfocus

protected void onUnfocus()
Invoked when a field loses the focus

Overrides:
onUnfocus in class net.rim.device.api.ui.Field

paint

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

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

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 hyperlink

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 value displayed in the footer

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