bibliothek.gui.dock.control
Interface FocusAwareComponent

All Known Implementing Classes:
RoundRectButton, RoundRectDropDownButton

public interface FocusAwareComponent

A Component implementing this interface tells the framework that it is aware of the existence of the MouseFocusObserver and that this Component prefers to request its focus independently. The framework will call maybeRequestFocus() instead of Component.requestFocusInWindow() when it encounters this interface.

Author:
Benjamin Sigg

Method Summary
 void invokeOnFocusRequest(Runnable run)
          Informs this FocusAwareComponent that is should run run after it has requested the focus.
 void maybeRequestFocus()
          Called by the MouseFocusObserver instead of Component.requestFocusInWindow().
 

Method Detail

maybeRequestFocus

void maybeRequestFocus()
Called by the MouseFocusObserver instead of Component.requestFocusInWindow().


invokeOnFocusRequest

void invokeOnFocusRequest(Runnable run)
Informs this FocusAwareComponent that is should run run after it has requested the focus. run must only be executed once. It does not contain references to objects that need to be cleaned by the garbage collector, so this FocusAwareComponent can keep a reference of run for a long time.

Parameters:
run - this Runnable will make sure that the Dockable is selected that belongs to this Component, not null.