com.swfm.mica.widgets
Class MiToolBar
java.lang.Object
com.swfm.mica.core.MiPart
com.swfm.mica.core.MiContainer
com.swfm.mica.layouts.MiLayout
com.swfm.mica.core.MiVisibleContainer
com.swfm.mica.widgets.MiWidget
com.swfm.mica.widgets.MiToolBar
- All Implemented Interfaces:
- MiiActionTypes, MiiAttributeTypes, MiiCommandHandler, MiiCommandNames, MiiCopyable, MiiDragAndDropParticipant, MiiEventTypes, MiiGeneralCommandWidgetSpecificationProperties, MiiLayout, MiiNames, MiiOrientablePart, MiiPropertyTypes, MiiTypes
- Direct Known Subclasses:
- MiDrawingAttributesToolBar, MiDrawingConnectionToolBar, MiDrawingShapeToolBar, MiDrawingVisibilityToolBar, MiEditorToolBar
- public class MiToolBar
- extends MiWidget
- implements MiiOrientablePart, MiiCommandHandler, MiiCommandNames, MiiGeneralCommandWidgetSpecificationProperties
- Version:
- %I% %G%
- Author:
- Michael L. Davis
|
Constructor Summary |
MiToolBar(MiiCommandManager manager)
Constructs a new MiToolBar which will be the target of
the functionality added to this toolbar. |
MiToolBar(java.lang.Object targetOfTargettableToolItems,
MiiCommandManager manager)
Constructs a new MiToolBar which will be the target of
the functionality added to this toolbar. |
|
Method Summary |
MiWidget |
appendBooleanToolItem(java.lang.String toolHint,
MiPart image,
MiiCommandHandler commandHandler,
java.lang.String onCommand,
java.lang.String offCommand)
Appends a toggleButton with the given image to this toolbar,
assigning it the given tool hint message and having it
call the given commandHandler with the given commands when
the button is toggled on and off by the user. |
void |
appendSpacer()
Appends a space (i.e. |
MiWidget |
appendToolItem(java.lang.String toolHint,
MiPart image,
MiiCommandHandler commandHandler,
java.lang.String command)
Appends a pushButton with the given image to this toolbar,
assigning it the given tool hint message and having it
call the given commandHandler with the given command when
the button is pressed by the user. |
MiWidget |
appendToolItem(java.lang.String toolHint,
MiWidget tool,
MiiCommandHandler commandHandler,
java.lang.String command)
Appends the given widget to this toolbar, assigning it
the given tool hint message and having it call the
given commandHandler with the given command when the
button is pressed by the user. |
void |
copy(MiPart source)
Copy the state of this MiPart into the target MiPart. |
void |
cycleOrientation()
Changes to the next supported orientation. |
void |
endRadioButtonSection()
Specifies that any tool items added are no longer to
be considered radio buttons. |
int |
getButtonStyle()
Gets the style of the tool item buttons. |
MiiCommandManager |
getCommandManager()
Gets the manager for all of the widget/command pairs of
the tool items. |
java.lang.String |
getCommandOfToolItem(MiWidget toolItem)
Gets the command of the given tool item. |
int |
getIndexOfToolItemWithCommand(java.lang.String command)
Gets the tool item that generates the given command. |
int |
getOrientation()
Gets the orientation of this toolbar (valid values are
Mi_HORIZONTAL and Mi_VERTICAL). |
MiPropertyDescriptions |
getPropertyDescriptions()
Gets the descriptions of all of the properties. |
java.lang.String |
getPropertyValue(java.lang.String name)
Gets the textual value of the property with the given
name. |
MiRadioStateEnforcer |
getRadioStateEnforcer(java.lang.String id)
|
java.lang.Object |
getTargetOfTargetableToolItems()
Gets the target to be targeted by the functionality
of the tool items in this toolbar. |
MiWidget |
getToolItemWithCommand(java.lang.String command)
Gets the tool item that generates the given command. |
MiWidget |
insertToolItem(java.lang.String toolHint,
MiPart image,
MiiCommandHandler commandHandler,
java.lang.String command,
int index)
Inserts a pushButton with the given image to this toolbar,
assigning it the given tool hint message and having it
call the given commandHandler with the given command when
the button is pressed by the user. |
boolean |
isOrientationFixed()
Gets whether the orientation is constant and can not be
changed from it's current state. |
boolean |
isSpacer(MiPart toolItem)
Gets whether the given item is a 'spacer'. |
MiWidget |
makeItem(MiiPropertyBundle spec)
|
MiPart |
makeSpacer()
|
void |
processCommand(java.lang.String command)
Process the given command. |
void |
removeAllToolItemsWithCommandsExcept(Strings commandsToKeep)
Removes all tool items that do not generate one of the
given commands. |
void |
removeToolItem(java.lang.String command)
Removes all tool items that generate the given command. |
void |
setButtonStyle(int style)
Sets the style of the tool item buttons. |
void |
setHelpMessages(java.lang.String command,
java.lang.String availableStatusHelpMsg,
java.lang.String unAvailableStatusHelpMsg,
java.lang.String balloonHelpMsg)
Sets the the status bar messages (for both the sensitive
and insensitive cases), and the balloon help message
for the tool item that generates the given command. |
void |
setOrientation(int orientation)
Sets the orientation of this toolbar (valid values are
Mi_HORIZONTAL and Mi_VERTICAL). |
void |
setOrientationFixed(boolean flag)
Sets whether the orientation is constant and can not be
changed from it's current state. |
void |
setPropertyValue(java.lang.String name,
java.lang.String value)
Sets the property with the given name to the given value. |
void |
setSpacerWidth(double width)
|
void |
setTargetOfTargetableToolItems(java.lang.Object target)
Sets the target, traditionally an editor, to be targeted by the functionality
of the tool items in this toolbar. |
void |
setToolItemImageSizes(MiSize size)
Sets the size of the tool items in the toolbar. |
void |
startRadioButtonSection()
Specifies that any tool items added are to be radio
buttons. |
void |
startRadioButtonSection(int minNumberSelected)
Specifies that any tool items added are to be radio
buttons. |
| Methods inherited from class com.swfm.mica.widgets.MiWidget |
doExport, getContents, getEnterKeyFocusAttributes, getEnterKeyFocusBackgroundColor, getEnterKeyFocusBorderLook, getEnterKeyFocusColor, getEnterKeyFocusStatusHelp, getInSensitiveAttributes, getInSensitiveBackgroundColor, getInSensitiveBorderLook, getInSensitiveColor, getInSensitiveStatusHelp, getKeyboardFocusAttributes, getKeyboardFocusBackgroundColor, getKeyboardFocusBorderLook, getKeyboardFocusColor, getKeyboardFocusStatusHelp, getMouseFocusAttributes, getMouseFocusBackgroundColor, getMouseFocusBorderLook, getMouseFocusColor, getMouseFocusStatusHelp, getNormalAttributes, getNormalBackgroundColor, getNormalBorderLook, getNormalColor, getNormalStatusHelp, getRadioStateEnforcer, getSelectedAttributes, getSelectedBackgroundColor, getSelectedBorderLook, getSelectedColor, getSelectedStatusHelp, getToolkit, getValue, getWidgetAttributes, isAutoAttributesEnabled, isDesignTime, select, setAttributes, setAutoAttributesEnabled, setContents, setCurrentBackgroundColor, setCurrentColor, setEnterKeyFocus, setEnterKeyFocusAttributes, setEnterKeyFocusBackgroundColor, setEnterKeyFocusBorderLook, setEnterKeyFocusColor, setEnterKeyFocusStatusHelpMessage, setInSensitiveAttributes, setInSensitiveBackgroundColor, setInSensitiveBorderLook, setInSensitiveColor, setInSensitiveStatusHelpMessage, setKeyboardFocus, setKeyboardFocusAttributes, setKeyboardFocusBackgroundColor, setKeyboardFocusBorderLook, setKeyboardFocusColor, setKeyboardFocusStatusHelpMessage, setMouseFocus, setMouseFocusAttributes, setMouseFocusBackgroundColor, setMouseFocusBorderLook, setMouseFocusColor, setMouseFocusStatusHelpMessage, setNormalAttributes, setNormalBackgroundColor, setNormalBorderLook, setNormalColor, setNormalStatusHelpMessage, setPropertyValues, setRadioStateEnforcer, setSelectedAttributes, setSelectedBackgroundColor, setSelectedBorderLook, setSelectedColor, setSelectedStatusHelpMessage, setSensitive, setValue, setWidgetAttributes, setWidgetAttributes |
| Methods inherited from class com.swfm.mica.core.MiVisibleContainer |
calcMinimumSize, calcPreferredSize, getContainerLayoutSpec, getDisplaysFocusBorder, getInnerBounds, getIntersectionWithLine, getOKToDrawOutsideInnerBounds, getShadowShape, getShape, getTotalMargins, getVisibleContainerAutomaticLayoutEnabled, invalidateArea, isShapeShrinkToFitEnabled, pick, setContainerLayoutSpec, setDisplaysFocusBorder, setMargins, setOKToDrawOutsideInnerBounds, setShape, setShape, setShapeShrinkToFitEnabled, setVisibleContainerAutomaticLayoutEnabled |
| Methods inherited from class com.swfm.mica.layouts.MiLayout |
determinesPreferredAndMinimumSizes, getAlleyHSpacing, getAlleyMargins, getAlleyVSpacing, getCellMargins, getCellMargins, getElementHJustification, getElementHSizing, getElementVJustification, getElementVSizing, getInsetMargins, getInsetMargins, getLastElementJustification, getTarget, getUniqueElementIndex, getUniqueElementSizing, isEnabled, isIndependantOfTargetPosition, isScalingOfPartsWhenBoundsChangesHandledDuringLayout, layoutParts, makeCopy, setAlleyHSpacing, setAlleySpacing, setAlleyVSpacing, setCellMargins, setCellMargins, setElementHJustification, setElementHSizing, setElementJustification, setElementSizing, setElementVJustification, setElementVSizing, setEnabled, setInsetMargins, setInsetMargins, setLastElementJustification, setScalingOfPartsWhenBoundsChangesHandledDuringLayout, setTarget, setUniqueElementIndex, setUniqueElementSizing, toString |
| Methods inherited from class com.swfm.mica.core.MiContainer |
appendPart, containsPart, deepCopy, doImport, getIndexOfPart, getKeepConnectionsBelowNodes, getNumberOfParts, getPart, getPart, getSupportedImportFormats, hasEventHandlers, hasValidCachedEventHandlerInfo, insertPart, invalidateCachedEventHandlerInfo, isContainerOf, isContainerOf, isContainerOfWithAttachments, pickDeepListContents, pickObject, removeAllParts, removePart, removePart, setKeepConnectionsBelowNodes, setPart, translate |
| Methods inherited from class com.swfm.mica.core.MiPart |
_reCalcBounds, _render, _replaceBounds, _setContainer, _setDrawManager, _setValidatingLayout, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendActionHandler, appendAttachment, appendAttachment, appendCommandHandler, appendCommandHandler, appendCommandHandler, appendConnection, appendContainer, appendEventHandler, appendItem, appendPoint, appendPoint, applyCustomLookAndFeel, containsItem, containsOpaqueRectangles, copy, deleteAllConnections, deleteAllParts, deleteSelf, dispatchAction, dispatchAction, dispatchAction, dispatchActionRequest, dispatchActionRequest, dispatchActionRequest, dispatchEvent, draw, drawNow, drawNow, flip, flip, freeAccessLock, get1DShapeStrokeBackgroundColor, get1DShapeStrokesFilled, getAccessLock, getActionHandler, getActionsGenerated, getActionsLocallyGenerated, getActionsRequestedFromParts, getAfterRenderer, getAlphaCompositeRenderMode, getAnnotationPointManager, getAssociatedParts, getAttachment, getAttachment, getAttachmentMargins, getAttachments, getAttributeLockMask, getAttributePublicMask, getAttributes, getAttributeValue, getBackgroundColor, getBackgroundImage, getBackgroundRenderer, getBackgroundTile, getBalloonHelp, getBeforeRenderer, getBlackColor, getBorderHiliteColor, getBorderHiliteWidth, getBorderLook, getBorderRenderer, getBounds, getBounds, getCenter, getCenter, getCenterOfRotation, getCenterX, getCenterY, getColor, getConnection, getConnectionPointManager, getContainer, getContainerRequestedActions, getContainingEditor, getContainingWindow, getContextCursor, getContextMenu, getContextMenu, getControlPointManager, getCustomLookAndFeels, getCustomLookAndFeels, getDarkColor, getDeepConnection, getDeepConnection, getDeepConnections, getDeeplyInvalidateAreas, getDefaultAttributes, getDialogHelp, getDoubleBuffer, getDragAndDropBehavior, getDrawBounds, getDrawManager, getEventHandler, getEventHandler, getEventHandlerWithClass, getEventHandlingDisabledByContainer, getEventHandlingEnabled, getFlipped, getFont, getFontHorizontalJustification, getFontPointSize, getFontVerticalJustification, getHasBorderHilite, getHasShadow, getHeight, getID, getIncomingInvalidLayoutNotificationsEnabled, getIndexOfItem, getInnerBounds, getInvalidAreaNotificationsEnabled, getInvalidLayoutNotificationsEnabled, getItem, getItem, getKeyFocusTraversalGroup, getLayout, getLayoutManipulator, getLightColor, getLineEndSize, getLineEndsRenderer, getLineEndsSizeFnOfLineWidth, getLineEndStyle, getLineStartSize, getLineStartStyle, getLineStyle, getLineWidth, getLocallyRequestedEventTypes, getManipulator, getMargins, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumPickAreaSize, getMinimumSize, getMinimumWidth, getName, getNumberOfActionHandlers, getNumberOfAttachments, getNumberOfConnections, getNumberOfContainers, getNumberOfDeepConnections, getNumberOfEventHandlers, getNumberOfItems, getNumberOfPoints, getNumberOfResources, getOutgoingInvalidLayoutNotificationsEnabled, getPoint, getPoint, getPointEntryAngle, getPointExitAngle, getPointX, getPointY, getPreferredSize, getPrototypeManipulator, getRelativeLocation, getResource, getResourceName, getRootWindow, getRotation, getSelectionGraphics, getShadowColor, getShadowDirection, getShadowLength, getShadowRenderer, getShadowStyle, getSize, getSnapPointManager, getStatusHelp, getSupportedExportFormats, getThisOrPartHasInvalidArea, getToolHintHelp, getTotalNumberOfPartsCreated, getTransform, getTransparency, getValidatingLayout, getVisibilityAnimator, getWhiteColor, getWidth, getWriteMode, getXmax, getXmin, getXorColor, getYmax, getYmin, hasAttachment, hasAttribute, hasEnterKeyFocus, hasEventHandler, hasFixedAspectRatio, hasFixedHeight, hasFixedWidth, hasKeyboardFocus, hasMouseFocus, hasOverriddenMinimumSize, hasOverriddenPreferredSize, hasProperty, hasTotallyInvalidArea, hasValidLayout, insertActionHandler, insertActionHandler, insertActionHandler, insertConnection, insertContainer, insertEventHandler, insertItem, insertPoint, insertPoint, invalidateArea, invalidateLayout, isAcceptingEnterKeyFocus, isAcceptingKeyboardFocus, isAcceptingMouseFocus, isAcceptingTabKeys, isActionDispatchingEnabled, isConnectable, isConnectedTo, isCopyable, isCopyableAsPartOfCopyable, isDeletable, isDoubleBuffered, isDragAndDropSource, isDragAndDropTarget, isFilled, isFontBold, isFontItalic, isFontUnderlined, isHidden, isMovable, isOpaqueRectangle, isPickable, isPickableWhenTransparent, isPrintable, isSavable, isSelectable, isSelected, isSensitive, isShowing, isSnappable, isUngroupable, isValidConnectionDestination, isValidConnectionSource, isVisible, makeImageFromArea, makeLayoutManipulator, makeManipulator, optimizedInvalidateArea, optimizedInvalidateDrawBoundsArea, overrideAttributes, overrideEventHandlingDisabledByContainer, packLayout, pickDeepList, preRenderToDoubleBuffer, refreshBounds, refreshLookAndFeel, refreshLookAndFeel, removeActionHandler, removeActionHandler, removeActionHandlers, removeAllActionHandlers, removeAllAttachments, removeAllConnections, removeAllEventHandlers, removeAllItems, removeAllManipulators, removeAttachment, removeAttachment, removeCommandHandler, removeCommandHandler, removeConnection, removeConnection, removeContainer, removeContainer, removeEventHandler, removeFromAllContainers, removeItem, removeItem, removePoint, removeResource, removeSelf, replaceDrawBounds, replaceSelf, requestEnterKeyFocus, requestKeyboardFocus, rotate, rotate, rotateTo, scale, scale, scale, set1DShapeStrokeBackgroundColor, set1DShapeStrokesFilled, setAcceptingEnterKeyFocus, setAcceptingKeyboardFocus, setAcceptingMouseFocus, setAcceptingTabKeys, setActionDispatchingEnabled, setAfterRenderer, setAlphaCompositeRenderMode, setAnnotationPointManager, setAttachmentDrawnAfter, setAttachmentMargins, setAttachmentsVisibility, setAttributeLockMask, setAttributePublicMask, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setAttributeValue, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundRenderer, setBackgroundTile, setBalloonHelp, setBalloonHelpMessage, setBeforeRenderer, setBlackColor, setBorderHiliteColor, setBorderHiliteWidth, setBorderLook, setBorderRenderer, setBounds, setBounds, setCenter, setCenter, setCenterX, setCenterY, setColor, setColor, setConnectable, setConnectionPointManager, setContextCursor, setContextMenu, setControlPointManager, setCopyable, setCopyableAsPartOfCopyable, setCustomLookAndFeels, setCustomLookAndFeels, setDarkColor, setDeeplyInvalidateAreas, setDefaultAttributes, setDeletable, setDialogHelp, setDialogHelpMessage, setDoubleBuffer, setDoubleBuffered, setDragAndDropBehavior, setEventHandlingEnabled, setFilled, setFixedAspectRatio, setFixedHeight, setFixedWidth, setFont, setFontBold, setFontHorizontalJustification, setFontItalic, setFontPointSize, setFontUnderlined, setFontVerticalJustification, setHasBorderHilite, setHasShadow, setHeight, setHidden, setIncomingInvalidLayoutNotificationsEnabled, setInvalidAreaNotificationsEnabled, setInvalidLayoutNotificationsEnabled, setIsDragAndDropSource, setIsDragAndDropTarget, setIsOpaqueRectangle, setItem, setKeyFocusTraversalGroup, setLayout, setLightColor, setLineEndSize, setLineEndSizeFnOfLineWidth, setLineEndsRenderer, setLineEndStyle, setLineStartSize, setLineStartStyle, setLineStyle, setLineWidth, setMaximumHeight, setMaximumWidth, setMinimumHeight, setMinimumPickAreaSize, setMinimumSize, setMinimumWidth, setMovable, setName, setNumberOfPoints, setOutgoingInvalidLayoutNotificationsEnabled, setPickable, setPickableWhenTransparent, setPoint, setPoint, setPreferredSize, setPrintable, setPrototypeManipulator, setResource, setSavable, setSelectable, setSelectionGraphics, setShadowColor, setShadowDirection, setShadowLength, setShadowRenderer, setShadowStyle, setSize, setSize, setSnappable, setSnapPointManager, setStatusHelp, setStatusHelpMessage, setSupportedImportFormats, setToolHintHelp, setToolHintMessage, setTransparency, setTransparency, setUngroupable, setVisibilityAnimator, setVisible, setWhiteColor, setWidth, setWriteMode, setXmax, setXmin, setXorColor, setYmax, setYmin, supportsImportOfSpecificInstance, translate, translate, translatePoint, validateLayout, validatePropertyValue, waitUntilRedrawn |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Mi_SHOW_BORDERS_COMMAND_NAME
public static final java.lang.String Mi_SHOW_BORDERS_COMMAND_NAME
- See Also:
- Constant Field Values
Mi_HIDE_BORDERS_COMMAND_NAME
public static final java.lang.String Mi_HIDE_BORDERS_COMMAND_NAME
- See Also:
- Constant Field Values
Mi_FOCUS_BORDERS_COMMAND_NAME
public static final java.lang.String Mi_FOCUS_BORDERS_COMMAND_NAME
- See Also:
- Constant Field Values
SPACER_NAME
public static final java.lang.String SPACER_NAME
- See Also:
- Constant Field Values
Mi_BUTTON_SELECTED_BACKGROUND_COLOR
public static final java.lang.String Mi_BUTTON_SELECTED_BACKGROUND_COLOR
- See Also:
- Constant Field Values
Mi_BORDERED_TOOLBAR_BUTTONS
public static final int Mi_BORDERED_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
Mi_FOCUS_BORDER_TOOLBAR_BUTTONS
public static final int Mi_FOCUS_BORDER_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
Mi_LABLED_TOOLBAR_BUTTONS
public static final int Mi_LABLED_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
Mi_FOCUS_SPECIAL_FOCUS_BORDER_TOOLBAR_BUTTONS
public static final int Mi_FOCUS_SPECIAL_FOCUS_BORDER_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
Mi_OLD_STYLE_TOOLBAR_BUTTONS
public static final int Mi_OLD_STYLE_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
Mi_NEW_STYLE_TOOLBAR_BUTTONS
public static final int Mi_NEW_STYLE_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
Mi_97_STYLE_TOOLBAR_BUTTONS
public static final int Mi_97_STYLE_TOOLBAR_BUTTONS
- See Also:
- Constant Field Values
MiToolBar
public MiToolBar(MiiCommandManager manager)
- Constructs a new MiToolBar which will be the target of
the functionality added to this toolbar.
- Parameters:
manager - the manager for all of the widget/command
pairs of the tool items- See Also:
#setEditor
MiToolBar
public MiToolBar(java.lang.Object targetOfTargettableToolItems,
MiiCommandManager manager)
- Constructs a new MiToolBar which will be the target of
the functionality added to this toolbar.
- Parameters:
targetOfTargettableToolItems - the target or nullmanager - the manager for all of the widget/command
pairs of the tool items- See Also:
#setEditor
getCommandManager
public MiiCommandManager getCommandManager()
- Gets the manager for all of the widget/command pairs of
the tool items. This is used to set state of the commands
(sensitivity, on/off, contents, etc..). This is usually
used when one does not know the window the toolbar is in
(which is typically the command manager).
- Returns:
- the manager
setOrientation
public void setOrientation(int orientation)
- Sets the orientation of this toolbar (valid values are
Mi_HORIZONTAL and Mi_VERTICAL).
- Specified by:
setOrientation in interface MiiOrientablePart
- Parameters:
orientation - the new orientation
isOrientationFixed
public boolean isOrientationFixed()
- Gets whether the orientation is constant and can not be
changed from it's current state.
- Specified by:
isOrientationFixed in interface MiiOrientablePart
- Returns:
- true if the orientation cannot be
changed.
setOrientationFixed
public void setOrientationFixed(boolean flag)
- Sets whether the orientation is constant and can not be
changed from it's current state.
- Parameters:
flag - true if the orientation cannot be
changed.
getOrientation
public int getOrientation()
- Gets the orientation of this toolbar (valid values are
Mi_HORIZONTAL and Mi_VERTICAL).
- Specified by:
getOrientation in interface MiiOrientablePart
- Returns:
- the current orientation
cycleOrientation
public void cycleOrientation()
- Changes to the next supported orientation.
- Specified by:
cycleOrientation in interface MiiOrientablePart
startRadioButtonSection
public void startRadioButtonSection()
- Specifies that any tool items added are to be radio
buttons. One and only one can be selected (set) at one
time.
startRadioButtonSection
public void startRadioButtonSection(int minNumberSelected)
- Specifies that any tool items added are to be radio
buttons. Only one can be selected (set) at one time.
- Parameters:
minNumberSelected - the number that must be
selected at all times
endRadioButtonSection
public void endRadioButtonSection()
- Specifies that any tool items added are no longer to
be considered radio buttons.
appendSpacer
public void appendSpacer()
- Appends a space (i.e. an empty area) to the right of the
existing tool items already in this toolbar.
makeSpacer
public MiPart makeSpacer()
setSpacerWidth
public void setSpacerWidth(double width)
appendToolItem
public MiWidget appendToolItem(java.lang.String toolHint,
MiPart image,
MiiCommandHandler commandHandler,
java.lang.String command)
- Appends a pushButton with the given image to this toolbar,
assigning it the given tool hint message and having it
call the given commandHandler with the given command when
the button is pressed by the user.
- Parameters:
toolHint - the toolHintimage - the appearancecommandHandler - the command handler to callcommand - the command to send
- Returns:
- the newly created tool item
insertToolItem
public MiWidget insertToolItem(java.lang.String toolHint,
MiPart image,
MiiCommandHandler commandHandler,
java.lang.String command,
int index)
- Inserts a pushButton with the given image to this toolbar,
assigning it the given tool hint message and having it
call the given commandHandler with the given command when
the button is pressed by the user.
- Parameters:
toolHint - the toolHintimage - the appearancecommandHandler - the command handler to callcommand - the command to sendindex - the index of the isertion point
- Returns:
- the newly created tool item
appendToolItem
public MiWidget appendToolItem(java.lang.String toolHint,
MiWidget tool,
MiiCommandHandler commandHandler,
java.lang.String command)
- Appends the given widget to this toolbar, assigning it
the given tool hint message and having it call the
given commandHandler with the given command when the
button is pressed by the user.
NOTE: previous versions did not assign the command to
this command handler here, letting the caller do it.
- Parameters:
toolHint - the toolHinttool - the tool itemcommandHandler - the command handler to callcommand - the command to send
- Returns:
- the newly created tool item
appendBooleanToolItem
public MiWidget appendBooleanToolItem(java.lang.String toolHint,
MiPart image,
MiiCommandHandler commandHandler,
java.lang.String onCommand,
java.lang.String offCommand)
- Appends a toggleButton with the given image to this toolbar,
assigning it the given tool hint message and having it
call the given commandHandler with the given commands when
the button is toggled on and off by the user.
- Parameters:
toolHint - the toolHintimage - the appearancecommandHandler - the command handler to callonCommand - the command to send when
'set'offCommand - the command to send when
not 'set'
- Returns:
- the newly created tool item
getRadioStateEnforcer
public MiRadioStateEnforcer getRadioStateEnforcer(java.lang.String id)
makeItem
public MiWidget makeItem(MiiPropertyBundle spec)
setToolItemImageSizes
public void setToolItemImageSizes(MiSize size)
- Sets the size of the tool items in the toolbar. Only sets
the size of the images in widgets that are instanceof MiLabel.
Assumes that the images are already loaded, otherwise the
size of the images will be changed by the image loader.
- Parameters:
size - the new size of the tool items
setButtonStyle
public void setButtonStyle(int style)
- Sets the style of the tool item buttons. The style is
a bit-masked integer that specifies a number of things
aboyt the tool items appearance. Valid bits are:
Mi_LABLED_TOOLBAR_BUTTONS
Mi_BORDERED_TOOLBAR_BUTTONS
Mi_FOCUS_BORDER_TOOLBAR_BUTTONS
Mi_FOCUS_SPECIAL_FOCUS_BORDER_TOOLBAR_BUTTONS
- Parameters:
style - the new style of the tool items
getButtonStyle
public int getButtonStyle()
- Gets the style of the tool item buttons.
- Returns:
- the style of the tool items
- See Also:
setButtonStyle(int)
getToolItemWithCommand
public MiWidget getToolItemWithCommand(java.lang.String command)
- Gets the tool item that generates the given command.
- Parameters:
command - the command
- Returns:
- the tool item
getIndexOfToolItemWithCommand
public int getIndexOfToolItemWithCommand(java.lang.String command)
- Gets the tool item that generates the given command.
- Parameters:
command - the command
- Returns:
- the tool item
getCommandOfToolItem
public java.lang.String getCommandOfToolItem(MiWidget toolItem)
- Gets the command of the given tool item.
- Parameters:
toolItem - the tool item
- Returns:
- the command
isSpacer
public boolean isSpacer(MiPart toolItem)
- Gets whether the given item is a 'spacer'.
- Parameters:
toolItem - an item in this toolbar
- Returns:
- true if a spacer
removeToolItem
public void removeToolItem(java.lang.String command)
- Removes all tool items that generate the given command.
- Parameters:
command - the command generated by the toolbar
item that we will remove
removeAllToolItemsWithCommandsExcept
public void removeAllToolItemsWithCommandsExcept(Strings commandsToKeep)
- Removes all tool items that do not generate one of the
given commands.
- Parameters:
commandsToKeep - the command generated by the toolbar
that we will keep
setHelpMessages
public void setHelpMessages(java.lang.String command,
java.lang.String availableStatusHelpMsg,
java.lang.String unAvailableStatusHelpMsg,
java.lang.String balloonHelpMsg)
- Sets the the status bar messages (for both the sensitive
and insensitive cases), and the balloon help message
for the tool item that generates the given command.
- Parameters:
command - the commandavailableStatusHelpMsg - the status bar message for the tool
item when it is sensitiveunAvailableStatusHelpMsg - the status bar message for the tool
item when it is insensitiveballoonHelpMsg - the balloon help message
setTargetOfTargetableToolItems
public void setTargetOfTargetableToolItems(java.lang.Object target)
- Sets the target, traditionally an editor, to be targeted by the functionality
of the tool items in this toolbar.
- Parameters:
target - the target of the tool items whose
command handlers implement MiiTargetableCommandHandlers
getTargetOfTargetableToolItems
public jav