Package com.luciad.lucy.gui
Interface ILcyCustomizableRepresentationAction
- All Superinterfaces:
ActionListener
,EventListener
,ILcdAction
,ILcdPropertyChangeSource
,Serializable
- All Known Implementing Classes:
TLcyInterruptTaskAction
Extension of ILcdAction
that allows to customize the component that represents it
(typically a JButton
). Implementations of ILcyActionBar
(e.g.
TLcyToolBar
) will call the customizeRepresentation
method to provide a
hook for the action to modify its component. One could for example want to add a
DropTargetListener
or a MouseListener
that listens for a double click
on the component. It is also possible to completely replace the component with a custom one.
General components don't always play nice when added to a Swing JToolBar, see also
TLcyAlwaysFitJToolBar.createToolBarPanel(java.awt.Component)
.
-
Field Summary
Fields inherited from interface com.luciad.gui.ILcdAction
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE
-
Method Summary
Modifier and TypeMethodDescriptioncustomizeRepresentation
(Component aDefaultComponent, ILcdAction aWrapperAction, ILcyActionBar aActionBar) Allows to customize or replace the default component that is used to represent thisILcdAction
(typically aJButton
).Methods inherited from interface java.awt.event.ActionListener
actionPerformed
Methods inherited from interface com.luciad.gui.ILcdAction
getValue, isEnabled, putValue, setEnabled
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Method Details
-
customizeRepresentation
Component customizeRepresentation(Component aDefaultComponent, ILcdAction aWrapperAction, ILcyActionBar aActionBar) Allows to customize or replace the default component that is used to represent this
ILcdAction
(typically aJButton
).- Parameters:
aDefaultComponent
- The component that normally represents this action.aWrapperAction
- In case this action is wrapped (for example when using (TLcyActionBarUtil
), this parameter is the wrapper action, if not, it is this action. This is useful to retrieve properties such as the name or the icon of the action which can be different for different wrapper instances. E.g., a tool bar might use a different icon as a menu bar. And if the action is customized for the tool bar, it might be required to retrieve the tool bar icon.aActionBar
- The action bar in which this action is going to be inserted, provided as contextual information.- Returns:
- A customized or new component to represent this action. The simplest (but not useful)
implementation of this method would be
return aDefaultComponent;
. - See Also:
-