JIDE 3.5.15

com.jidesoft.status
Class ButtonStatusBarItem

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jidesoft.swing.NullPanel
                      extended by com.jidesoft.status.StatusBarItem
                          extended by com.jidesoft.status.ButtonStatusBarItem
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ButtonStatusBarItem
extends StatusBarItem

A status bar item with a button.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ButtonStatusBarItem()
           
ButtonStatusBarItem(Action action)
          Creates a ButtonStatusBarItem with the Action set to the button.
ButtonStatusBarItem(String name)
          Creates a button status bar item with name.
 
Method Summary
 void addActionListener(ActionListener listener)
          Adds an ActionListener to the button.
protected  AbstractButton createButton()
          Creates button used by this ButtonStatusBarItem.
protected  void customizeButton(AbstractButton button)
          Customize the button.
 void doClick()
           
 void doClick(int pressTime)
           
 Component getComponent()
          Gets the actual component.
 int getHorizontalAlignment()
          Gets the text horizontal alignment.
 String getItemName()
          Gets item name.
<T extends EventListener>
T[]
getListeners(Class<T> listenerType)
           
 Dimension getPreferredSize()
          If the preferredSize has been set to a non-null value just returns it.
 String getToolTipText()
           
 void removeActionListener(ActionListener listener)
          Removes the ActionListener from the button.
 void setEnabled(boolean enabled)
          Enable or disable the StatusBar Item.
 void setHorizontalAlignment(int alignment)
          Sets the text horizontal alignment.
 void setIcon(Icon icon)
          Sets icon to be displayed on the button.
 void setText(String text)
          Sets text to be displayed on the button.
 void setToolTip(String tooltip)
          Sets tooltip to be displayed on the button.
 void setToolTipText(String text)
           
 void updateUI()
          Resets the UI property with a value from the current look and feel.
 
Methods inherited from class com.jidesoft.status.StatusBarItem
getPreferredWidth, setPreferredWidth
 
Methods inherited from class com.jidesoft.swing.NullPanel
setBackground, setFont, setForeground
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
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, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, setLayout, 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

ButtonStatusBarItem

public ButtonStatusBarItem()

ButtonStatusBarItem

public ButtonStatusBarItem(String name)
Creates a button status bar item with name.

Parameters:
name - name of the status bar item

ButtonStatusBarItem

public ButtonStatusBarItem(Action action)
Creates a ButtonStatusBarItem with the Action set to the button.

Parameters:
action - the action on the button.
Method Detail

customizeButton

protected void customizeButton(AbstractButton button)
Customize the button.

Parameters:
button - the button

setToolTipText

public void setToolTipText(String text)
Overrides:
setToolTipText in class JComponent

getToolTipText

public String getToolTipText()
Overrides:
getToolTipText in class JComponent

createButton

protected AbstractButton createButton()
Creates button used by this ButtonStatusBarItem.

Returns:
the button.

setText

public void setText(String text)
Sets text to be displayed on the button.

Parameters:
text - the new text on the button.

setToolTip

public void setToolTip(String tooltip)
Sets tooltip to be displayed on the button.

Parameters:
tooltip - the new tooltip on the button.

setIcon

public void setIcon(Icon icon)
Sets icon to be displayed on the button.

Parameters:
icon - the new icon on the button.

setEnabled

public void setEnabled(boolean enabled)
Enable or disable the StatusBar Item.

Overrides:
setEnabled in class JComponent
Parameters:
enabled - true to enable the button and false to disable it.

addActionListener

public void addActionListener(ActionListener listener)
Adds an ActionListener to the button.

Parameters:
listener - the ActionListener to be added

removeActionListener

public void removeActionListener(ActionListener listener)
Removes the ActionListener from the button.

Parameters:
listener - the ActionListener to be removed
Since:
3.2.0

getListeners

public <T extends EventListener> T[] getListeners(Class<T> listenerType)
Overrides:
getListeners in class JComponent

getComponent

public Component getComponent()
Gets the actual component. In this case it's a button.

Returns:
return the button.

getPreferredSize

public Dimension getPreferredSize()
If the preferredSize has been set to a non-null value just returns it. If the UI delegate's getPreferredSize method returns a non null value then return that; otherwise defer to the component's layout manager.

Overrides:
getPreferredSize in class StatusBarItem
Returns:
the value of the preferredSize property
See Also:
JComponent.setPreferredSize(java.awt.Dimension), ComponentUI

getItemName

public String getItemName()
Description copied from class: StatusBarItem
Gets item name.

Specified by:
getItemName in class StatusBarItem
Returns:
item name

updateUI

public void updateUI()
Description copied from class: StatusBarItem
Resets the UI property with a value from the current look and feel.

Overrides:
updateUI in class StatusBarItem
See Also:
JComponent.updateUI()

doClick

public void doClick()

doClick

public void doClick(int pressTime)

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Sets the text horizontal alignment. The valid values for alignment are defined in AbstractButton.setHorizontalAlignment(int).

Parameters:
alignment - the horizontal alignment of the button.
See Also:
getHorizontalAlignment()

getHorizontalAlignment

public int getHorizontalAlignment()
Gets the text horizontal alignment.

Returns:
alignment

JIDE 3.5.15