T
- the type of the action commandpublic abstract class AbstractApplicationContextSensitiveFXToggleAction<T> extends AbstractFXToggleAction implements ApplicationContextSensitive, AutoCloseable
ApplicationContextSensitive
FXToggleAction
s.selected
accelerator, displayName, enabled, graphicFactory
accelerator, displayName, enabled, graphicFactory
Constructor and Description |
---|
AbstractApplicationContextSensitiveFXToggleAction(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.
|
handle, isSelected, selectedProperty, setSelected
acceleratorProperty, displayNameProperty, enabledProperty, getAccelerator, getDisplayName, getGraphicFactory, graphicFactoryProperty, isEnabled, setAccelerator, setDisplayName, setEnabled, setGraphicFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acceleratorProperty, displayNameProperty, enabledProperty, getAccelerator, getDisplayName, getGraphicFactory, graphicFactoryProperty, isEnabled, setAccelerator, setDisplayName, setGraphicFactory
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.