bibliothek.gui.dock.facile.menu
Class CloseableDockableMenuPiece.Item

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JMenuItem
                      extended by javax.swing.JCheckBoxMenuItem
                          extended by bibliothek.gui.dock.facile.menu.CloseableDockableMenuPiece.Item
All Implemented Interfaces:
DockableListener, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, MenuElement, SwingConstants
Enclosing class:
CloseableDockableMenuPiece

protected class CloseableDockableMenuPiece.Item
extends JCheckBoxMenuItem
implements DockableListener, ActionListener

An item showing the visibility state of one Dockable.

Author:
Benjamin Sigg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JCheckBoxMenuItem
JCheckBoxMenuItem.AccessibleJCheckBoxMenuItem
 
Nested classes/interfaces inherited from class javax.swing.JMenuItem
JMenuItem.AccessibleJMenuItem
 
Nested classes/interfaces inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
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.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
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
CloseableDockableMenuPiece.Item(Dockable dockable)
          Creates a new item.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void destroy()
          Removes all listeners, frees as many resources as possible
 void setDockableState(boolean visible)
          Sets whether the Dockable of this item is currently visible or not.
 void titleBound(Dockable dockable, DockTitle title)
          Will be invoked when a DockTitle was bound to a Dockable.
 void titleExchanged(Dockable dockable, DockTitle title)
          Invoked when the properties of a Dockable have a so dramatically changed, that the DockTitle title is no longer considered a good title and should be replaced.
 void titleIconChanged(Dockable dockable, Icon oldIcon, Icon newIcon)
          Invoked when the title-icon of a Dockable has changed
 void titleTextChanged(Dockable dockable, String oldTitle, String newTitle)
          Invoked when the title of a Dockable has changed.
 void titleToolTipChanged(Dockable dockable, String oldToolTip, String newToolTip)
          Called when the tooltip of a Dockable changed.
 void titleUnbound(Dockable dockable, DockTitle title)
          Will be invoked when a DockTitle was unbound from a Dockable.
 
Methods inherited from class javax.swing.JCheckBoxMenuItem
getAccessibleContext, getSelectedObjects, getState, getUIClassID, paramString, setState
 
Methods inherited from class javax.swing.JMenuItem
actionPropertyChanged, addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getComponent, getMenuDragMouseListeners, getMenuKeyListeners, getSubElements, init, isArmed, menuSelectionChanged, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setAccelerator, setArmed, setEnabled, setModel, setUI, updateUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
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, 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, processKeyBinding, 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, 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, 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, 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

CloseableDockableMenuPiece.Item

public CloseableDockableMenuPiece.Item(Dockable dockable)
Creates a new item.

Parameters:
dockable - the element that will be shown or hidden when the user clicks onto this item
Method Detail

setDockableState

public void setDockableState(boolean visible)
Sets whether the Dockable of this item is currently visible or not.

Parameters:
visible - the new state

destroy

public void destroy()
Removes all listeners, frees as many resources as possible


titleBound

public void titleBound(Dockable dockable,
                       DockTitle title)
Description copied from interface: DockableListener
Will be invoked when a DockTitle was bound to a Dockable.

Specified by:
titleBound in interface DockableListener
Parameters:
dockable - the Dockable whose title is set
title - the new title

titleIconChanged

public void titleIconChanged(Dockable dockable,
                             Icon oldIcon,
                             Icon newIcon)
Description copied from interface: DockableListener
Invoked when the title-icon of a Dockable has changed

Specified by:
titleIconChanged in interface DockableListener
Parameters:
dockable - the Dockable whose title is changed
oldIcon - the old icon, may be null
newIcon - the new icon, may be null

titleTextChanged

public void titleTextChanged(Dockable dockable,
                             String oldTitle,
                             String newTitle)
Description copied from interface: DockableListener
Invoked when the title of a Dockable has changed.

Specified by:
titleTextChanged in interface DockableListener
Parameters:
dockable - the Dockable whose title is changed
oldTitle - the title before the change
newTitle - the title after the change

titleToolTipChanged

public void titleToolTipChanged(Dockable dockable,
                                String oldToolTip,
                                String newToolTip)
Description copied from interface: DockableListener
Called when the tooltip of a Dockable changed.

Specified by:
titleToolTipChanged in interface DockableListener
Parameters:
dockable - the dockable whose tooltip changed
oldToolTip - the old value
newToolTip - the new value

titleUnbound

public void titleUnbound(Dockable dockable,
                         DockTitle title)
Description copied from interface: DockableListener
Will be invoked when a DockTitle was unbound from a Dockable.

Specified by:
titleUnbound in interface DockableListener
Parameters:
dockable - the Dockable whose title was removed
title - the remove title

titleExchanged

public void titleExchanged(Dockable dockable,
                           DockTitle title)
Description copied from interface: DockableListener
Invoked when the properties of a Dockable have a so dramatically changed, that the DockTitle title is no longer considered a good title and should be replaced. The one element which shows title should unbind it, and request a new title.

Specified by:
titleExchanged in interface DockableListener
Parameters:
dockable - the source of the event
title - the title that should be discarded, can be null to alert elements which do show the null-title

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener