Package org.eclipse.gef.mvc.fx.behaviors
Class FocusBehavior
java.lang.Object
org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
org.eclipse.gef.mvc.fx.behaviors.FocusBehavior
- All Implemented Interfaces:
IActivatable
,IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>
,IBehavior
The
FocusBehavior
can be registered on an IVisualPart
to
transfer the focus information from the FocusModel
to the part's
visualization. It will assign keyboard focus to the visualization if the part
is focused, and it will display focus feedback around the visualization to
indicate that the part has focus.-
Property Summary
Properties inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
active, adaptable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The adapter role for the "focus"IFeedbackPartFactory
.static final String
Defines the CSS styling that is used to highlight a focused viewer.static final String
Defines the default CSS styling for theInfiniteCanvas
: no background, no border.Fields inherited from interface org.eclipse.gef.common.activate.IActivatable
ACTIVE_PROPERTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAnchoreds
(Collection<? extends IVisualPart<? extends javafx.scene.Node>> targets, List<? extends IVisualPart<? extends javafx.scene.Node>> anchoreds) Adds the given anchoreds as children to the root part and anchors them to the given target parts.protected void
Adds viewer focused feedback.protected void
Transfers the keyboard focus to JavaFX, i.e. callsNode.requestFocus()
on the visual of the focus part, or on the root visual if no part is focused.protected void
PostAbstractBehavior.activate()
hook that may be overwritten to e.g. register listeners.protected void
PreAbstractBehavior.deactivate()
hook that may be overwritten to e.g. unregister listeners.protected IFeedbackPartFactory
getFeedbackPartFactory
(IViewer viewer) Returns theIFeedbackPartFactory
that should be used for feedback creation.protected FocusModel
Returns theFocusModel
at which thisFocusBehavior
is registered for changes.protected void
Refreshes focus feedback, i.e. adds or removes feedback.protected void
Removes viewer focused feedback.Methods inherited from class org.eclipse.gef.mvc.fx.behaviors.AbstractBehavior
activate, activeProperty, adaptableProperty, addAnchoreds, addFeedback, addFeedback, addHandles, addHandles, clearFeedback, clearHandles, deactivate, getAdaptable, getFeedback, getFeedback, getFeedbackPartFactory, getFeedbackPerTargetSet, getHandlePartFactory, getHandlePartFactory, getHandles, getHandles, getHandlesPerTargetSet, getHost, hasFeedback, hasFeedback, hasHandles, hasHandles, isActive, removeAnchoreds, removeFeedback, removeFeedback, removeFeedback, removeHandles, removeHandles, removeHandles, setAdaptable, updateHandles, updateHandles
-
Field Details
-
UNFOCUSED_STYLE
Defines the default CSS styling for theInfiniteCanvas
: no background, no border.- See Also:
-
FOCUSED_STYLE
Defines the CSS styling that is used to highlight a focused viewer.- See Also:
-
FOCUS_FEEDBACK_PART_FACTORY
The adapter role for the "focus"IFeedbackPartFactory
.- See Also:
-
-
Constructor Details
-
FocusBehavior
public FocusBehavior()
-
-
Method Details
-
addAnchoreds
protected void addAnchoreds(Collection<? extends IVisualPart<? extends javafx.scene.Node>> targets, List<? extends IVisualPart<? extends javafx.scene.Node>> anchoreds) Description copied from class:AbstractBehavior
Adds the given anchoreds as children to the root part and anchors them to the given target parts.- Overrides:
addAnchoreds
in classAbstractBehavior
- Parameters:
targets
- The anchorages for the anchoreds.anchoreds
- The anchored (feedback or handle) parts.
-
addViewerFocusedFeedback
protected void addViewerFocusedFeedback()Adds viewer focused feedback. -
applyFocusToVisual
protected void applyFocusToVisual()Transfers the keyboard focus to JavaFX, i.e. callsNode.requestFocus()
on the visual of the focus part, or on the root visual if no part is focused. -
doActivate
protected void doActivate()Description copied from class:AbstractBehavior
PostAbstractBehavior.activate()
hook that may be overwritten to e.g. register listeners.- Overrides:
doActivate
in classAbstractBehavior
-
doDeactivate
protected void doDeactivate()Description copied from class:AbstractBehavior
PreAbstractBehavior.deactivate()
hook that may be overwritten to e.g. unregister listeners.- Overrides:
doDeactivate
in classAbstractBehavior
-
getFeedbackPartFactory
Description copied from class:AbstractBehavior
Returns theIFeedbackPartFactory
that should be used for feedback creation.- Overrides:
getFeedbackPartFactory
in classAbstractBehavior
- Parameters:
viewer
- TheIViewer
for which to determine theIFeedbackPartFactory
for thisIBehavior
.- Returns:
- The
IFeedbackPartFactory
that should be used for feedback creation.
-
getFocusModel
Returns theFocusModel
at which thisFocusBehavior
is registered for changes.- Returns:
- The
FocusModel
at which thisFocusBehavior
is registered for changes.
-
refreshFocusFeedback
protected void refreshFocusFeedback()Refreshes focus feedback, i.e. adds or removes feedback. -
removeViewerFocusedFeedback
protected void removeViewerFocusedFeedback()Removes viewer focused feedback.
-