< prev index next >

src/java.desktop/share/classes/java/awt/FocusTraversalPolicy.java

Print this page




 130      * @throws IllegalArgumentException if aContainer is null
 131      */
 132     public abstract Component getLastComponent(Container aContainer);
 133 
 134     /**
 135      * Returns the default Component to focus. This Component will be the first
 136      * to receive focus when traversing down into a new focus traversal cycle
 137      * rooted at aContainer.
 138      *
 139      * @param aContainer the focus cycle root or focus traversal policy
 140      *        provider whose default Component is to be returned
 141      * @return the default Component in the traversal cycle of aContainer,
 142      *         or null if no suitable Component can be found
 143      * @throws IllegalArgumentException if aContainer is null
 144      */
 145     public abstract Component getDefaultComponent(Container aContainer);
 146 
 147     /**
 148      * Returns the Component that should receive the focus when a Window is
 149      * made visible for the first time. Once the Window has been made visible
 150      * by a call to <code>show()</code> or <code>setVisible(true)</code>, the
 151      * initial Component will not be used again. Instead, if the Window loses
 152      * and subsequently regains focus, or is made invisible or undisplayable
 153      * and subsequently made visible and displayable, the Window's most
 154      * recently focused Component will become the focus owner. The default
 155      * implementation of this method returns the default Component.
 156      *
 157      * @param window the Window whose initial Component is to be returned
 158      * @return the Component that should receive the focus when window is made
 159      *         visible for the first time, or null if no suitable Component can
 160      *         be found
 161      * @see #getDefaultComponent
 162      * @see Window#getMostRecentFocusOwner
 163      * @throws IllegalArgumentException if window is null
 164      */
 165     public Component getInitialComponent(Window window) {
 166         if ( window == null ){
 167             throw new IllegalArgumentException("window cannot be equal to null.");
 168         }
 169         Component def = getDefaultComponent(window);
 170         if (def == null && window.isFocusableWindow()) {


 130      * @throws IllegalArgumentException if aContainer is null
 131      */
 132     public abstract Component getLastComponent(Container aContainer);
 133 
 134     /**
 135      * Returns the default Component to focus. This Component will be the first
 136      * to receive focus when traversing down into a new focus traversal cycle
 137      * rooted at aContainer.
 138      *
 139      * @param aContainer the focus cycle root or focus traversal policy
 140      *        provider whose default Component is to be returned
 141      * @return the default Component in the traversal cycle of aContainer,
 142      *         or null if no suitable Component can be found
 143      * @throws IllegalArgumentException if aContainer is null
 144      */
 145     public abstract Component getDefaultComponent(Container aContainer);
 146 
 147     /**
 148      * Returns the Component that should receive the focus when a Window is
 149      * made visible for the first time. Once the Window has been made visible
 150      * by a call to {@code show()} or {@code setVisible(true)}, the
 151      * initial Component will not be used again. Instead, if the Window loses
 152      * and subsequently regains focus, or is made invisible or undisplayable
 153      * and subsequently made visible and displayable, the Window's most
 154      * recently focused Component will become the focus owner. The default
 155      * implementation of this method returns the default Component.
 156      *
 157      * @param window the Window whose initial Component is to be returned
 158      * @return the Component that should receive the focus when window is made
 159      *         visible for the first time, or null if no suitable Component can
 160      *         be found
 161      * @see #getDefaultComponent
 162      * @see Window#getMostRecentFocusOwner
 163      * @throws IllegalArgumentException if window is null
 164      */
 165     public Component getInitialComponent(Window window) {
 166         if ( window == null ){
 167             throw new IllegalArgumentException("window cannot be equal to null.");
 168         }
 169         Component def = getDefaultComponent(window);
 170         if (def == null && window.isFocusableWindow()) {
< prev index next >