net.rim.device.api.ui.toolbar
Class ToolbarSetManager

java.lang.Object
  extended by net.rim.device.api.ui.Field
      extended by net.rim.device.api.ui.ScrollView
          extended by net.rim.device.api.ui.Manager
              extended by net.rim.device.api.ui.toolbar.ToolbarSetManager
All Implemented Interfaces:
AdjustmentListener

public class ToolbarSetManager
extends Manager

A ToolbarSetManager is a collection of ToolbarButtonField objects. Like a ToolbarButtonField, a ToolbarSetManager has an ordinal and can be added to a ToolbarManager.

Treatment of Ordinals

The ToolbarSetManager is responsible for ensuring that sort order based on ordinals is correctly maintained. When inserting a ToolbarSetManager into a ToolbarManager, the ToolbarManager inserts the ToolbarSetManager as a whole entity based on the call of getOrdinal.

See Also:
ToolbarManager, ToolbarButtonField
Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class net.rim.device.api.ui.Manager
BOTTOMMOST, DOWNWARD, HORIZONTAL_SCROLL, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_MASK, HORIZONTAL_SCROLL_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_SCROLLBAR, VERTICAL_SCROLLBAR_MASK, VERTICAL_SCROLL_MASK
 
Fields inherited from class net.rim.device.api.ui.Field
ACTION_INVOKE, AXIS_HORIZONTAL, AXIS_SEQUENTIAL, AXIS_VERTICAL, 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
ToolbarSetManager()
          Creates an empty ToolbarSetManager with the default style 0L and ordinal of 0.
ToolbarSetManager(int ordinal)
          Creates an empty ToolbarSetManager with the default style 0L and a specified ordinal.
ToolbarSetManager(long style, int ordinal)
          Creates an empty ToolbarSetManager with the specified style and ordinal.
 
