public class XdevActionManager extends Object
ContextSensitiveAction
s of a XdevUI
. The
actions are registered automatically inside this manager.addContextSensitiveHandlerChangeListener(Class,
ContextSensitiveHandlerChangeListener)
,
XdevUI.getXdevActionManager()
Constructor and Description |
---|
XdevActionManager(XdevUI ui)
Creates a new action manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addContextSensitiveHandlerChangeListener(Class<? extends ContextSensitiveHandler> handlerType,
ContextSensitiveHandlerChangeListener listener)
Registeres a state change listener for a certain handler type.
|
static <T extends ContextSensitiveHandler,H extends Component & ContextSensitiveHandler> |
contextSensitiveHandlerChanged(Class<T> handlerType,
H handler)
Notifies all
ContextSensitiveHandlerChangeListener s that the
state of a certain handler has changed. |
<H extends ContextSensitiveHandler> |
fireContextSensitiveHandlerChanged(Class<H> handlerType,
H handler)
Notifies all
ContextSensitiveHandlerChangeListener s that the
state of a certain handler has changed. |
static XdevActionManager |
get(Component c)
Returns the action manager of the UI of the given component.
|
XdevUI |
getUI()
Returns the associated UI of this action manager.
|
void |
removeContextSensitiveHandlerChangeListener(Class<? extends ContextSensitiveHandler> handlerType,
ContextSensitiveHandlerChangeListener listener)
Removes the listener of a certain handler type.
|
public XdevActionManager(XdevUI ui)
XdevUI.getXdevActionManager()
.ui
- the associated UIpublic static XdevActionManager get(Component c)
c
- any component in the component hierarchypublic static <T extends ContextSensitiveHandler,H extends Component & ContextSensitiveHandler> void contextSensitiveHandlerChanged(Class<T> handlerType, H handler)
ContextSensitiveHandlerChangeListener
s that the
state of a certain handler has changed.
Convenience method for
XdevActionManager.get(component).fireContextSensitiveHandlerChanged(handlerType,handler);
handlerType
- handler
- public XdevUI getUI()
public void addContextSensitiveHandlerChangeListener(Class<? extends ContextSensitiveHandler> handlerType, ContextSensitiveHandlerChangeListener listener)
handlerType
- the handler type to register the listener forlistener
- the listener to addcontextSensitiveHandlerChanged(Class, Component)
public void removeContextSensitiveHandlerChangeListener(Class<? extends ContextSensitiveHandler> handlerType, ContextSensitiveHandlerChangeListener listener)
handlerType
- the handler type to remove the listener forlistener
- the listener to removepublic <H extends ContextSensitiveHandler> void fireContextSensitiveHandlerChanged(Class<H> handlerType, H handler)
ContextSensitiveHandlerChangeListener
s that the
state of a certain handler has changed.handlerType
- the specific handler typehandler
- the handler instance