public class DeleteActionHandler extends Action
Action
to handle deletion of selection elements in an
FXViewer
IMPORTANT: Usually, an action handler will only be executed in case the
widget that currently has focus does not already consume the triggering key
event. However, in case of an FXCanvas
the triggering SWT key event
is never consumed, because it is forwarded to the embedded JavaFX
Scene
, while a consumption of the mapping JavaFX event is not
propagated back.
Additionally, the JavaFX event handler (i.e. the FXTypeTool
, in case
its registered at the FXDomain
) will be notified after the execution
of the action handler, because FXCanvasEx
wraps the event forwarding
in an Platform.runLater(Runnable)
call.
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
Constructor and Description |
---|
DeleteActionHandler()
Creates a new
DeleteActionHandler . |
Modifier and Type | Method and Description |
---|---|
void |
init(FXViewer viewer)
Binds this
DeleteActionHandler to the given viewer. |
void |
runWithEvent(Event event) |
protected void |
updateEnabledState(SelectionModel<javafx.scene.Node> selectionModel)
Updates the enabled state of this
Action dependent on the
selection state of the SelectionModel . |
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, run, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public DeleteActionHandler()
DeleteActionHandler
.public void init(FXViewer viewer)
DeleteActionHandler
to the given viewer.public void runWithEvent(Event event)
runWithEvent
in interface IAction
runWithEvent
in class Action
protected void updateEnabledState(SelectionModel<javafx.scene.Node> selectionModel)
Action
dependent on the
selection state of the SelectionModel
.selectionModel
- The SelectionModel
to obtain the selection from.Copyright (c) 2014 itemis AG and others. All rights reserved.