public class IlvToolBar extends JToolBar
JToolBar.AccessibleJToolBar, JToolBar.Separator
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static String |
AUTO_HIDE_PROPERTY
Bound property of the toolbar that specifies whether
the visibility of the toolbar should be automatically updated
when components are added or removed from the toolbar.
|
static String |
AUTO_RESIZE_PROPERTY
Bound property of the toolbar that specifies whether the bounds
of the toolbar should be automatically updated
when it is added or removed components.
|
static String |
DEFAULT_TOOLBAR_NAME
Default value of the
"name" attribute of the settings element
that provides the settings of the toolbar. |
static String |
HIDE_BUTTON_TEXT
Bound property of the toolbar that specifies that the text of buttons
of the toolbar should not be displayed.
|
static String |
SELECTED_BORDER_PROPERTY
Property that provides the border of a button when it is selected.
|
static String |
TOOLBAR_BUTTON_SETTINGS_TYPE
The type of the root settings element that provides the settings of
a button of a toolbar.
|
static String |
TOOLBAR_SETTINGS_TYPE
The type of the root settings element that provides the settings of
an
IlvToolBar instance. |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvToolBar()
Constructs a new toolbar; the orientation defaults to
HORIZONTAL . |
IlvToolBar(int orientation)
Creates a new toolbar with the specified
orientation . |
IlvToolBar(String name,
int orientation)
Creates a new toolbar with a specified
name and
orientation . |
Modifier and Type | Method and Description |
---|---|
static JButton |
AddActionButton(Action action,
Container container,
int index,
IlvApplication application)
Adds a new button to the specified container at the specified index.
|
protected void |
addImpl(Component component,
Object constraints,
int index)
If a
JButton is being added, it is set a mouse listener
that controls double-click events. |
static JSeparator |
AddSeparator(Container container,
int index)
Adds a new separator within the specified container.
|
IlvApplication |
getApplication()
Returns the application of the toolbar.
|
Insets |
getButtonInsets()
Gets the insets of a button created within this toolbar.
|
Border |
getDefaultButtonBorder()
Gets the border used for creating buttons inserted in this toolbar.
|
Dimension |
getDefaultIconButtonSize()
Gets the default size of buttons created in this toolbar and displays just
icons.
|
Dimension |
getDefaultSeparatorSize()
Gets the default size of separators created in this toolbar.
|
int |
getIconsSize()
Returns the size of icons of the toolbar.
|
IlvSettings |
getSettings()
Returns the settings that the toolbar used to read its content.
|
IlvSettingsElement |
getSettingsElement()
Returns the settings element that provides the settings for this
toolbar.
|
String |
getSettingsName()
Gets the name that identifies the bar within the settings.
|
IlvSettingsQuery |
getSettingsQuery()
Returns the query that selects the settings element that defines the
content of this toolbar.
|
Dimension |
getSize() |
String |
getUIClassID()
Returns the name of the L&F class that renders this component.
|
String |
getUndockedTitle()
Returns the undocked title of the toolbar.
|
boolean |
isAutoHide()
Determines whether the toolbar is automatically hidden
after it has been removed all its child components.
|
boolean |
isAutoResize()
Determines whether the bounds of the toolbar are automatically
updated after the toolbar is added or removed child components.
|
void |
setApplication(IlvApplication application)
Sets the application of the toolbar.
|
void |
setAutoHide(boolean autoHide)
Specifies whether the toolbar is automatically hidden
after it is removed all its child components.
|
void |
setAutoResize(boolean autoResize)
Specifies whether the bounds of toolbar should be
automatically updated
after the toolbar is added or removed child components.
|
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setBounds(Rectangle r) |
void |
setButtonInsets(Insets insets)
Sets default button insets.
|
static void |
SetButtonProperties(IlvToolBar toolbar,
AbstractButton button,
Action action)
Sets the default button properties, like the border defined for the
specified toolbar, to the specified
button . |
void |
setIconsSize(int iconsSize)
Sets the size of icons of the toolbar.
|
void |
setSettings(IlvSettings settings)
Sets the settings that the toolbar uses to read its content.
|
void |
setSettingsElement(IlvSettingsElement element)
Forces the settings of the toolbar to be read and written from the
specified settings element.
|
void |
setSettingsName(String name)
Sets the name that identifies the toolbar within the settings of the
toolbar, set by invoking the method
setSettings(ilog.views.appframe.settings.IlvSettings) |
void |
setSettingsQuery(IlvSettingsQuery query)
Sets the query that selects the settings element that defines the
content of this toolbar.
|
void |
setSize(Dimension d) |
void |
setSize(int width,
int height) |
void |
setUndockedTitle(String undockedTitle)
Sets the undocked title of the toolbar.
|
void |
setVisible(boolean aFlag)
Makes the component visible or invisible.
|
add, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final String DEFAULT_TOOLBAR_NAME
"name"
attribute of the settings element
that provides the settings of the toolbar.public static String HIDE_BUTTON_TEXT
public static final String TOOLBAR_SETTINGS_TYPE
IlvToolBar
instance.public static final String TOOLBAR_BUTTON_SETTINGS_TYPE
public static final String SELECTED_BORDER_PROPERTY
public static final String AUTO_RESIZE_PROPERTY
If the value of the property equals Boolean.TRUE
,
the size of the toolbar is automatically updated to take into account
components that are added or removed from the toolbar. This
mechanism is not activated while the toolbar is being initialized
from the settings.
If the value of the property does not equal
Boolean.TRUE
, the bounds of the toolbar remain
unchanged whenever components are added or removed.
By default, an IlvToolBar
is not automatically
resizable.
setAutoResize(boolean)
,
isAutoResize()
,
Constant Field Valuespublic static final String AUTO_HIDE_PROPERTY
If the value of the property equals Boolean.TRUE
,
the toolbar is automatically hidden if it does not contain
any child components. It is also automatically shown when new
components are added and that the bar was previously hidden by
this mechanism.
If the value of the property does not equal
Boolean.TRUE
, the visibility of the toolbar stays
unchanged whenever it becomes empty.
By default, the toolbar the automatic hiding property
of the toolbar is set to Boolean.TRUE
.
setAutoHide(boolean)
,
isAutoHide()
,
Constant Field Valuespublic IlvToolBar()
HORIZONTAL
.public IlvToolBar(int orientation)
orientation
.
The orientation
must be either HORIZONTAL
or VERTICAL
.orientation
- The desired orientation.public IlvToolBar(String name, int orientation)
name
and
orientation
.
If orientation
is an invalid value, an exception will
be thrown.name
- The name of the toolbar.orientation
- The initial orientation. It must be one of these
values:HORIZONTAL
VERTICAL
IllegalArgumentException
- if orientation is neither
HORIZONTAL
nor VERTICAL
public String getUIClassID()
getUIClassID
in class JToolBar
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public IlvApplication getApplication()
public void setApplication(IlvApplication application)
application
- The new application of the toolbar.getApplication()
public IlvSettings getSettings()
public void setSettings(IlvSettings settings)
settings
- The new settings of the toolbar.public String getSettingsName()
setSettingsName(java.lang.String)
, the name of the
default menu bar defined in the Application Framework settings
will be returned.public void setSettingsName(String name)
setSettings(ilog.views.appframe.settings.IlvSettings)
name
- The new settings name of the toolbar.public void setButtonInsets(Insets insets)
insets
- The new button insets.public Insets getButtonInsets()
public int getIconsSize()
public void setIconsSize(int iconsSize)
iconsSize
- the new size of icons of the toolbar.getIconsSize()
public String getUndockedTitle()
null
if none was specifiedpublic void setUndockedTitle(String undockedTitle)
public Border getDefaultButtonBorder()
public Dimension getDefaultIconButtonSize()
public Dimension getDefaultSeparatorSize()
public void setSettingsQuery(IlvSettingsQuery query)
query
- The settings query.getSettingsQuery()
public final IlvSettingsQuery getSettingsQuery()
setSettingsQuery(ilog.views.appframe.settings.IlvSettingsQuery)
or if no settings name has been defined
using the method setSettingsName(java.lang.String)
, this method will return
null
.setSettingsQuery(ilog.views.appframe.settings.IlvSettingsQuery)
public void setSettingsElement(IlvSettingsElement element)
getSettings()
with the query getSettingsQuery()
.element
- The settings element that provides the settings for the
toolbar.getSettingsElement()
public IlvSettingsElement getSettingsElement()
setSettingsElement(ilog.views.appframe.settings.IlvSettingsElement)
method, it will be returned. Otherwise,
the settings element is selected from the settings given by the
getSettings()
method with the query returned by
getSettingsQuery()
.null
if no settings
element could be found.setSettingsElement(ilog.views.appframe.settings.IlvSettingsElement)
,
getSettingsQuery()
public static JButton AddActionButton(Action action, Container container, int index, IlvApplication application)
action
- The action of the button to create.container
- The container to create the new button in.index
- The insertion index of the new component within its
parent container. If it is equal to -1
, the new component
will be added at the last position in the children of the container.application
- The application used for internationalization services.public static void SetButtonProperties(IlvToolBar toolbar, AbstractButton button, Action action)
button
.toolbar
- The toolbar providing the default button properties.
If null
, default static properties defined for the
IlvToolBar(java.lang.String, int)
class will be set to the button.button
- The button to set properties to.action
- The action of the buttonpublic static JSeparator AddSeparator(Container container, int index)
container
- The container to add a new separator to.index
- The insertion index of the newly created separator. If this
index is equal to -1
, the separator will be added after the last
component child of the container.protected void addImpl(Component component, Object constraints, int index)
JButton
is being added, it is set a mouse listener
that controls double-click events.public void setVisible(boolean aFlag)
JToolBar.setVisible
.setVisible
in class JComponent
aFlag
- true to make the component visible; false to
make it invisiblepublic void setAutoResize(boolean autoResize)
autoResize
- If true
, the
AUTO_RESIZE_PROPERTY
of the bar is set to
Boolean.TRUE
. Otherwise, the
AUTO_RESIZE_PROPERTY
is set to null
.isAutoResize()
,
AUTO_RESIZE_PROPERTY
public boolean isAutoResize()
true
if the AUTO_RESIZE_PROPERTY
of the toolbar equals Boolean.TRUE
. Otherwise,
this method returns false
.setAutoResize(boolean)
,
AUTO_RESIZE_PROPERTY
public void setAutoHide(boolean autoHide)
autoHide
- If true
, the
AUTO_HIDE_PROPERTY
of the bar is set to
Boolean.TRUE
. Otherwise, the
AUTO_HIDE_PROPERTY
is set to null
.isAutoHide()
,
AUTO_HIDE_PROPERTY
public boolean isAutoHide()
true
if the AUTO_HIDE_PROPERTY
of the toolbar equals Boolean.TRUE
. Otherwise,
this method returns false
.setAutoResize(boolean)
,
AUTO_HIDE_PROPERTY
public void setBounds(int x, int y, int width, int height)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.