public class FocusBehavior extends AbstractBehavior
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.active, adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FOCUS_FEEDBACK_PART_FACTORY
The adapter role for the "focus"
IFeedbackPartFactory . |
static java.lang.String |
FOCUSED_STYLE
Defines the CSS styling that is used to highlight a focused viewer.
|
static java.lang.String |
UNFOCUSED_STYLE
Defines the default CSS styling for the
InfiniteCanvas : no
background, no border. |
ACTIVE_PROPERTY
Constructor and Description |
---|
FocusBehavior() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAnchoreds(java.util.Collection<? extends IVisualPart<? extends javafx.scene.Node>> targets,
java.util.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 |
addViewerFocusedFeedback()
Adds viewer focused feedback.
|
protected void |
applyFocusToVisual()
Transfers the keyboard focus to JavaFX, i.e. calls
Node.requestFocus() on the visual of the focus part, or on the
root visual if no part is focused. |
protected void |
doActivate()
Post
AbstractBehavior.activate() hook that may be overwritten to e.g. register
listeners. |
protected void |
doDeactivate()
Pre
AbstractBehavior.deactivate() hook that may be overwritten to e.g. unregister
listeners. |
protected IFeedbackPartFactory |
getFeedbackPartFactory(IViewer viewer)
Returns the
IFeedbackPartFactory that should be used for feedback
creation. |
protected FocusModel |
getFocusModel()
Returns the
FocusModel at which this FocusBehavior is
registered for changes. |
protected void |
refreshFocusFeedback()
Refreshes focus feedback, i.e. adds or removes feedback.
|
protected void |
removeViewerFocusedFeedback()
Removes viewer focused feedback.
|
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
public static final java.lang.String UNFOCUSED_STYLE
InfiniteCanvas
: no
background, no border.public static final java.lang.String FOCUSED_STYLE
public static final java.lang.String FOCUS_FEEDBACK_PART_FACTORY
IFeedbackPartFactory
.protected void addAnchoreds(java.util.Collection<? extends IVisualPart<? extends javafx.scene.Node>> targets, java.util.List<? extends IVisualPart<? extends javafx.scene.Node>> anchoreds)
AbstractBehavior
addAnchoreds
in class AbstractBehavior
targets
- The anchorages for the anchoreds.anchoreds
- The anchored (feedback or handle) parts.protected void addViewerFocusedFeedback()
protected void applyFocusToVisual()
Node.requestFocus()
on the visual of the focus part, or on the
root visual if no part is focused.protected void doActivate()
AbstractBehavior
AbstractBehavior.activate()
hook that may be overwritten to e.g. register
listeners.doActivate
in class AbstractBehavior
protected void doDeactivate()
AbstractBehavior
AbstractBehavior.deactivate()
hook that may be overwritten to e.g. unregister
listeners.doDeactivate
in class AbstractBehavior
protected IFeedbackPartFactory getFeedbackPartFactory(IViewer viewer)
AbstractBehavior
IFeedbackPartFactory
that should be used for feedback
creation.getFeedbackPartFactory
in class AbstractBehavior
viewer
- The IViewer
for which to determine the
IFeedbackPartFactory
for this IBehavior
.IFeedbackPartFactory
that should be used for feedback
creation.protected FocusModel getFocusModel()
FocusModel
at which this FocusBehavior
is
registered for changes.FocusModel
at which this FocusBehavior
is
registered for changes.protected void refreshFocusFeedback()
protected void removeViewerFocusedFeedback()
Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.