T
- the type of the action commandE
- the type of the action eventpublic abstract class AbstractActiveContextSensitiveToggleActionListener<T,E> extends AbstractToggleActionListener<E> implements ActiveContextSensitive, AutoCloseable
ActiveContextSensitive
ToggleActionListener
s.Constructor and Description |
---|
AbstractActiveContextSensitiveToggleActionListener(Class<T> type)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract void |
contextChanged(ContextEvent<T> event)
The callback method which gets called when the content for the action
command type in the active context changes.
|
Context |
getActiveContext()
Gets the active context.
|
Class<T> |
getType()
Gets the type of the action command
|
void |
setActiveContext(Context activeContext)
Sets the active context.
|
isSelected, onAction, setSelected
addPropertyChangeListener, getPropertyChangeSupport, isEnabled, removePropertyChangeListener, setEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onSelectionChanged
isEnabled
public void setActiveContext(Context activeContext)
setActiveContext
in interface ActiveContextSensitive
activeContext
- the active contextprotected abstract void contextChanged(ContextEvent<T> event)
T myActionCommand = getActiveContext().find(contextEvent.getType());
event
- the context eventpublic void close()
close
in interface AutoCloseable
public Context getActiveContext()
ActiveContextSensitive
Copyright © 2012–2018 Drombler. All rights reserved.