com.jgoodies.validation.tutorial.util
Class MyFocusTraversalPolicy

java.lang.Object
  extended by java.awt.FocusTraversalPolicy
      extended by javax.swing.InternalFrameFocusTraversalPolicy
          extended by javax.swing.SortingFocusTraversalPolicy
              extended by javax.swing.LayoutFocusTraversalPolicy
                  extended by 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

Field Summary
static FocusTraversalPolicy INSTANCE
          Holds the single instance of this focus traversal policy.
 
Method Summary
protected  boolean accept(Component aComponent)
          Determines whether a Component is an acceptable choice as the new focus owner.
 
Methods inherited from class javax.swing.LayoutFocusTraversalPolicy
getComponentAfter, getComponentBefore, getFirstComponent, getLastComponent
 
Methods inherited from class javax.swing.SortingFocusTraversalPolicy
getComparator, getDefaultComponent, getImplicitDownCycleTraversal, setComparator, setImplicitDownCycleTraversal
 
Methods inherited from class javax.swing.InternalFrameFocusTraversalPolicy
getInitialComponent
 
Methods inherited from class java.awt.FocusTraversalPolicy
getInitialComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final FocusTraversalPolicy INSTANCE
Holds the single instance of this focus traversal policy.

See Also:
KeyboardFocusManager.setDefaultFocusTraversalPolicy(java.awt.FocusTraversalPolicy)
Method Detail

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.