T
- the type of the action commandE
- the type of the action eventpublic abstract class AbstractApplicationContextSensitiveToggleActionListener<T,E> extends AbstractToggleActionListener<E> implements ApplicationContextSensitive, AutoCloseable
ApplicationContextSensitive
ToggleActionListener
s.Constructor and Description |
---|
AbstractApplicationContextSensitiveToggleActionListener(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 application wide context changes.
|
Context |
getApplicationContext()
Gets the application wide context.
|
Class<T> |
getType()
Gets the type of the action command
|
void |
setApplicationContext(Context applicationContext)
Sets the application-wide context.
|
isSelected, onAction, setSelected
addPropertyChangeListener, getPropertyChangeSupport, isEnabled, removePropertyChangeListener, setEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onSelectionChanged
isEnabled
public void setApplicationContext(Context applicationContext)
setApplicationContext
in interface ApplicationContextSensitive
applicationContext
- the application-wide contextprotected abstract void contextChanged(ContextEvent<T> event)
Collection<? extends T> myActionCommands = getApplicationContext().findAll(event.getType());
event
- the context eventpublic void close()
close
in interface AutoCloseable
public Context getApplicationContext()
ApplicationContextSensitive
Copyright © 2012–2018 Drombler. All rights reserved.