bibliothek.gui.dock.control.focus
Interface FocusStrategy

All Known Implementing Classes:
DefaultFocusStrategy

public interface FocusStrategy

A FocusStrategy is used by a DockController to decide which Component to focus if a Dockable should receive the focus.

Author:
Benjamin Sigg

Method Summary
 void bind()
          Informs this strategy that it will be used from now on.
 Component getFocusComponent(Dockable dockable, Component mouseClicked)
          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.
 

Method Detail

getFocusComponent

Component getFocusComponent(Dockable dockable,
                            Component mouseClicked)
Given a Dockable this method tells which Component should be focused.

Parameters:
dockable - some dockable which is about to get the focus
mouseClicked - the component which was touched by the mouse and which would get the focus normally. Can be null.
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. If the result is mouseClicked then no focus will be transfered - even if mouseClicked is not focusable

bind

void bind()
Informs this strategy that it will be used from now on.


unbind

void unbind()
Informs this strategy that it is no longer used from now on.