< prev index next >
src/java.desktop/share/classes/javax/swing/SortingFocusTraversalPolicy.java
Print this page
*** 44,58 ****
* <p>
* By default, SortingFocusTraversalPolicy implicitly transfers focus down-
* cycle. That is, during normal focus traversal, the Component
* traversed after a focus cycle root will be the focus-cycle-root's default
* Component to focus. This behavior can be disabled using the
! * <code>setImplicitDownCycleTraversal</code> method.
* <p>
* By default, methods of this class with return a Component only if it is
* visible, displayable, enabled, and focusable. Subclasses can modify this
! * behavior by overriding the <code>accept</code> method.
* <p>
* This policy takes into account <a
* href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus traversal
* policy providers</a>. When searching for first/last/next/previous Component,
* if a focus traversal policy provider is encountered, its focus traversal
--- 44,58 ----
* <p>
* By default, SortingFocusTraversalPolicy implicitly transfers focus down-
* cycle. That is, during normal focus traversal, the Component
* traversed after a focus cycle root will be the focus-cycle-root's default
* Component to focus. This behavior can be disabled using the
! * {@code setImplicitDownCycleTraversal} method.
* <p>
* By default, methods of this class with return a Component only if it is
* visible, displayable, enabled, and focusable. Subclasses can modify this
! * behavior by overriding the {@code accept} method.
* <p>
* This policy takes into account <a
* href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus traversal
* policy providers</a>. When searching for first/last/next/previous Component,
* if a focus traversal policy provider is encountered, its focus traversal
*** 123,133 ****
null;
}
/**
* Constructs a SortingFocusTraversalPolicy without a Comparator.
! * Subclasses must set the Comparator using <code>setComparator</code>
* before installing this FocusTraversalPolicy on a focus cycle root or
* KeyboardFocusManager.
*/
protected SortingFocusTraversalPolicy() {
}
--- 123,133 ----
null;
}
/**
* Constructs a SortingFocusTraversalPolicy without a Comparator.
! * Subclasses must set the Comparator using {@code setComparator}
* before installing this FocusTraversalPolicy on a focus cycle root or
* KeyboardFocusManager.
*/
protected SortingFocusTraversalPolicy() {
}
*** 278,288 ****
* <p>
* By default, SortingFocusTraversalPolicy implicitly transfers focus down-
* cycle. That is, during normal focus traversal, the Component
* traversed after a focus cycle root will be the focus-cycle-root's
* default Component to focus. This behavior can be disabled using the
! * <code>setImplicitDownCycleTraversal</code> method.
* <p>
* If aContainer is <a href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus
* traversal policy provider</a>, the focus is always transferred down-cycle.
*
* @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
--- 278,288 ----
* <p>
* By default, SortingFocusTraversalPolicy implicitly transfers focus down-
* cycle. That is, during normal focus traversal, the Component
* traversed after a focus cycle root will be the focus-cycle-root's
* default Component to focus. This behavior can be disabled using the
! * {@code setImplicitDownCycleTraversal} method.
* <p>
* If aContainer is <a href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus
* traversal policy provider</a>, the focus is always transferred down-cycle.
*
* @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
*** 382,392 ****
* <p>
* By default, SortingFocusTraversalPolicy implicitly transfers focus down-
* cycle. That is, during normal focus traversal, the Component
* traversed after a focus cycle root will be the focus-cycle-root's
* default Component to focus. This behavior can be disabled using the
! * <code>setImplicitDownCycleTraversal</code> method.
* <p>
* If aContainer is <a href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus
* traversal policy provider</a>, the focus is always transferred down-cycle.
*
* @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
--- 382,392 ----
* <p>
* By default, SortingFocusTraversalPolicy implicitly transfers focus down-
* cycle. That is, during normal focus traversal, the Component
* traversed after a focus cycle root will be the focus-cycle-root's
* default Component to focus. This behavior can be disabled using the
! * {@code setImplicitDownCycleTraversal} method.
* <p>
* If aContainer is <a href="../../java/awt/doc-files/FocusSpec.html#FocusTraversalPolicyProviders">focus
* traversal policy provider</a>, the focus is always transferred down-cycle.
*
* @param aContainer a focus cycle root of aComponent or a focus traversal policy provider
*** 582,592 ****
/**
* Returns the default Component to focus. This Component will be the first
* to receive focus when traversing down into a new focus traversal cycle
* rooted at aContainer. The default implementation of this method
! * returns the same Component as <code>getFirstComponent</code>.
*
* @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
* default Component is to be returned
* @return the default Component in the traversal cycle of aContainer,
* or null if no suitable Component can be found
--- 582,592 ----
/**
* Returns the default Component to focus. This Component will be the first
* to receive focus when traversing down into a new focus traversal cycle
* rooted at aContainer. The default implementation of this method
! * returns the same Component as {@code getFirstComponent}.
*
* @param aContainer a focus cycle root of aComponent or a focus traversal policy provider whose
* default Component is to be returned
* @return the default Component in the traversal cycle of aContainer,
* or null if no suitable Component can be found
*** 597,612 ****
return getFirstComponent(aContainer);
}
/**
* Sets whether this SortingFocusTraversalPolicy transfers focus down-cycle
! * implicitly. If <code>true</code>, during normal focus traversal,
* the Component traversed after a focus cycle root will be the focus-
! * cycle-root's default Component to focus. If <code>false</code>, the
* next Component in the focus traversal cycle rooted at the specified
* focus cycle root will be traversed instead. The default value for this
! * property is <code>true</code>.
*
* @param implicitDownCycleTraversal whether this
* SortingFocusTraversalPolicy transfers focus down-cycle implicitly
* @see #getImplicitDownCycleTraversal
* @see #getFirstComponent
--- 597,612 ----
return getFirstComponent(aContainer);
}
/**
* Sets whether this SortingFocusTraversalPolicy transfers focus down-cycle
! * implicitly. If {@code true}, during normal focus traversal,
* the Component traversed after a focus cycle root will be the focus-
! * cycle-root's default Component to focus. If {@code false}, the
* next Component in the focus traversal cycle rooted at the specified
* focus cycle root will be traversed instead. The default value for this
! * property is {@code true}.
*
* @param implicitDownCycleTraversal whether this
* SortingFocusTraversalPolicy transfers focus down-cycle implicitly
* @see #getImplicitDownCycleTraversal
* @see #getFirstComponent
*** 615,627 ****
this.implicitDownCycleTraversal = implicitDownCycleTraversal;
}
/**
* Returns whether this SortingFocusTraversalPolicy transfers focus down-
! * cycle implicitly. If <code>true</code>, during normal focus
* traversal, the Component traversed after a focus cycle root will be the
! * focus-cycle-root's default Component to focus. If <code>false</code>,
* the next Component in the focus traversal cycle rooted at the specified
* focus cycle root will be traversed instead.
*
* @return whether this SortingFocusTraversalPolicy transfers focus down-
* cycle implicitly
--- 615,627 ----
this.implicitDownCycleTraversal = implicitDownCycleTraversal;
}
/**
* Returns whether this SortingFocusTraversalPolicy transfers focus down-
! * cycle implicitly. If {@code true}, during normal focus
* traversal, the Component traversed after a focus cycle root will be the
! * focus-cycle-root's default Component to focus. If {@code false},
* the next Component in the focus traversal cycle rooted at the specified
* focus cycle root will be traversed instead.
*
* @return whether this SortingFocusTraversalPolicy transfers focus down-
* cycle implicitly
*** 657,668 ****
* focus owner. By default, this method will accept a Component if and
* only if it is visible, displayable, enabled, and focusable.
*
* @param aComponent the Component whose fitness as a focus owner is to
* be tested
! * @return <code>true</code> if aComponent is visible, displayable,
! * enabled, and focusable; <code>false</code> otherwise
*/
protected boolean accept(Component aComponent) {
return fitnessTestPolicy.accept(aComponent);
}
}
--- 657,668 ----
* focus owner. By default, this method will accept a Component if and
* only if it is visible, displayable, enabled, and focusable.
*
* @param aComponent the Component whose fitness as a focus owner is to
* be tested
! * @return {@code true} if aComponent is visible, displayable,
! * enabled, and focusable; {@code false} otherwise
*/
protected boolean accept(Component aComponent) {
return fitnessTestPolicy.accept(aComponent);
}
}
< prev index next >