public interface ILcyCustomizableRepresentationActiveSettable extends ILcyActiveSettable
Extension of ILcyActiveSettable
that allows to customize the component that
represents it (typically a JToggleButton
). Implementations of
ILcyActionBar
(e.g. TLcyToolBar
) will call the
customizeRepresentation
method to provide a hook for the active settable 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)
.
DEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE
Modifier and Type | Method and Description |
---|---|
Component |
customizeRepresentation(Component aDefaultComponent,
ILcyActiveSettable aWrapperActiveSettable,
ILcyActionBar aActionBar)
Allows to customize or replace the default component that is used to represent this
ILcyActiveSettable (typically a JToggleButton ). |
getValue, isActive, isEnabled, putValue, setActive, setEnabled
addPropertyChangeListener, removePropertyChangeListener
Component customizeRepresentation(Component aDefaultComponent, ILcyActiveSettable aWrapperActiveSettable, ILcyActionBar aActionBar)
ILcyActiveSettable
(typically a JToggleButton
).aDefaultComponent
- The component that normally represents this active settable.aWrapperActiveSettable
- In case this active settable is wrapped (for example when using
(TLcyActionBarUtil
), this parameter is
the wrapper active settable, if not, it is this active settable.
This is useful to retrieve properties such as the name or the
icon of the active settable 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 active settable is customized for the
tool bar, it might be required to retrieve the tool bar icon.aActionBar
- The action bar in which this active settable is going to be
inserted, provided as contextual information..return aDefaultComponent;
.TLcyAlwaysFitJToolBar.createToolBarPanel(java.awt.Component)