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 StringThe adapter role for the "focus"IFeedbackPartFactory.static final StringDefines the CSS styling that is used to highlight a focused viewer.static final StringDefines 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 voidaddAnchoreds(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 voidAdds viewer focused feedback.protected voidTransfers 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 voidPostAbstractBehavior.activate()hook that may be overwritten to e.g. register listeners.protected voidPreAbstractBehavior.deactivate()hook that may be overwritten to e.g. unregister listeners.protected IFeedbackPartFactorygetFeedbackPartFactory(IViewer viewer) Returns theIFeedbackPartFactorythat should be used for feedback creation.protected FocusModelReturns theFocusModelat which thisFocusBehavioris registered for changes.protected voidRefreshes focus feedback, i.e. adds or removes feedback.protected voidRemoves 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:AbstractBehaviorAdds the given anchoreds as children to the root part and anchors them to the given target parts.- Overrides:
addAnchoredsin 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:AbstractBehaviorPostAbstractBehavior.activate()hook that may be overwritten to e.g. register listeners.- Overrides:
doActivatein classAbstractBehavior
-
doDeactivate
protected void doDeactivate()Description copied from class:AbstractBehaviorPreAbstractBehavior.deactivate()hook that may be overwritten to e.g. unregister listeners.- Overrides:
doDeactivatein classAbstractBehavior
-
getFeedbackPartFactory
Description copied from class:AbstractBehaviorReturns theIFeedbackPartFactorythat should be used for feedback creation.- Overrides:
getFeedbackPartFactoryin classAbstractBehavior- Parameters:
viewer- TheIViewerfor which to determine theIFeedbackPartFactoryfor thisIBehavior.- Returns:
- The
IFeedbackPartFactorythat should be used for feedback creation.
-
getFocusModel
Returns theFocusModelat which thisFocusBehavioris registered for changes.- Returns:
- The
FocusModelat which thisFocusBehavioris registered for changes.
-
refreshFocusFeedback
protected void refreshFocusFeedback()Refreshes focus feedback, i.e. adds or removes feedback. -
removeViewerFocusedFeedback
protected void removeViewerFocusedFeedback()Removes viewer focused feedback.
-