net.infonode.docking.util
Class DockingUtil

java.lang.Object
  extended by net.infonode.docking.util.DockingUtil

public final class DockingUtil
extends java.lang.Object

Class that contains utility methods for docking windows.

Version:
$Revision: 1.25 $
Author:
$Author: jesper $

Constructor Summary
private DockingUtil()
           
 
Method Summary
static void addWindow(DockingWindow window, RootWindow rootWindow)
           Adds a window inside a root window.
static RootWindow createHeavyweightSupportedRootWindow(AbstractViewMap views, boolean createWindowPopupMenu)
           Creates a root window with support for view serialization, popup menues and support for heavy weight components inside the views.
static RootWindow createHeavyweightSupportedRootWindow(AbstractViewMap views, ViewSerializer viewSerializer, boolean createWindowPopupMenu)
           Creates a root window with support for view serialization, popup menues and support for heavyweight components inside the views.
static RootWindow createRootWindow(AbstractViewMap views, boolean createWindowPopupMenu)
          Creates a root window with support for view serialization and popup menues.
static RootWindow createRootWindow(AbstractViewMap views, ViewSerializer viewSerializer, boolean createWindowPopupMenu)
          Creates a root window with support for view serialization and popup menues.
private static RootWindow createRootWindow(boolean heavyweightSupport, AbstractViewMap views, ViewSerializer viewSerializer, boolean createWindowPopupMenu)
           
static FloatingWindow getFloatingWindowFor(DockingWindow window)
          Returns the FloatingWindow for a window if the window is undocked.
static TabWindow getTabWindowFor(DockingWindow window)
          Returns the TabWindow for a window.
static boolean isAncestor(DockingWindow ancestor, DockingWindow child)
          Returns true if ancestor is an ancestor of child or the windows are the same.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockingUtil

private DockingUtil()
Method Detail

createRootWindow

public static RootWindow createRootWindow(AbstractViewMap views,
                                          boolean createWindowPopupMenu)
Creates a root window with support for view serialization and popup menues. All the views are added to a tab window which is placed in the root window.

Parameters:
views - the views that can be shown inside the root window
createWindowPopupMenu - true if a standard window popup menu should be created
Returns:
the created root window

createHeavyweightSupportedRootWindow

public static RootWindow createHeavyweightSupportedRootWindow(AbstractViewMap views,
                                                              boolean createWindowPopupMenu)

Creates a root window with support for view serialization, popup menues and support for heavy weight components inside the views.

All the views are added to a tab window which is placed in the root window.

Parameters:
views - the views that can be shown inside the root window
createWindowPopupMenu - true if a standard window popup menu should be created
Returns:
the created root window
Since:
IDW 1.4.0

createRootWindow

public static RootWindow createRootWindow(AbstractViewMap views,
                                          ViewSerializer viewSerializer,
                                          boolean createWindowPopupMenu)
Creates a root window with support for view serialization and popup menues. All the views are added to a tab window which is placed in the root window.

Parameters:
views - contains all the static views
viewSerializer - the view serializer used in the created RootWindow
createWindowPopupMenu - true if a standard window popup menu should be created
Returns:
the created root window

createHeavyweightSupportedRootWindow

public static RootWindow createHeavyweightSupportedRootWindow(AbstractViewMap views,
                                                              ViewSerializer viewSerializer,
                                                              boolean createWindowPopupMenu)

Creates a root window with support for view serialization, popup menues and support for heavyweight components inside the views.

All the views are added to a tab window which is placed in the root window.

Parameters:
views - contains all the static views
viewSerializer - the view serializer used in the created RootWindow
createWindowPopupMenu - true if a standard window popup menu should be created
Returns:
the created root window
Since:
IDW 1.4.0

createRootWindow

private static RootWindow createRootWindow(boolean heavyweightSupport,
                                           AbstractViewMap views,
                                           ViewSerializer viewSerializer,
                                           boolean createWindowPopupMenu)

isAncestor

public static boolean isAncestor(DockingWindow ancestor,
                                 DockingWindow child)
Returns true if ancestor is an ancestor of child or the windows are the same.

Parameters:
ancestor - the ancestor window
child - the child window
Returns:
true if ancestor is an ancestor of child or the windows are the same

addWindow

public static void addWindow(DockingWindow window,
                             RootWindow rootWindow)

Adds a window inside a root window. The following methods are tried in order:

  1. If the window already is added inside the root window nothing happens.
  2. The window is restored to it's last location if that location is inside the root window.
  3. The window is added inside the root window.

Parameters:
window - the window to add
rootWindow - the root window in which to add it
Since:
IDW 1.1.0

getTabWindowFor

public static TabWindow getTabWindowFor(DockingWindow window)
Returns the TabWindow for a window. This is either the window itself or the parent window.

Parameters:
window - the window
Returns:
the TabWindow for the window
Since:
IDW 1.3.0

getFloatingWindowFor

public static FloatingWindow getFloatingWindowFor(DockingWindow window)
Returns the FloatingWindow for a window if the window is undocked.

Parameters:
window - the window
Returns:
the FloatingWindow for the window or null if the window is not undocked
Since:
IDW 1.4.0