bibliothek.gui.dock.util
Class FocusedWindowProvider

java.lang.Object
  extended by bibliothek.gui.dock.util.AbstractWindowProvider
      extended by bibliothek.gui.dock.util.FocusedWindowProvider
All Implemented Interfaces:
WindowProvider

public class FocusedWindowProvider
extends AbstractWindowProvider

A WindowProvider monitoring a set of windows, the last window that had the focus is the selected window.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.util.AbstractWindowProvider
listeners
 
Constructor Summary
FocusedWindowProvider()
           
 
Method Summary
 void add(Window window)
           
 void remove(Window window)
           
 Window searchWindow()
          Tries to find a window.
 
Methods inherited from class bibliothek.gui.dock.util.AbstractWindowProvider
addWindowProviderListener, fireVisibilityChanged, fireWindowChanged, hasListeners, isShowing, listeners, removeWindowProviderListener, updateVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FocusedWindowProvider

public FocusedWindowProvider()
Method Detail

searchWindow

public Window searchWindow()
Description copied from interface: WindowProvider
Tries to find a window. The result should either be a Frame or a Dialog, and a plain Window only as last resort. If possible the main-frame or another important window that will not be closed soon should be returned. Visible windows are preferred over non visible ones. This method is not guaranteed to have success, null is a valid result. This method is not required to return always the same window, however the WindowProviderListeners should be informed when the result changes.

Returns:
if possible a visible Frame which won't be closed in the near future, any window which does not fulfill the requirements or null if no window is available at all.

add

public void add(Window window)

remove

public void remove(Window window)