com.jgoodies.validation.tutorial.util
Class MyFocusTraversalPolicy
java.lang.Object
java.awt.FocusTraversalPolicy
javax.swing.InternalFrameFocusTraversalPolicy
javax.swing.SortingFocusTraversalPolicy
javax.swing.LayoutFocusTraversalPolicy
com.jgoodies.validation.tutorial.util.MyFocusTraversalPolicy
- All Implemented Interfaces:
- Serializable
public final class MyFocusTraversalPolicy
- extends LayoutFocusTraversalPolicy
A FocusTraversalPolicy that determines traversal order based on the order
of child Components in a Container. In addition to its superclass,
this class excludes non-editable text components, scroll bars, and the
root pane from the focus cycle. The JGoodies User Interface Framework (UIF)
contains an extended version of this policy.
- Since:
- 1.4
- Version:
- $Revision: 1.10 $
- Author:
- Karsten Lentzsch
- See Also:
JTextComponent.isEditable()
,
Serialized Form
Method Summary |
protected boolean |
accept(Component aComponent)
Determines whether a Component is an acceptable choice as the new
focus owner. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final FocusTraversalPolicy INSTANCE
- Holds the single instance of this focus traversal policy.
- See Also:
KeyboardFocusManager.setDefaultFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
accept
protected boolean accept(Component aComponent)
- Determines whether a Component is an acceptable choice as the new
focus owner. By default, this method will accept a Component if and
only if it is visible, displayable, enabled, and focusable,
no JScrollBar, no JRootPane, and in case of a JTextComponent,
it must be editable.
- Overrides:
accept
in class LayoutFocusTraversalPolicy
- Parameters:
aComponent
- the Component whose fitness as a focus owner is to
be tested
- Returns:
true
if aComponent is visible, displayable,
enabled, and focusable; false
otherwise
Copyright © 2003-2008 JGoodies Karsten Lentzsch. All Rights Reserved.