com.sybase.uep.bobclient.controls
Class TabControl

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by com.sybase.uep.bobclient.controls.TabControl
All Implemented Interfaces:
net.rim.device.api.ui.DrawStyle

public class TabControl
extends net.rim.device.api.ui.Field
implements net.rim.device.api.ui.DrawStyle

This is the Tab control that will draw out the look and feel of the tab

Author:
tdang

Field Summary
 
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
TabControl(TabLayoutManager manager)
          Constructor to instantiate a new tab
 
Method Summary
protected  void drawFocus(net.rim.device.api.ui.Graphics g, boolean on)
          Draws the focus indicator for this tab.
 net.rim.device.api.ui.Field getContent()
          Get the contents to be displayed for this tab
 java.lang.String getContentPanelBackgroundImage()
          Gets the full file name of the content panel background image
 int getPreferredHeight()
          Gets the preferred height of the tab.
 int getPreferredWidth()
          Gets the preferred width of the tab.
 net.rim.device.api.ui.Field getTabHeader()
          Returns the tab control's header
 boolean isActive()
          Check if the tab is currently active
 boolean isScaleContentPanelBackgroundImage()
          Gets if to scale the content panel background image to fill the container
protected  void layout(int width, int height)
          Layout the tab width and height This field's manager invokes this method during the layout process to instruct this field to arrange its contents, given an amount of available space.
protected  void onUnfocus()
          (non-Javadoc)
protected  void paint(net.rim.device.api.ui.Graphics graphics)
          Redraws this tab.
 void refresh()
           
 void setActive()
          Set this tab to be active
 void setContent(net.rim.device.api.ui.Field content)
          Set tab content
 void setContentPanelBackgroundImage(java.lang.String backgroundImage)
          Sets the full file name of the content panel background image
 void setInActive()
          Set this tab to be inactive
 void setLabel(java.lang.String label)
          Set label for the tab
 void setScaleContentPanelBackgroundImage(boolean isScaleBackgroundImage)
          Sets if to scale the content panel background image to fill the container
 void setTabHeader(net.rim.device.api.ui.Field tabHeader)
          Sets the tab control's header
 void setTitleIcon(net.rim.device.api.system.EncodedImage titleIcon)
           
 
Methods inherited from class net.rim.device.api.ui.Field
drawHighlightRegion, fieldChangeNotify, focusAdd, focusChangeNotify, focusRemove, getAccessibleContext, 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, isFocus, isFocusable, isMuddy, isPasteable, isSelectable, isSelecting, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, makeContextMenu, makeContextMenu, moveFocus, moveFocus, navigationClick, 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, toString, wait, wait, wait
 

Constructor Detail

TabControl

public TabControl(TabLayoutManager manager)
Constructor to instantiate a new tab

Method Detail

setLabel

public void setLabel(java.lang.String label)
Set label for the tab

Parameters:
label - - set the label for the tab

setTitleIcon

public void setTitleIcon(net.rim.device.api.system.EncodedImage titleIcon)

getContent

public net.rim.device.api.ui.Field getContent()
Get the contents to be displayed for this tab

Returns:
Field contents

isActive

public boolean isActive()
Check if the tab is currently active


setActive

public void setActive()
Set this tab to be active


setInActive

public void setInActive()
Set this tab to be inactive


refresh

public void refresh()

getPreferredWidth

public int getPreferredWidth()
Gets the preferred width of the tab.

Overrides:
getPreferredWidth in class net.rim.device.api.ui.Field
Returns:
int value of the height

getPreferredHeight

public int getPreferredHeight()
Gets the preferred height of the tab.

Overrides:
getPreferredHeight in class net.rim.device.api.ui.Field
Returns:
int value of the height

layout

protected void layout(int width,
                      int height)
Layout the tab width and height This field's manager invokes this method during the layout process to instruct this field to arrange its contents, given an amount of available space.

Specified by:
layout in class net.rim.device.api.ui.Field
Parameters:
width - Amount of available horizontal space.
height - Amount of available vertical space.

drawFocus

protected void drawFocus(net.rim.device.api.ui.Graphics g,
                         boolean on)
Draws the focus indicator for this tab.

Overrides:
drawFocus in class net.rim.device.api.ui.Field
Parameters:
graphics - Graphics context used for drawing the focus.
on - True if the focus should be set; otherwise, false

paint

protected void paint(net.rim.device.api.ui.Graphics graphics)
Redraws this tab. This field's manager invokes this method during the repainting process to instruct this field to repaint itself.

Specified by:
paint in class net.rim.device.api.ui.Field
Parameters:
graphics - Graphics context for repainting this field.

onUnfocus

protected void onUnfocus()
(non-Javadoc)

Overrides:
onUnfocus in class net.rim.device.api.ui.Field
See Also:
Field.onUnfocus()

setContent

public void setContent(net.rim.device.api.ui.Field content)
Set tab content

Parameters:
content - - Content that will be displayed for this tab

getContentPanelBackgroundImage

public java.lang.String getContentPanelBackgroundImage()
Gets the full file name of the content panel background image

Returns:
full image file name

setContentPanelBackgroundImage

public void setContentPanelBackgroundImage(java.lang.String backgroundImage)
Sets the full file name of the content panel background image

Parameters:
backgroundImage - - full file name of the background image

isScaleContentPanelBackgroundImage

public boolean isScaleContentPanelBackgroundImage()
Gets if to scale the content panel background image to fill the container

Returns:
true means to scale the background image to fill the container

setScaleContentPanelBackgroundImage

public void setScaleContentPanelBackgroundImage(boolean isScaleBackgroundImage)
Sets if to scale the content panel background image to fill the container

Parameters:
isScaleBackgroundImage - - true means to scale the background image to fill the container

setTabHeader

public void setTabHeader(net.rim.device.api.ui.Field tabHeader)
Sets the tab control's header

Parameters:
tabHeader - the tab control's header

getTabHeader

public net.rim.device.api.ui.Field getTabHeader()
Returns the tab control's header

Returns:
the tab control's header