JIDE 3.5.15

com.jidesoft.action
Class DockableBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JMenuBar
                  extended by com.jidesoft.action.DockableBar
All Implemented Interfaces:
Dockable, Alignable, ImageObserver, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants
Direct Known Subclasses:
CommandBar

public abstract class DockableBar
extends JMenuBar
implements Dockable, SwingConstants, Alignable

DockableBar is the base component that works with DockableBarManager.

The DockableBar can be placed horizontally or vertically. If vertically, only child components that implemented Alignable and say it returns true in supportVerticalOrientation method will be placed on vertical DockableBar. By default, all components will be placed on horizontal DockableBar no matter it implements Alignable. But if a component implements Alignable and returns false in its supportHorizontalOrientation method, it will not be shown on horizontal DockableBar.

See Also:
Alignable, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JMenuBar
JMenuBar.AccessibleJMenuBar
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int _orientation
           
static String PROPERTY_ALLOWED_DOCK_SIDES
           
static String PROPERTY_AVAILABLE
          Bound property name for the events regarding the DockableBar availability.
static String PROPERTY_CHEVRON_ALWAYS_VISIBLE
           
static String PROPERTY_FLOATABLE
          Constrained property name indicating that the DockableBar is floatable.
static String PROPERTY_FLOATED
          Constrained property name indicating that the DockableBar is floated.
static String PROPERTY_HIDABLE
          Constrained property name indicating that the DockableBar can be hidden.
static String PROPERTY_HIDDEN
          Constrained property name indicating that the DockableBar is hidden.
static String PROPERTY_HORI_DOCKED
          Constrained property name indicating that the DockableBar is docked.
static String PROPERTY_INIT_INDEX
           
static String PROPERTY_INIT_MODE
           
static String PROPERTY_INIT_SIDE
           
static String PROPERTY_INIT_SUBINDEX
           
static String PROPERTY_KEY
          Constrained property name indicating that the key of the dockable bar.
static String PROPERTY_MENU_BAR
           
static String PROPERTY_PAINT_BACKGROUND
           
static String PROPERTY_REARRANGABLE
          Constrained property name indicating that the DockableBar is floatable.
static String PROPERTY_STRETCH
          Constrained property name indicating that the DockableBar is stretching.
static String PROPERTY_TITLE
          Constrained property name indicating that the key of the DockableBar.
static String PROPERTY_UNDOCKED_BOUNDS
           
static String PROPERTY_VERT_DOCKED
          Constrained property name indicating that the DockableBar is docked.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface com.jidesoft.swing.Alignable
PROPERTY_ORIENTATION
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DockableBar()
          Creates a DockableBar.
DockableBar(String key)
          Creates a DockableBar with a specified key.
DockableBar(String key, String title)
          Creates a DockableBar with a specified key and title.
 
Method Summary
 void addDockableBarListener(DockableBarListener l)
          Adds the specified listener to receive DockableBarEvent from this DockableBar.
protected  void addImpl(Component comp, Object constraints, int index)
           
 void adjustChildrenOrientation(int orientation)
           
protected  void checkOrientation(int orientation)
           
protected  void fireDockableBarEvent(int id)
          Fires a DockableBarEvent.
 int getAllowedDockSides()
          Gets the sides which the DockableBar can dock to.
 DockableBarContext getContext()
          Gets the context of DockableBar.
 DockableBarListener[] getDockableBarListeners()
          Returns an array of all the DockableBarListeners added to this DockableBar with addDockableBarListener.
 DockableBarManager getDockableBarManager()
          Gets the DockableBarManager.
 int getDockID()
          Get dock id.
 int getInitIndex()
          Gets the init index.
 int getInitMode()
          Gets initial state.
 int getInitSide()
          Gets the initial side.
 int getInitSubindex()
          Gets the init index.
 String getKey()
          Gets the key of DockableBar.
 int getOrientation()
          Returns the current orientation of the tool bar.
 String getTitle()
          Gets the title of DockableBar.
 Rectangle getUndockedBounds()
           
 boolean isAvailable()
          Checks if the DockableBar is available.
 boolean isChevronAlwaysVisible()
          Checks if the chevron is always visible.
 boolean isFloatable()
          Gets the floatable property.
 boolean isFloating()
          Checks if the DockableBar is floating.
 boolean isHidable()
          Gets the hidable property.
 boolean isHidden()
          Checks if the DockableBar is hidden.
 boolean isHoriDocked()
          Checks if the DockableBar is docked horizontally (on the north side or south side).
 boolean isMenuBar()
          Checks if the command bar is used as menu bar.
 boolean isPaintBackground()
          Checks if the background of command bar should be painted.
 boolean isRearrangable()
          Gets the rearrangeable property.
 boolean isStretch()
          Checks if the DockableBar is stretching.
 boolean isVertDocked()
          Checks if the DockableBar is docked vertically (on the east side or west side).
 void readElement(Element element)
           
 void removeDockableBarListener(DockableBarListener l)
          Removes the specified DockableBar listener so that it no longer receives DockableBarEvent from this DockableBar.
 void resetDockID()
          Resets dock id.
 void setAllowedDockSides(int allowedDockSides)
          Sets the sides which the DockableBar can dock to.
 void setAvailable(boolean avail)
          Sets true to make the DockableBar available.
 void setChevronAlwaysVisible(boolean chevronAlwaysVisible)
          Sets the flag if the chevron should always be visible even when there is no hidden component.
 void setContext(DockableBarContext context)
          Sets the context of DockableBar.
 void setDockableBarManager(DockableBarManager dockingManager)
          Sets the DockableBarManager.
 void setDockID(int id)
          Sets dock id.
 void setFloatable(boolean b)
          Sets the floatable property.
 void setFloating()
          Sets the DockableBar to floating state.
 void setHidable(boolean b)
          Sets the hidable property.
 void setHidden()
          Sets the DockableBar to hidden state.
 void setHoriDocked()
           
 void setInitIndex(int initIndex)
          Sets initial index.
 void setInitMode(int initMode)
          Sets the initial state.
 void setInitSide(int initSide)
          Sets the initial side.
 void setInitSubindex(int initSubindex)
          Sets initial index.
 void setKey(String key)
          Sets the key of DockableBar.
 void setLayout(LayoutManager mgr)
           
 void setMenuBar(boolean menuBar)
          If a CommandBar is used as menu bar, you should call this method and set the value to true.
 void setOpaque(boolean isOpaque)
          Overrides to call setPaintBackground(isOpaque).By default, paintBackground is true and opaque is false.
 void setOrientation(int orientation)
          Sets the orientation of the DockableBar.
 void setPaintBackground(boolean paintBackground)
          Sets if the background of command bar should be painted.
 void setRearrangable(boolean b)
          Sets the rearrangeable property.
 void setStretch(boolean stretch)
          Sets the stretch property to a new value.
 void setTitle(String title)
          Sets the title of DockableBar.
 void setUndockedBounds(Rectangle undockedBounds)
           
 void setVertDocked()
          Sets the DockableBar to vertically docked state.
 boolean supportHorizontalOrientation()
          Implementing method in Alignable.
 boolean supportVerticalOrientation()
          Implementing method in Alignable.
 
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_KEY

public static final String PROPERTY_KEY
Constrained property name indicating that the key of the dockable bar.

See Also:
Constant Field Values

PROPERTY_TITLE

public static final String PROPERTY_TITLE
Constrained property name indicating that the key of the DockableBar.

See Also:
Constant Field Values

PROPERTY_FLOATABLE

public static final String PROPERTY_FLOATABLE
Constrained property name indicating that the DockableBar is floatable.

See Also:
Constant Field Values

PROPERTY_REARRANGABLE

public static final String PROPERTY_REARRANGABLE
Constrained property name indicating that the DockableBar is floatable.

See Also:
Constant Field Values

PROPERTY_STRETCH

public static final String PROPERTY_STRETCH
Constrained property name indicating that the DockableBar is stretching.

See Also:
Constant Field Values

PROPERTY_HIDABLE

public static final String PROPERTY_HIDABLE
Constrained property name indicating that the DockableBar can be hidden.

See Also:
Constant Field Values

PROPERTY_HIDDEN

public static final String PROPERTY_HIDDEN
Constrained property name indicating that the DockableBar is hidden.

See Also:
Constant Field Values

PROPERTY_HORI_DOCKED

public static final String PROPERTY_HORI_DOCKED
Constrained property name indicating that the DockableBar is docked.

See Also:
Constant Field Values

PROPERTY_VERT_DOCKED

public static final String PROPERTY_VERT_DOCKED
Constrained property name indicating that the DockableBar is docked.

See Also:
Constant Field Values

PROPERTY_FLOATED

public static final String PROPERTY_FLOATED
Constrained property name indicating that the DockableBar is floated.

See Also:
Constant Field Values

PROPERTY_INIT_SIDE

public static final String PROPERTY_INIT_SIDE
See Also:
Constant Field Values

PROPERTY_INIT_MODE

public static final String PROPERTY_INIT_MODE
See Also:
Constant Field Values

PROPERTY_INIT_INDEX

public static final String PROPERTY_INIT_INDEX
See Also:
Constant Field Values

PROPERTY_INIT_SUBINDEX

public static final String PROPERTY_INIT_SUBINDEX
See Also:
Constant Field Values

PROPERTY_ALLOWED_DOCK_SIDES

public static final String PROPERTY_ALLOWED_DOCK_SIDES
See Also:
Constant Field Values

PROPERTY_UNDOCKED_BOUNDS

public static final String PROPERTY_UNDOCKED_BOUNDS
See Also:
Constant Field Values

_orientation

protected int _orientation

PROPERTY_CHEVRON_ALWAYS_VISIBLE

public static final String PROPERTY_CHEVRON_ALWAYS_VISIBLE
See Also:
Constant Field Values

PROPERTY_PAINT_BACKGROUND

public static final String PROPERTY_PAINT_BACKGROUND
See Also:
Constant Field Values

PROPERTY_MENU_BAR

public static final String PROPERTY_MENU_BAR
See Also:
Constant Field Values

PROPERTY_AVAILABLE

public static final String PROPERTY_AVAILABLE
Bound property name for the events regarding the DockableBar availability.

See Also:
Constant Field Values
Constructor Detail

DockableBar

public DockableBar()
Creates a DockableBar. Key can uniquely identify a DockableBar if it will be added to DockableBarManager. If you use this constructor, you should call setKey(String) to give it a unique key before adding to DockableBarManager.


DockableBar

public DockableBar(String key)
Creates a DockableBar with a specified key.

Parameters:
key - the key for the DockableBar. It is used to uniquely identify a DockableBar in DockableBarManager. If setTitle() is never called, key will be used as the title of DockableBar as well.

DockableBar

public DockableBar(String key,
                   String title)
Creates a DockableBar with a specified key and title.

Parameters:
key - the key for the DockableBar. It is used to uniquely identify a DockableBar in DockableBarManager.
title - the text will be shown on the title bar when the DockableBar is floating.
Method Detail

getContext

public DockableBarContext getContext()
Gets the context of DockableBar. The context contains a lot of information that user can set during initialization. One it has been set, it will be persisted when application closed and be reloaded when application restarted.

Returns:
the context.

setContext

public void setContext(DockableBarContext context)
Sets the context of DockableBar.

Parameters:
context - the new DockableBarContext

setKey

public void setKey(String key)
Sets the key of DockableBar. The key is used to uniquely identify DockableBars in DockableBarManager.

Parameters:
key - the key of DockableBar.

getKey

public String getKey()
Gets the key of DockableBar.

Returns:
the key of DockableBar.

setTitle

public void setTitle(String title)
Sets the title of DockableBar. The title is the text that will be shown on the title bar of DockableBar when it is floating.

Parameters:
title - the new title

getTitle

public String getTitle()
Gets the title of DockableBar.

Returns:
the title of DockableBar.

getDockableBarManager

public DockableBarManager getDockableBarManager()
Description copied from interface: Dockable
Gets the DockableBarManager.

Specified by:
getDockableBarManager in interface Dockable
Returns:
the DockableBarManager that manages this Dockable.

setDockableBarManager

public void setDockableBarManager(DockableBarManager dockingManager)
Description copied from interface: Dockable
Sets the DockableBarManager.

Specified by:
setDockableBarManager in interface Dockable
Parameters:
dockingManager - new DockableBarManager

isHidden

public boolean isHidden()
Checks if the DockableBar is hidden. The information is actually on the context. This method is equivalent to getContext().isHidden().

Returns:
true if the DockableBar is hidden. Otherwise, false.

setHidden

public void setHidden()
               throws PropertyVetoException
Sets the DockableBar to hidden state. Please note, this method simply made a state change and fire property change event. It won't hide the DockableBar. If you want to hide a DockableBar, you should call dockableBarManager.hideDockableBar().

Throws:
PropertyVetoException - of the property change is vetoed.

isFloating

public boolean isFloating()
Checks if the DockableBar is floating. The information is actually on the context. This method is equivalent to getContext().isFloating().

Returns:
true if the DockableBar is floating. Otherwise, false.

setFloating

public void setFloating()
                 throws PropertyVetoException
Sets the DockableBar to floating state. Please note, this method simply made a state change and fire property change event. It won't make the DockableBar floating. If you want to float a DockableBar, you should call dockableBarManager.floatDockableBar().

Throws:
PropertyVetoException - of the property change is vetoed.

isVertDocked

public boolean isVertDocked()
Checks if the DockableBar is docked vertically (on the east side or west side). The information is actually on the context. This method is equivalent to getContext().isVertDocked().

Returns:
true if the DockableBar is docked vertically. Otherwise, false.

setVertDocked

public void setVertDocked()
                   throws PropertyVetoException
Sets the DockableBar to vertically docked state. Please note, this method simply made a state change and fire property change event. It won't make the DockableBar docking. If you want to dock a DockableBar, you should call dockableBarManager.dockDockableBar().

Throws:
PropertyVetoException - of the property change is vetoed.

isHoriDocked

public boolean isHoriDocked()
Checks if the DockableBar is docked horizontally (on the north side or south side). The information is actually on the context. This method is equivalent to getContext().isVertDocked().

Returns:
true if the DockableBar is docked horizontally. Otherwise, false.

setHoriDocked

public void setHoriDocked()
                   throws PropertyVetoException
Throws:
PropertyVetoException

addDockableBarListener

public void addDockableBarListener(DockableBarListener l)
Adds the specified listener to receive DockableBarEvent from this DockableBar.

Parameters:
l - the DockableBarListener

removeDockableBarListener

public void removeDockableBarListener(DockableBarListener l)
Removes the specified DockableBar listener so that it no longer receives DockableBarEvent from this DockableBar.

Parameters:
l - the DockableBarListener

getDockableBarListeners

public DockableBarListener[] getDockableBarListeners()
Returns an array of all the DockableBarListeners added to this DockableBar with addDockableBarListener.

Returns:
all of the DockableBarListeners added or an empty array if no listeners have been added
Since:
1.4
See Also:
addDockableBarListener(com.jidesoft.action.event.DockableBarListener)

fireDockableBarEvent

protected void fireDockableBarEvent(int id)
Fires a DockableBarEvent.

Parameters:
id - the type of the event being fired; one of the following: If the event type is not one of the above, nothing happens.

getDockID

public int getDockID()
Get dock id.

Specified by:
getDockID in interface Dockable
Returns:
the an int id that unique identify the component.

setDockID

public void setDockID(int id)
Description copied from interface: Dockable
Sets dock id.

Specified by:
setDockID in interface Dockable
Parameters:
id - new id

resetDockID

public void resetDockID()
Description copied from interface: Dockable
Resets dock id. It basically get a new id and discard the old one.

Specified by:
resetDockID in interface Dockable

isFloatable

public boolean isFloatable()
Gets the floatable property.

Returns:
the value of the floatable property
See Also:
setFloatable(boolean)

setFloatable

public void setFloatable(boolean b)
Sets the floatable property.

Parameters:
b - if true, the command bar can be floated; false otherwise
See Also:
isFloatable()

isRearrangable

public boolean isRearrangable()
Gets the rearrangeable property.

Returns:
the value of the rearrangeable property
See Also:
setRearrangable(boolean)

setRearrangable

public void setRearrangable(boolean b)
Sets the rearrangeable property.

Parameters:
b - if true, the command bar can be floated; false otherwise
See Also:
isRearrangable()

isHidable

public boolean isHidable()
Gets the hidable property.

Returns:
the value of the hidable property
See Also:
setHidable(boolean)

setHidable

public void setHidable(boolean b)
Sets the hidable property.

Parameters:
b - if true, the tool bar can be hidden; false otherwise
See Also:
isHidable()

getUndockedBounds

public Rectangle getUndockedBounds()

setUndockedBounds

public void setUndockedBounds(Rectangle undockedBounds)

isStretch

public boolean isStretch()
Checks if the DockableBar is stretching. Stretch is true means it will occupy the whole row in DockableBarContainer and no other DockableBar can be at the same row.

Returns:
true if the DockableBar is stretching.

setStretch

public void setStretch(boolean stretch)
Sets the stretch property to a new value.

Parameters:
stretch - true or false.

getOrientation

public int getOrientation()
Returns the current orientation of the tool bar. The value is either HORIZONTAL or VERTICAL.

Specified by:
getOrientation in interface Alignable
Returns:
an integer representing the current orientation -- either HORIZONTAL or VERTICAL
See Also:
setOrientation(int)

setOrientation

public void setOrientation(int orientation)
Sets the orientation of the DockableBar. The orientation must have either the value HORIZONTAL or VERTICAL. If orientation is an invalid value, an exception will be thrown.

Specified by:
setOrientation in interface Alignable
Parameters:
orientation - the new orientation -- either HORIZONTAL or VERTICAL
Throws:
IllegalArgumentException - if orientation is neither HORIZONTAL nor VERTICAL
See Also:
getOrientation()

setLayout

public void setLayout(LayoutManager mgr)
Overrides:
setLayout in class Container

supportVerticalOrientation

public boolean supportVerticalOrientation()
Implementing method in Alignable.

Specified by:
supportVerticalOrientation in interface Alignable
Returns:
returns true by default since DockableBar should support vertical orientation.

supportHorizontalOrientation

public boolean supportHorizontalOrientation()
Implementing method in Alignable.

Specified by:
supportHorizontalOrientation in interface Alignable
Returns:
returns true by default since DockableBar should support horizontal orientation.

checkOrientation

protected void checkOrientation(int orientation)

getAllowedDockSides

public int getAllowedDockSides()
Gets the sides which the DockableBar can dock to. By default, the value is DockableBarContext.DOCK_SIDE_ALL meaning it can dock to all four sides.

Returns:
the sides which the DockableBar can dock to.

setAllowedDockSides

public void setAllowedDockSides(int allowedDockSides)
Sets the sides which the DockableBar can dock to.

Parameters:
allowedDockSides - true or false.

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
Overrides:
addImpl in class Container

getInitMode

public int getInitMode()
Gets initial state.

Returns:
initial state

setInitMode

public void setInitMode(int initMode)
Sets the initial state.

Parameters:
initMode -

getInitSide

public int getInitSide()
Gets the initial side.

Returns:
the initial side.

setInitSide

public void setInitSide(int initSide)
Sets the initial side.

Parameters:
initSide - the initial size such as DOCK_SIDE_NORTH, DOCK_SIDE_SOUTH, DOCK_SIDE_EAST and DOCK_SIDE_WEST as defined in DockableBarContext.

getInitIndex

public int getInitIndex()
Gets the init index.

Returns:
init index.

setInitIndex

public void setInitIndex(int initIndex)
Sets initial index. After setting initial side and mode, user can use this parameter to define initial position.

Parameters:
initIndex - the initial index

getInitSubindex

public int getInitSubindex()
Gets the init index.

Returns:
init index.

setInitSubindex

public void setInitSubindex(int initSubindex)
Sets initial index. After setting initial side and mode, user can use this parameter to define initial position.

Parameters:
initSubindex - the initial index

readElement

public void readElement(Element element)

adjustChildrenOrientation

public void adjustChildrenOrientation(int orientation)

isAvailable

public boolean isAvailable()
Checks if the DockableBar is available.

Returns:
true if it's available.

setAvailable

public void setAvailable(boolean avail)
Sets true to make the DockableBar available.

Parameters:
avail - true or false.

isChevronAlwaysVisible

public boolean isChevronAlwaysVisible()
Checks if the chevron is always visible. The chevron will be shown if there are hidden component. If there is no hidden component, by default we have UIDefault "Chevron.alwaysVisible" to control it. It is global setting per L&F. If the UIDefault is true, we will also look at return value from this method to decide if the chevron is visible. Only when both are true, we show the chevron when there is no hidden component.

Returns:
true or false.

setChevronAlwaysVisible

public void setChevronAlwaysVisible(boolean chevronAlwaysVisible)
Sets the flag if the chevron should always be visible even when there is no hidden component. It works with UIDefault "Chevron.alwaysVisible". Only when both the return value from this method and the UIDefault "Chevron.alwaysVisible" are true, we always show the chevron. The default return value of this method is true.

Parameters:
chevronAlwaysVisible - true or false.

isPaintBackground

public boolean isPaintBackground()
Checks if the background of command bar should be painted.

Returns:
true if the background should be painted.

setPaintBackground

public void setPaintBackground(boolean paintBackground)
Sets if the background of command bar should be painted.

Parameters:
paintBackground - true or false.

setOpaque

public void setOpaque(boolean isOpaque)
Overrides to call setPaintBackground(isOpaque).By default, paintBackground is true and opaque is false. User can call setPaintBackground to decide if the background should be painted. But if user calls setOpaque, we assume they want it still works as expected. That's why we change paintBackground to make it the same as opaque.

Overrides:
setOpaque in class JComponent
Parameters:
isOpaque - true or false.

isMenuBar

public boolean isMenuBar()
Checks if the command bar is used as menu bar.

Returns:
true if command bar is used as menu bar.

setMenuBar

public void setMenuBar(boolean menuBar)
If a CommandBar is used as menu bar, you should call this method and set the value to true.

Please note, if your application needs to run under Mac OS X, you should use CommandMenuBar instead of using CommandBar and setMenuBar(true). Using CommandMenuBar is the only way to support screen menu bar on Mac OS X.

Parameters:
menuBar - true or false.

JIDE 3.5.15