站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

Toolbar (NetBeans Loaders API) - NetBeans API Javadoc 4.1.0

 

org.openide.awt
Class Toolbar

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JToolBar
                  extended byorg.openide.awt.Toolbar
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable, SwingConstants

public class Toolbar
extends JToolBar

Toolbar provides a component which is useful for displaying commonly used actions. It can be dragged inside its ToolbarPanel to customize its location.

See Also:
Serialized Form

Nested Class Summary
static class Toolbar.DnDEvent
          DnDEvent is Toolbar's drag and drop event.
static interface Toolbar.DnDListener
          DnDListener is Drag and Drop listener for Toolbar motion events.
 
Nested classes inherited from class javax.swing.JToolBar
JToolBar.AccessibleJToolBar, JToolBar.Separator
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int BASIC_HEIGHT
          Deprecated. Use getBasicHeight instead.
 
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
CENTER, EAST, HORIZONTAL, LEADING, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, SOUTH, SOUTH_EAST, SOUTH_WEST, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Toolbar()
          Create a new Toolbar with empty name.
Toolbar(String name)
          Create a new not floatable Toolbar with programmatic name.
Toolbar(String name, boolean f)
          Create a new Toolbar.
Toolbar(String name, String displayName)
          Create a new not floatable Toolbar with specified programmatic name and display name
Toolbar(String name, String displayName, boolean f)
          Create a new Toolbar.
 
Method Summary
protected  void addImpl(Component c, Object constraints, int idx)
          Overridden to set focusable to false for any AbstractButton subclasses which are added
 void addNotify()
           
protected  void fireDragToolbar(int dx, int dy, int type)
          Fire drag of Toolbar
protected  void fireDropToolbar(int dx, int dy, int type)
          Fire drop of Toolbar
static int getBasicHeight()
          Returns basic toolbar height according to preferred icons size.
 Component[] getComponents()
           
 String getDisplayName()
           
 Dimension getPreferredSize()
           
 String getUIClassID()
           
 void paint(Graphics g)
           
 void removeAll()
          Removes all ACTION components.
static int rowCount(int height)
          Compute with HEIGHT_TOLERANCE number of rows for specific toolbar height.
 void setDisplayName(String displayName)
          Sets new display name of this toolbar.
 void setDnDListener(Toolbar.DnDListener l)
          Set DnDListener to Toolbar.
 void setUI(ToolBarUI ui)
           
 void setVisible(boolean b)
           
 
Methods inherited from class javax.swing.JToolBar
add, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

BASIC_HEIGHT

public static final int BASIC_HEIGHT
Deprecated. Use getBasicHeight instead.

Basic toolbar height.

See Also:
Constant Field Values
Constructor Detail

Toolbar

public Toolbar()
Create a new Toolbar with empty name.


Toolbar

public Toolbar(String name)
Create a new not floatable Toolbar with programmatic name. Display name is set to be the same as name


Toolbar

public Toolbar(String name,
               String displayName)
Create a new not floatable Toolbar with specified programmatic name and display name


Toolbar

public Toolbar(String name,
               boolean f)
Create a new Toolbar.

Parameters:
name - a String containing the associated name
f - specified if Toolbar is floatable Display name of the toolbar is set equal to the name.

Toolbar

public Toolbar(String name,
               String displayName,
               boolean f)
Create a new Toolbar.

Parameters:
name - a String containing the associated name
f - specified if Toolbar is floatable
Method Detail

paint

public void paint(Graphics g)

addNotify

public void addNotify()

getComponents

public Component[] getComponents()

setVisible

public void setVisible(boolean b)

addImpl

protected void addImpl(Component c,
                       Object constraints,
                       int idx)
Overridden to set focusable to false for any AbstractButton subclasses which are added


getBasicHeight

public static int getBasicHeight()
Returns basic toolbar height according to preferred icons size. Used by toolbar layout manager.

Returns:
basic toolbar height
Since:
4.15

getUIClassID

public String getUIClassID()

getPreferredSize

public Dimension getPreferredSize()

removeAll

public void removeAll()
Removes all ACTION components.


rowCount

public static int rowCount(int height)
Compute with HEIGHT_TOLERANCE number of rows for specific toolbar height.

Parameters:
height - of some toolbar
Returns:
number of rows

setDnDListener

public void setDnDListener(Toolbar.DnDListener l)
Set DnDListener to Toolbar.

Parameters:
l - DndListener for toolbar

getDisplayName

public String getDisplayName()
Returns:
Display name of this toolbar. Display name is localizable, on the contrary to the programmatic name

setDisplayName

public void setDisplayName(String displayName)
Sets new display name of this toolbar. Display name is localizable, on the contrary to the programmatic name


fireDragToolbar

protected void fireDragToolbar(int dx,
                               int dy,
                               int type)
Fire drag of Toolbar

Parameters:
dx - distance of horizontal dragging
dy - distance of vertical dragging
type - type of toolbar dragging

fireDropToolbar

protected void fireDropToolbar(int dx,
                               int dy,
                               int type)
Fire drop of Toolbar

Parameters:
dx - distance of horizontal dropping
dy - distance of vertical dropping
type - type of toolbar dropping

setUI

public void setUI(ToolBarUI ui)

 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.