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