com.tensegrity.gui.swing.repository
Class ActionRepositoryItem

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLabel
                  extended bycom.tensegrity.gui.swing.repository.AbstractRepositoryItem
                      extended bycom.tensegrity.gui.swing.repository.ActionRepositoryItem
All Implemented Interfaces:
javax.accessibility.Accessible, Evaluable, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable, javax.swing.SwingConstants

public class ActionRepositoryItem
extends AbstractRepositoryItem
implements Evaluable

ActionRepositoryItem.java

Version:
$Id: ActionRepositoryItem.java,v 1.15 2005/11/22 17:02:59 BurkhardWick Exp $
Author:
Gilles Iachelini,BurkhardWick
See Also:
Serialized Form

Nested Class Summary
static class ActionRepositoryItem.ClickActionProvider
          ActionRepositoryItemClickActionProvider
 
Nested classes inherited from class javax.swing.JLabel
javax.swing.JLabel.AccessibleJLabel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JLabel
labelFor
 
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
ActionRepositoryItem(javax.swing.Action action)
          Constructor for ActionRepositoryItem.
ActionRepositoryItem(Icon icon, javax.swing.Action action)
          Constructor for ActionRepositoryItem.
ActionRepositoryItem(Icon icon, javax.swing.Action action, java.lang.String tooltip)
          Constructor for ActionRepositoryItem.
ActionRepositoryItem(java.lang.String iconpath, java.lang.Class resourceclass, javax.swing.Action action)
          Constructs an action repository item with special loading of the icon.
ActionRepositoryItem(java.lang.String iconpath, java.lang.Class resourceclass, javax.swing.Action action, java.lang.String tooltip)
          Constructs an action repository item with special loading of the icon.
 
Method Summary
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 ActionRepositoryItem.ClickActionProvider getClickActionProvider()
          Returns the clickActionProvider.
 void installEvList()
          Tells the component to setup its internal state.
 void invokeLeftClickAction(java.awt.event.MouseEvent e)
          Invokes the actionPerformed of the internal Action instance.
 void invokeRightClickAction(java.awt.event.MouseEvent e)
          Forwards to the invokeLeftClickAction, but can be overriden to implement context menus on repository items.
 boolean isEnabled()
           
 void performAction()
          Perform the registered action
 void setClickActionProvider(ActionRepositoryItem.ClickActionProvider clickActionProvider)
          Sets the value of clickActionProvider
 void setText(java.lang.String text)
          Overridden method change the tooltip controlled by an UIManager-instance.
 void setTooltipID(java.lang.String tooltipID)
          Sets the id of the tooltip text resource
 void setUIManager(UIManager uiManager)
          Sets the uimanager to use for the tooltip
 
Methods inherited from class com.tensegrity.gui.swing.repository.AbstractRepositoryItem
getDefaultBackground, getDefaultBorder, getDefaultInsets, getHighlightColor, getHoveredBorder, getHoveredInsets, getInsets, getInsets, getPressedBackground, getPressedColor, getUnpressedColor, isHighlighted, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, paintBorder, setDefaultBackground, setDefaultBorder, setDefaultInsets, setHighlightColor, setHighlighted, setHoveredBorder, setHoveredInsets, setPressedBackground
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, 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, paint, 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, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, inside, isBackgroundSet, isCursorSet, isDisplayable, 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
 

Constructor Detail

ActionRepositoryItem

public ActionRepositoryItem(java.lang.String iconpath,
                            java.lang.Class resourceclass,
                            javax.swing.Action action)
Constructs an action repository item with special loading of the icon.

Parameters:
iconpath - the path to the icon relative to the resourceclass.
resourceclass - specifies the base of the icon path.
action - the action to associate with the repositoryitem.

ActionRepositoryItem

public ActionRepositoryItem(java.lang.String iconpath,
                            java.lang.Class resourceclass,
                            javax.swing.Action action,
                            java.lang.String tooltip)
Constructs an action repository item with special loading of the icon.

Parameters:
iconpath - the path to the icon relative to the resourceclass.
resourceclass - specifies the base of the icon path.
action - the action to associate with the repositoryitem.
tooltip - the tooltip

ActionRepositoryItem

public ActionRepositoryItem(javax.swing.Action action)
Constructor for ActionRepositoryItem.

Parameters:
action - the action to associate with the icon.

ActionRepositoryItem

public ActionRepositoryItem(Icon icon,
                            javax.swing.Action action)
Constructor for ActionRepositoryItem.

Parameters:
icon - optional icon, may be null.
action - the action to execute on click.

ActionRepositoryItem

public ActionRepositoryItem(Icon icon,
                            javax.swing.Action action,
                            java.lang.String tooltip)
Constructor for ActionRepositoryItem.

Parameters:
icon - optional icon, may be null.
action - the action to execute on click.
tooltip - a tooltip String for the item.
Method Detail

performAction

public void performAction()
Perform the registered action


setUIManager

public void setUIManager(UIManager uiManager)
Sets the uimanager to use for the tooltip

Parameters:
uiManager - the uimanager to use for the tooltip

setTooltipID

public void setTooltipID(java.lang.String tooltipID)
Sets the id of the tooltip text resource

Parameters:
tooltipID - the id of the tooltip text resource

setText

public void setText(java.lang.String text)
Overridden method change the tooltip controlled by an UIManager-instance.

Parameters:
text - the new tooltip text.

invokeRightClickAction

public void invokeRightClickAction(java.awt.event.MouseEvent e)
Forwards to the invokeLeftClickAction, but can be overriden to implement context menus on repository items.

Parameters:
e - the MouseEvent.

invokeLeftClickAction

public void invokeLeftClickAction(java.awt.event.MouseEvent e)
Invokes the actionPerformed of the internal Action instance. NOTE: You may consider to use invokeLater here to allow Labels mousePressed to return *BEFORE* the actionPerformed has been processed.

Parameters:
e - the MouseEvent.

setClickActionProvider

public void setClickActionProvider(ActionRepositoryItem.ClickActionProvider clickActionProvider)
Sets the value of clickActionProvider

Parameters:
clickActionProvider - The new value to set.

getClickActionProvider

public ActionRepositoryItem.ClickActionProvider getClickActionProvider()
Returns the clickActionProvider.

Returns:
the clickActionProvider.

applyEvList

public void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable

installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable

isEnabled

public boolean isEnabled()


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.