com.sybase.uep.bobclient.controls
Class ToolbarManager

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.Manager
          extended by net.rim.device.api.ui.container.VerticalFieldManager
              extended by com.sybase.uep.bobclient.controls.ToolbarManager

public class ToolbarManager
extends net.rim.device.api.ui.container.VerticalFieldManager

Work as container of Toolbar items. Derived from VerticalFieldManager to allow user add field top of toolbar items, and use HorizontalFieldManager as delegate to manage items.

Author:
linsong

Field Summary
protected  int _controlID
           
protected  CustomEventsHandler _customEventsHandler
           
protected  int _orientation
           
 
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
ToolbarManager()
           
 
Method Summary
 void addToolbarItem(ToolbarItem item)
          Add ToolbarItem object to this ToolbarManager
 void addTop(net.rim.device.api.ui.Field field)
          Add field on the top of toolbar items
protected  void drawFocus(net.rim.device.api.ui.Graphics g, boolean on)
          (non-Javadoc)
 FontStyle getBorderStyle()
           
 int getControlID()
          Returns the control's ID
 ICustomEventsDelegate getCustomEventsDelegate()
          Returns the control's custom events delegate
 FontStyle getFocusFontStyle()
           
 int getItemCount()
           
 int getPreferredWidth()
           
 FontStyle getUnfocusFontStyle()
           
protected  void paint(net.rim.device.api.ui.Graphics g)
          (non-Javadoc)
 void removeToobarItem(ToolbarItem item)
          Remove ToolbarItem object from this ToolbarManager
 void removeTop()
          Remove top field
 void setBorderStyle(FontStyle borderStyle)
          set the toolbar border font style
 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 setFocusFontStyle(FontStyle focusStyle)
          set the toolbar focus font style
 void setUnfocusFontStyle(FontStyle unfocusStyle)
          set the toolbar unfocus font style
protected  void sublayout(int maxWidth, int maxHeight)
          (non-Javadoc)
 
Methods inherited from class net.rim.device.api.ui.container.VerticalFieldManager
getFieldAtLocation, getPreferredHeight, subpaint
 
Methods inherited from class net.rim.device.api.ui.Manager
add, clearCustomScrollArrows, delete, deleteAll, deleteRange, getAccessibleContext, getField, 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, paintChild, replace, setDirty, setFocus, setHorizontalQuantization, setHorizontalScroll, setNonfocusableOverride, setPositionChild, setScrollListener, setVerticalQuantization, setVerticalScroll, setVirtualExtent, touchEvent, trackwheelClick, trackwheelUnclick
 
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, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getScreen, getState, getStyle, getTop, getVisualState, getWidth, invalidateAll, isEditable, isFocus, isPasteable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, 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
 

Field Detail

_customEventsHandler

protected CustomEventsHandler _customEventsHandler

_controlID

protected int _controlID

_orientation

protected int _orientation
Constructor Detail

ToolbarManager

public ToolbarManager()
Method Detail

addToolbarItem

public void addToolbarItem(ToolbarItem item)
Add ToolbarItem object to this ToolbarManager

Parameters:
item -

removeToobarItem

public void removeToobarItem(ToolbarItem item)
Remove ToolbarItem object from this ToolbarManager

Parameters:
item -

addTop

public void addTop(net.rim.device.api.ui.Field field)
Add field on the top of toolbar items

Parameters:
field -

removeTop

public void removeTop()
Remove top field


sublayout

protected void sublayout(int maxWidth,
                         int maxHeight)
(non-Javadoc)

Overrides:
sublayout in class net.rim.device.api.ui.container.VerticalFieldManager
See Also:
VerticalFieldManager.sublayout(int maxWidth, int maxHeight)

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.Manager
See Also:
Field.paint(Graphics g)

getPreferredWidth

public int getPreferredWidth()
Overrides:
getPreferredWidth in class net.rim.device.api.ui.container.VerticalFieldManager

getFocusFontStyle

public FontStyle getFocusFontStyle()
Returns:
the toolbar focus font style

setFocusFontStyle

public void setFocusFontStyle(FontStyle focusStyle)
set the toolbar focus font style

Parameters:
focusStyle -

getUnfocusFontStyle

public FontStyle getUnfocusFontStyle()
Returns:
the toolbar unfocus font style

setUnfocusFontStyle

public void setUnfocusFontStyle(FontStyle unfocusStyle)
set the toolbar unfocus font style

Parameters:
unfocusStyle -

setBorderStyle

public void setBorderStyle(FontStyle borderStyle)
set the toolbar border font style

Parameters:
borderStyle -

getBorderStyle

public FontStyle getBorderStyle()
Returns:
the toolbar border font style

getItemCount

public int getItemCount()
Returns:
the amount of toolbar items

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