T
- the type of the action commandpublic abstract class AbstractActiveContextSensitiveFXToggleAction<T> extends AbstractFXToggleAction implements ActiveContextSensitive, AutoCloseable
ActiveContextSensitive
FXToggleAction
s.selected
accelerator, displayName, enabled, graphicFactory
accelerator, displayName, enabled, graphicFactory
Constructor and Description |
---|
AbstractActiveContextSensitiveFXToggleAction(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.
|
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 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.