bibliothek.gui.dock.control.focus
Class DefaultFocusStrategy

java.lang.Object
  extended by bibliothek.gui.dock.control.focus.DefaultFocusStrategy
All Implemented Interfaces:
FocusStrategy

public class DefaultFocusStrategy
extends Object
implements FocusStrategy

The DefaultFocusStrategy keeps track of the last focused Component of any Dockable that is registered at a DockController.

Author:
Benjamin Sigg

Constructor Summary
DefaultFocusStrategy(DockController controller)
           
 
Method Summary
 void bind()
          Informs this strategy that it will be used from now on.
 Component getFocusComponent(Dockable dockable)
          Given a Dockable this method tells which Component should be focused.
 void unbind()
          Informs this strategy that it is no longer used from now on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFocusStrategy

public DefaultFocusStrategy(DockController controller)
Method Detail

getFocusComponent

public Component getFocusComponent(Dockable dockable)
Description copied from interface: FocusStrategy
Given a Dockable this method tells which Component should be focused.

Specified by:
getFocusComponent in interface FocusStrategy
Parameters:
dockable - some dockable which is about to get the focus
Returns:
the component to focus or null if this method cannot decide (in which case a default component will be chosen). If the Component is not focusable, then the next Component that follows in the iteration of focusable Components will be focused

bind

public void bind()
Description copied from interface: FocusStrategy
Informs this strategy that it will be used from now on.

Specified by:
bind in interface FocusStrategy

unbind

public void unbind()
Description copied from interface: FocusStrategy
Informs this strategy that it is no longer used from now on.

Specified by:
unbind in interface FocusStrategy