com.sybase.uep.bobclient.controls
Class TabLayoutManager

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

public class TabLayoutManager
extends net.rim.device.api.ui.Manager
implements Control

This is the Tab layout manager

Author:
tdang

Nested Class Summary
static interface TabLayoutManager.TabChangeListener
          Listener interface for handling tab change events.
 
Field Summary
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLL_MASK, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, LEAVE_BLANK_SPACE, LEFTMOST, LEFTWARD, NO_HORIZONTAL_SCROLL, NO_HORIZONTAL_SCROLLBAR, NO_SCROLL_RESET, NO_VERTICAL_SCROLL, NO_VERTICAL_SCROLLBAR, QUANTA_FONT, RIGHTMOST, RIGHTWARD, TOPMOST, UPWARD, VERTICAL_SCROLL, VERTICAL_SCROLL_MASK, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_MASK
 
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
TabLayoutManager(FontStyle displayFontStyle, FontStyle activeTabFontStyle, FontStyle inactiveTabFontStyle, FooterField footerField, int activeTabBorderColor, int inactiveTabBorderColor)
          Constructor to instantiate a tab layout manager
 
Method Summary
 void addTab(int nameRID, java.lang.String titleImageName, java.lang.String contentPanelBackgroundImageName, boolean isScaleContentPanelBackgroundImage, boolean isActive, net.rim.device.api.ui.Field content)
          Add new tab to the tab layout manager
 void addTab(java.lang.String name, java.lang.String titleImageName, java.lang.String contentPanelBackgroundImageName, boolean isScaleContentPanelBackgroundImageAspectFit, boolean isActive, net.rim.device.api.ui.Field content)
          Add new tab to the tab layout manager
 void addTabChangeListener(TabLayoutManager.TabChangeListener listener)
          Add TabChangeListener instance to the list of listeners
 int getActiveTabBorderColor()
          Retrieve active tab border color
 FontStyle getActiveTabFontStyle()
          Retrieve active tab font style
 net.rim.device.api.ui.Field[] getAllFields()
          Retrieve all the controls on this layout
 int getBorderEdgeBackgroundColor()
          Retrieve border edge background color
 int getColSpan()
          (non-Javadoc)
 TabContentPanel getContentPanel()
          Gets content panel
 int getControlID()
          Returns the control's ID
 net.rim.device.api.ui.Field getCurrentTabContent()
          Retrieve current active tab contents
 ICustomEventsDelegate getCustomEventsDelegate()
          Returns the control's custom events delegate
 long getHorizontalAlignment()
          (non-Javadoc)
 int getInactiveTabBorderColor()
          Retrieve inactive tab border color
 FontStyle getInactiveTabFontStyle()
          Retrieve inactive tab font style
 int getMaxTabControlHeight()
          Gets maximum tab control height of all tab controls
 int getMaxTabTextHeight()
          Retrieve the tab max height based on the active and inactive font styles
 java.lang.String getName()
          (non-Javadoc)
 net.rim.device.api.ui.Field getParentTabContent()
          Retrieve parent tab contents
 int getPreferredHeight()
          (non-Javadoc)
 int getRowSpan()
          (non-Javadoc)
 int getSelectedTab()
          Get selected tab index
 TabControlLayout getTabControlLayout()
          Gets tab control layout
 net.rim.device.api.ui.Field getTabField(int index)
          Retrieve the tab field with the index
 java.lang.Object getValue()
          (non-Javadoc)
 long getVerticalAlignment()
          (non-Javadoc)
 void gotoCurrentSelectedTab()
          Goes to the current selected tab
 void gotoTab(int index)
          Go to tab based on the index
protected  void makeContextMenu(net.rim.device.api.ui.ContextMenu menu)
          (non-Javadoc)
 void nextTab()
          Go to next tab
 void previousTab()
          Go to previous tab
 void refresh()
          (non-Javadoc)
 void refreshFooter(java.lang.String valueToBeDisplay)
          Refresh the footer field from the screen that contains the text of the column cell.
 void removeTabChangeListener(TabLayoutManager.TabChangeListener listener)
          Remove TabChangeListener instance from the list of listeners
 void setActiveTabFontStyle(FontStyle fontStyle)
          Set active tab style for
 void setBackgroundColor(int bgcolor)
          (non-Javadoc)
 void setBorderEdgeBackgroundColor(int color)
          Set the border edge background color
 void setColSpan(int colspan)
          (non-Javadoc)
 void setContent(net.rim.device.api.ui.Field content)
          Set the tab content
 void setControlID(int controlID)
          Sets the control's ID
 void setCustomEventsDelegate(ICustomEventsDelegate delegate, int eventsFlags)
          Sets the control's custom events delegate for the given events
 void setDisplayFontStyle(FontStyle fontStyle)
          Set display font style for tab panel
 void setInactiveTabFontStyle(FontStyle fontStyle)
          Set inactive tab font style
 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 tab layout manager
 void setRowSpan(int rowspan)
          (non-Javadoc)
protected  void sublayout(int width, int height)
          (non-Javadoc)
 
Methods inherited from class net.rim.device.api.ui.Manager
add, clearCustomScrollArrows, delete, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, getVisibleHeight, getVisibleWidth, insert, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, nextFocus, nextFocus, onFocus, onUndisplay, onUnfocus, paint, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setHorizontalScroll, setNonfocusableOverride, setPositionChild, setScrollListener, setVerticalQuantization, setVerticalScroll, setVirtualExtent, subpaint, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, 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, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredWidth, getScreen, getState, getStyle, getTop, getVisualState, getWidth, invalidateAll, isEditable, isFocus, isPasteable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onDisplay, onExposed, onMenuDismissed, onMenuDismissed, onObscured, onVisibilityChange, paintBackground, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCookie, setEditable, setExtent, setFocus, setFocusListener, setFont, setFont, setMargin, setMargin, setMuddy, setNonSpellCheckable, setPadding, setPadding, setPosition, setVisualState, updateLayout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sybase.uep.bobclient.controls.Control
getPreferredWidth
 

Constructor Detail

TabLayoutManager

public TabLayoutManager(FontStyle displayFontStyle,
                        FontStyle activeTabFontStyle,
                        FontStyle inactiveTabFontStyle,
                        FooterField footerField,
                        int activeTabBorderColor,
                        int inactiveTabBorderColor)
Constructor to instantiate a tab layout manager

Parameters:
displayFontStyle - FontStyle font style object for the display
activeTabFontStyle - FontStyle font style object for the active tab
inactiveTabFontStyle - FontStyle font style object for the inactive tab
footerField - FooterField object to display text information. This is useful for long values, the text can be fully shown in the footer. Null for no footer.
activeTabBorderColor - int HEX value of the active tab border color. Examples of colors are 0x00FFFFFF, 0x00FF0000, 0x00000000
inactiveTabBorderColor - int HEX value of the inactive tab border color. Examples of colors are 0x00FFFFFF, 0x00FF0000, 0x00000000
Method Detail

sublayout

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

Specified by:
sublayout in class net.rim.device.api.ui.Manager
See Also:
net.rim.device.api.ui.Field#sublayout(int width, int height)

previousTab

public void previousTab()
Go to previous tab


nextTab

public void nextTab()
Go to next tab


gotoTab

public void gotoTab(int index)
Go to tab based on the index

Parameters:
index - int value for the tab index

getCurrentTabContent

public net.rim.device.api.ui.Field getCurrentTabContent()
Retrieve current active tab contents

Returns:
Field object of the current tab
See Also:
Field

getParentTabContent

public net.rim.device.api.ui.Field getParentTabContent()
Retrieve parent tab contents

Returns:
Field object of the parent tab
See Also:
Field

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)

getPreferredHeight

public int getPreferredHeight()
(non-Javadoc)

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

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

getSelectedTab

public int getSelectedTab()
Get selected tab index

Returns:
- index of the currently selected tab

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

refresh

public void refresh()
(non-Javadoc)

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

gotoCurrentSelectedTab

public void gotoCurrentSelectedTab()
Goes to the current selected tab


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)

getActiveTabBorderColor

public int getActiveTabBorderColor()
Retrieve active tab border color

Returns:
int HEX value of the active tab border color. Examples of colors are 0x00FFFFFF, 0x00FF0000, 0x00000000

getMaxTabTextHeight

public int getMaxTabTextHeight()
Retrieve the tab max height based on the active and inactive font styles

Returns:
int value of the tab max height

getMaxTabControlHeight

public int getMaxTabControlHeight()
Gets maximum tab control height of all tab controls

Returns:
maximum tab control height

getActiveTabFontStyle

public FontStyle getActiveTabFontStyle()
Retrieve active tab font style

Returns:
FontStyle font style object
See Also:
FontStyle

setDisplayFontStyle

public void setDisplayFontStyle(FontStyle fontStyle)
Set display font style for tab panel

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

setActiveTabFontStyle

public void setActiveTabFontStyle(FontStyle fontStyle)
Set active tab style for

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

getInactiveTabBorderColor

public int getInactiveTabBorderColor()
Retrieve inactive tab border color

Returns:
int HEX value of the inactive tab border color. Examples of colors are 0x00FFFFFF, 0x00FF0000, 0x00000000

getInactiveTabFontStyle

public FontStyle getInactiveTabFontStyle()
Retrieve inactive tab font style

Returns:
FontStyle font style object
See Also:
FontStyle

setInactiveTabFontStyle

public void setInactiveTabFontStyle(FontStyle fontStyle)
Set inactive tab font style

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

getBorderEdgeBackgroundColor

public int getBorderEdgeBackgroundColor()
Retrieve border edge background color

Returns:
int HEX value for the border edge background color. Examples of colors are 0x00FFFFFF, 0x00FF0000, 0x00000000

setBorderEdgeBackgroundColor

public void setBorderEdgeBackgroundColor(int color)
Set the border edge background color

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

addTab

public void addTab(int nameRID,
                   java.lang.String titleImageName,
                   java.lang.String contentPanelBackgroundImageName,
                   boolean isScaleContentPanelBackgroundImage,
                   boolean isActive,
                   net.rim.device.api.ui.Field content)
Add new tab to the tab layout manager

Parameters:
nameRID - int value of the localization resource ID for the name of the tab
titleImageName - String image file name of the tab title icon
contentPanelBackgroundImageName - - image file name of the content panel background
isScaleContentPanelBackgroundImage - - true means to scale the background image to fill the container
isActive - true if the tab is currently active, otherwise false
content - Field object for the tab contents that will be displayed
See Also:
Field

addTab

public void addTab(java.lang.String name,
                   java.lang.String titleImageName,
                   java.lang.String contentPanelBackgroundImageName,
                   boolean isScaleContentPanelBackgroundImageAspectFit,
                   boolean isActive,
                   net.rim.device.api.ui.Field content)
Add new tab to the tab layout manager

Parameters:
name - String value of the name of the tab
titleImageName - String image file name of the tab title icon
contentPanelBackgroundImageName - - image file name of the content panel background
isScaleContentPanelBackgroundImageAspectFit - - true means to scale the background image as aspect fit, false as aspect fill
isActive - true if the tab is currently active, otherwise false
content - Field object for the tab contents that will be displayed
See Also:
Field

setContent

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

Parameters:
content - Field object for the tab contents
See Also:
Field

getAllFields

public net.rim.device.api.ui.Field[] getAllFields()
Retrieve all the controls on this layout

Returns:
Field array list of Controls
See Also:
Field

getTabField

public net.rim.device.api.ui.Field getTabField(int index)
Retrieve the tab field with the index

Parameters:
index - int value for the tab index
Returns:
Field object of the tab with the index
See Also:
Field

setProperty

public void setProperty(int key,
                        java.lang.String value)
Set the property values for this tab layout manager

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 column cell.

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

makeContextMenu

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

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

getCustomEventsDelegate

public ICustomEventsDelegate getCustomEventsDelegate()
Returns the control's custom events delegate

Returns:
the control's custom events delegate

setCustomEventsDelegate

public void setCustomEventsDelegate(ICustomEventsDelegate delegate,
                                    int eventsFlags)
Sets the control's custom events delegate for the given events

Parameters:
delegate - custom events delegate
eventsFlags - the events to set delegate to

getControlID

public int getControlID()
Returns the control's ID

Returns:
the control's Id

setControlID

public void setControlID(int controlID)
Sets the control's ID

Parameters:
controlId - control ID

addTabChangeListener

public void addTabChangeListener(TabLayoutManager.TabChangeListener listener)
Add TabChangeListener instance to the list of listeners

Parameters:
listener -

removeTabChangeListener

public void removeTabChangeListener(TabLayoutManager.TabChangeListener listener)
Remove TabChangeListener instance from the list of listeners

Parameters:
listener -

getContentPanel

public TabContentPanel getContentPanel()
Gets content panel

Returns:
TabContentPanel

getTabControlLayout

public TabControlLayout getTabControlLayout()
Gets tab control layout

Returns:
TabControlLayout