public class FocusTraversalPolicy extends AbstractPolicy
FocusTraversalPolicy
can be used to assign focus to the next or
previous part in the focus traversal cycle.adaptable
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
FocusTraversalPolicy() |
Modifier and Type | Method and Description |
---|---|
protected ITransactionalOperation |
createOperation()
Creates an
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractPolicy through its
"work" methods. |
protected IContentPart<? extends javafx.scene.Node> |
findInnerMostContentPart(IContentPart<? extends javafx.scene.Node> part)
Returns the inner most
IContentPart child within the part
hierarchy of the given IContentPart . |
protected IContentPart<? extends javafx.scene.Node> |
findNextContentPart(IContentPart<? extends javafx.scene.Node> current)
Determines the next
IContentPart to which keyboard focus is
assigned, depending on the currently focused IContentPart . |
protected IContentPart<? extends javafx.scene.Node> |
findPreviousContentPart(IContentPart<? extends javafx.scene.Node> current)
Determines the previous
IContentPart to which keyboard focus is
assigned, depending on the currently focused IContentPart . |
IContentPart<? extends javafx.scene.Node> |
focusNext()
Assigns focus to the next part in the traversal cycle.
|
IContentPart<? extends javafx.scene.Node> |
focusPrevious()
Assigns focus to the previous part in the traversal cycle.
|
protected ChangeFocusOperation |
getChangeFocusOperation()
Returns the
ChangeFocusOperation that is used to change the focus
part. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
protected IContentPart<? extends javafx.scene.Node> |
traverse(boolean backwards)
Traverses the focus forwards or backwards depending on the given flag.
|
checkInitialized, commit, getOperation, isInitialized, locallyExecuteOperation, rollback
adaptableProperty, getAdaptable, setAdaptable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adaptableProperty, getAdaptable, setAdaptable
protected ITransactionalOperation createOperation()
AbstractPolicy
ITransactionalOperation
that is used to encapsulate
the changes that are applied by this AbstractPolicy
through its
"work" methods. The created operation should allow for
local execution
at each time.createOperation
in class AbstractPolicy
ITransactionalOperation
to encapsulate all applied
changes.protected IContentPart<? extends javafx.scene.Node> findInnerMostContentPart(IContentPart<? extends javafx.scene.Node> part)
IContentPart
child within the part
hierarchy of the given IContentPart
. If the given
IContentPart
does not have any IContentPart
children,
then the given IContentPart
is returned.part
- The IContentPart
for which to determine the inner most
IContentPart
child.IContentPart
child within the part
hierarchy of the given IContentPart
.protected IContentPart<? extends javafx.scene.Node> findNextContentPart(IContentPart<? extends javafx.scene.Node> current)
IContentPart
to which keyboard focus is
assigned, depending on the currently focused IContentPart
.
The first content part child of the given focus part is returned as the next part if a content part child is available.
The next content part sibling of the given focus part is returned as the next part if a content part sibling is available. When one sibling list ends, the search continues with the parent's siblings until it reaches the root of the hierarchy.
If the next content part cannot be determined, null
is
returned.
current
- The currently focused IContentPart
.IContentPart
to which keyboard focus is
assigned, or null
if no subsequent
IContentPart
could be determined.protected IContentPart<? extends javafx.scene.Node> findPreviousContentPart(IContentPart<? extends javafx.scene.Node> current)
IContentPart
to which keyboard focus is
assigned, depending on the currently focused IContentPart
.
At first, the previous content part sibling of the given focus part is determined. If a siblings list ends, the search continues with the parent's siblings.
The inner most content part child of the previous content part sibling is
returned as the previous content part, or null
if no
previous content part sibling could be found.
current
- The currently focused IContentPart
.IContentPart
to which keyboard focus is
assigned, or null
if no previous
IContentPart
could be determined.public IContentPart<? extends javafx.scene.Node> focusNext()
IContentPart
to which focus is assigned by the operation of this
policy, or null
if focus is assigned to the viewer.IContentPart
to which focus is assigned by the
operation of this policy, or null
if focus is
assigned to the viewer.public IContentPart<? extends javafx.scene.Node> focusPrevious()
IContentPart
to which focus is assigned by the operation of this
policy, or null
if focus is assigned to the viewer.IContentPart
to which focus is assigned by the
operation of this policy, or null
if focus is
assigned to the viewer.protected ChangeFocusOperation getChangeFocusOperation()
ChangeFocusOperation
that is used to change the focus
part.ChangeFocusOperation
that is used to change the focus
part.public void init()
AbstractPolicy
IllegalStateException
, as well as re-initializing before
committing or rolling back.init
in interface IPolicy
init
in class AbstractPolicy
protected IContentPart<? extends javafx.scene.Node> traverse(boolean backwards)
IContentPart
to which focus is assigned by the
operation of this policy, or null
if focus is assigned to
the viewer.backwards
- true
if the focus should be traversed backwards,
otherwise false
.IContentPart
to which focus is assigned by the
operation of this policy, or null
if focus is
assigned to the viewer.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.