Method Summary
 void add(Field field)
          Adds a field to this manager based on the ordinal of the field.
 void addAll(Field[] fields)
          Adds mutiple fields to the ToolbarSetManager by calling add(Field) on each object in the specified array.
 void delete(Field field)
          Deletes the specified field from this manager.
 int getOrdinal()
          The ordinal of this ToolbarSetManager as specified on creation.
 int getPreferredWidth()
          Retrieves the sum of Field.getPreferredWidth() of all of the children of this manager.
 void insert(Field field, int index)
          This method is not supported by ToolbarSetManager.
 void insertAll(Field[] fields, int index)
          This method is not supported by ToolbarSetManager.
 void replace(Field oldField, Field newField)
          Replaces an existing field with a new field.
 void sublayout(int width, int height)
          The layout is done very similiarly to {@link ToolbarManager#sublayout).
 
Methods inherited from class net.rim.device.api.ui.Manager
cursorClick, cursorMovement, cursorUnclick, deleteAll, deleteRange, getAccessibleContext, getField, getFieldAtLocation, getFieldCount, getFieldWithFocus, getFieldWithFocusIndex, getFocusRect, getHorizontalScroll, getLeafFieldWithFocus, getPreferredHeightOfChild, getPreferredWidthOfChild, getVerticalScroll, getVirtualHeight, getVirtualWidth, invalidate, invalidate, invalidateFieldRange, invokeAction, isDataValid, isDirty, isDownArrowShown, isFocusable, isMuddy, isSelecting, isUpArrowShown, isValidLayout, keyChar, keyControl, keyDown, keyRepeat, keyStatus, keyUp, layout, layoutChild, makeMenu, moveFocus, moveFocus, navigationClick, navigationMovement, navigationUnclick, nextFocus, nextFocus, onFocus, onUnfocus, paint, paintChild, setDirty, setFocus, setHorizontalQuantization, setPositionChild, setScrollingInertial, setVerticalQuantization, setVirtualExtent, shouldCursorScroll, subpaint, touchEvent, trackwheelClick, trackwheelUnclick
 
Methods inherited from class net.rim.device.api.ui.ScrollView
configurationChanged, getHorizontalAdjustment, getVerticalAdjustment, getVisibleHeight, getVisibleWidth, onExposed, setCurrentLocation, setExtent, setHorizontalAdjustment, setHorizontalScroll, setHorizontalScroll, setScrollListener, setVerticalAdjustment, setVerticalScroll, setVerticalScroll, valueChanged, waitForScrolling
 
Methods inherited from class net.rim.device.api.ui.Field
drawFocus, drawHighlightRegion, fieldChangeNotify, focusAdd, focusRemove, getBackground, getBackground, getBorder, getBorder, getBorder, getChangeListener, getCommandItemProvider, getContentHeight, getContentLeft, getContentRect, getContentRect, getContentTop, getContentWidth, getContextMenu, getCookie, getExtent, getExtent, getFieldStyle, getFocusListener, getFont, getHeight, getIndex, getLeft, getManager, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getOriginal, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPreferredHeight, getScreen, getStyle, getTextFillColor, getTextStrokeColor, getTop, getVisualState, getWidth, invalidateAll, isEditable, isEnabled, isFocus, isLeftToRight, isPasteable, isScrollCopyable, isSelectable, isSelectionCopyable, isSelectionCutable, isSelectionDeleteable, isSpellCheckable, isStyle, isVisible, makeContextMenu, onDisplay, onMenuDismissed, onMenuDismissed, onObscured, onUndisplay, onVisibilityChange, paste, select, selectionCopy, selectionCut, selectionDelete, setBackground, setBackground, setBorder, setBorder, setBorder, setBorder, setChangeListener, setCommandItemProvider, setCookie, setEditable, setEnabled, 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
 



Constructor Detail

ToolbarSetManager

public ToolbarSetManager()
Creates an empty ToolbarSetManager with the default style 0L and ordinal of 0.

Since:
BlackBerry API 6.0.0

ToolbarSetManager

public ToolbarSetManager(int ordinal)
Creates an empty ToolbarSetManager with the default style 0L and a specified ordinal.

Parameters:
ordinal - The sort order of this field within a ToolbarManager.
Since:
BlackBerry API 6.0.0

ToolbarSetManager

public ToolbarSetManager(long style,
                         int ordinal)
Creates an empty ToolbarSetManager with the specified style and ordinal.

Supports USE_ALL_WIDTH.

Parameters:
ordinal - The sort order of this field within a ToolbarManager.
style - if USE_ALL_WIDTH is set, then each controlled field is provided with the available width during layout.
Since:
BlackBerry API 6.0.0


Method Detail

add

public void add(Field field)
Adds a field to this manager based on the ordinal of the field.

Overrides:
add in class Manager
Parameters:
field - A ToolbarButtonField to add.
Throws:
IllegalArgumentException - If field is not an instance of ToolbarButtonField.
See Also:
ToolbarManager.add(net.rim.device.api.ui.Field)
Since:
BlackBerry API 6.0.0

addAll

public void addAll(Field[] fields)
Adds mutiple fields to the ToolbarSetManager by calling add(Field) on each object in the specified array.

Overrides:
addAll in class Manager
Parameters:
fields - Array of Field objects to insert.
Throws:
IllegalArgumentException - If field is not an instance of ToolbarButtonField.
Since:
BlackBerry API 6.0.0

delete

public void delete(Field field)
Deletes the specified field from this manager.

Overrides:
delete in class Manager
Parameters:
field - A ToolbarButtonField to delete from this manager.
Throws:
IllegalArgumentException - If field is not an instance of ToolbarButtonField.
See Also:
ToolbarManager.delete(net.rim.device.api.ui.Field)
Since:
BlackBerry API 6.0.0

replace

public void replace(Field oldField,
                    Field newField)
Replaces an existing field with a new field.

Overrides:
replace in class Manager
Parameters:
oldField - A Field to replace that is an instance of ToolbarButtonField.
newField - The Field to replace oldField that is an instance of ToolbarButtonField.
Throws:
IllegalArgumentException - If oldField or newField is not an instance of ToolbarButtonField.
IllegalArgumentException - if oldField ordinal does not match newField ordinal.
See Also:
Manager.delete(Field), Manager.insert(Field, int), Field.getIndex(), Field.getManager(), Field.setFocus()
Since:
BlackBerry API 6.0.0

getOrdinal

public final int getOrdinal()
The ordinal of this ToolbarSetManager as specified on creation.

Returns:
The ordinal of this field.
Since:
BlackBerry API 6.0.0

getPreferredWidth

public int getPreferredWidth()
Retrieves the sum of Field.getPreferredWidth() of all of the children of this manager.

Overrides:
getPreferredWidth in class Field
Returns:
The preferred width for this manager.
See Also:
sublayout
Since:
BlackBerry API 6.0.0

insert

public void insert(Field field,
                   int index)
This method is not supported by ToolbarSetManager. Please use ToolbarSetManager.add(net.rim.device.api.ui.Field) to insert fields.

Overrides:
insert in class Manager
Parameters:
field - Field to insert.
index - Index to insert field at.
Throws:
UnsupportedOperationException - If this method is used.
Since:
BlackBerry API 6.0.0

insertAll

public void insertAll(Field[] fields,
                      int index)
This method is not supported by ToolbarSetManager. Please use ToolbarSetManager.addAll(net.rim.device.api.ui.Field[]) to insert fields.

Overrides:
insertAll in class Manager
Parameters:
field - Fields to insert.
index - Index at which to begin inserting.
Throws:
UnsupportedOperationException - If this method is used.
Since:
BlackBerry API 6.0.0

sublayout

public void sublayout(int width,
                      int height)
The layout is done very similiarly to {@link ToolbarManager#sublayout).

Specified by:
sublayout in class Manager
Parameters:
width - The width available for layout.
height - The height available for layout.
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal