Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.controls
Class Toolbar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JToolBar
                  extended by oracle.ide.controls.Toolbar
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants
Direct Known Subclasses:
CodeEditor.CEToolbar

public class Toolbar
extends javax.swing.JToolBar

The Toolbar class is a replacement for JToolBar specialized for use in the IDE.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JToolBar
javax.swing.JToolBar.AccessibleJToolBar, javax.swing.JToolBar.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Toolbar()
          Creates an empty toolbar.
 
Method Summary
 ToolButton add(ToggleAction action)
          Adds a new button to the toolbar.
 ActionMenuToolButton addActionMenuButton(javax.swing.Action action)
           
 java.awt.Component addComponent(java.awt.Component component, int index)
          Adds the specified component to this toolbar at the given position.
 void addFiller()
          Adds a small blank space filler to the toolbar.
protected  void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
           
 MenuToolButton addMenuButton(ToggleAction[] actions)
           
 void addNotify()
           
 RadioToolButton addRadioButton(ToggleAction action, javax.swing.ButtonGroup bgroup)
           
 void addSeparator()
          Adds a new separator to the toolbar.
 ToggleToolButton addToggleButton(ToggleAction action)
           
 void addToolbarFilter(ActionFilter actionFilter)
           
 void dispose()
          Sets the action of each AbstractButton contained within the toolbar to null to avoid memory leaks.
 void forcePrimaryViewToolbar(boolean primaryViewToolbar)
          Forces this toolbar to either use or not use the primary view toolbar visual style in theme mode.
 javax.swing.Action[] getActions()
           
protected  boolean isActionAccepted(javax.swing.Action action)
           
protected  boolean isActiveViewToolbar()
          Determines whether this toolbar is the active view toolbar.
 boolean isLabelVisible()
          Deprecated. No replacement.
 javax.swing.JToolBar.Separator newSeparator()
          Creates a new separator for use in the toolbar.
protected  void paintComponent(java.awt.Graphics g)
           
protected  void processMouseEvent(java.awt.event.MouseEvent e)
           
 void remove(java.awt.Component comp)
           
 void remove(int index)
           
 void removeAll()
           
 void removeNotify()
           
 void setLabelVisible(boolean labelVisible)
          Deprecated. Not recommended. Can be replaced with putClientProperty("hideActionText", Boolean) on individual toolbar buttons.
 void setPrimaryViewToolbar(boolean primaryViewToolbar)
          Sets whether this toolbar is the primary toolbar of a view.
 
Methods inherited from class javax.swing.JToolBar
add, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, 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, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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, setOpaque, 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, 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
 

Constructor Detail

Toolbar

public Toolbar()
Creates an empty toolbar.

Method Detail

forcePrimaryViewToolbar

public void forcePrimaryViewToolbar(boolean primaryViewToolbar)
Forces this toolbar to either use or not use the primary view toolbar visual style in theme mode. Normally, the IDE will determine whether a toolbar is the primary toolbar of a viwe automatically. If it is unable to detect this for a particular toolbar (or the default detection is wrong), you can call this method to force the visual style on or off.

Parameters:
primaryViewToolbar - if true, this toolbar will be rendered using themes if themes are switched on.
Since:
11.0

setPrimaryViewToolbar

public void setPrimaryViewToolbar(boolean primaryViewToolbar)
Sets whether this toolbar is the primary toolbar of a view. This switches on a visual style used only for primary view toolbars.

This method is normally called automatically by the IDE framework for toolbars that are installed into views. To programmatically force a toolbar to either use or not use the visual style, call the forcePrimaryViewToolbar( boolean ) method.

Parameters:
primaryViewToolbar - if true, this toolbar will act as if it is the primary toolbar in the view, ignoring the normal algorithm for detecting this automatically.
Since:
11.0

add

public final ToolButton add(ToggleAction action)
Adds a new button to the toolbar.

Parameters:
action - the action that gets executed when the button is clicked
Returns:
a newly created toolbar button

addToggleButton

public final ToggleToolButton addToggleButton(ToggleAction action)

addRadioButton

public final RadioToolButton addRadioButton(ToggleAction action,
                                            javax.swing.ButtonGroup bgroup)

addMenuButton

public final MenuToolButton addMenuButton(ToggleAction[] actions)

addActionMenuButton

public final ActionMenuToolButton addActionMenuButton(javax.swing.Action action)

newSeparator

public final javax.swing.JToolBar.Separator newSeparator()
Creates a new separator for use in the toolbar.


addSeparator

public final void addSeparator()
Adds a new separator to the toolbar.

Overrides:
addSeparator in class javax.swing.JToolBar

addFiller

public final void addFiller()
Adds a small blank space filler to the toolbar.


addComponent

public java.awt.Component addComponent(java.awt.Component component,
                                       int index)
Adds the specified component to this toolbar at the given position.

Parameters:
component - the component to be added
index - the position at which to insert the component, or -1 to insert the component at the end
Returns:
the parameter component

setLabelVisible

@Deprecated
public void setLabelVisible(boolean labelVisible)
Deprecated. Not recommended. Can be replaced with putClientProperty("hideActionText", Boolean) on individual toolbar buttons.


isLabelVisible

@Deprecated
public boolean isLabelVisible()
Deprecated. No replacement.


getActions

public javax.swing.Action[] getActions()

dispose

public void dispose()
Sets the action of each AbstractButton contained within the toolbar to null to avoid memory leaks.


remove

public void remove(java.awt.Component comp)
Overrides:
remove in class java.awt.Container

remove

public void remove(int index)
Overrides:
remove in class java.awt.Container

removeAll

public void removeAll()
Overrides:
removeAll in class java.awt.Container

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
Overrides:
addImpl in class javax.swing.JToolBar

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent e)
Overrides:
processMouseEvent in class javax.swing.JComponent

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

isActiveViewToolbar

protected boolean isActiveViewToolbar()
Determines whether this toolbar is the active view toolbar. The active view toolbar has a special visual style applied to it in theme mode.

This implementation checks the active view using IdeMainWindow.getLastActiveView(). If this toolbar instance is the toolbar of that view, then this method returns true.

Subclasses may want to override this to provide a custom implementation, particularly if the toolbar is not returned by the View.getToolbar() or Editor.getScrollableTopMargin() methods.

Returns:
true if this toolbar is a toolbar in the active view.
Since:
11.0

addNotify

public void addNotify()
Overrides:
addNotify in class javax.swing.JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class javax.swing.JComponent

addToolbarFilter

public void addToolbarFilter(ActionFilter actionFilter)

isActionAccepted

protected final boolean isActionAccepted(javax.swing.Action action)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.