cern::gp::windows::WindowUtils Class Reference

Collaboration diagram for cern::gp::windows::WindowUtils:
Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static void setFrameType (int frameType)
static Mode openInMode (TopComponent component, String modeName)
static Mode openInMode (Workspace workspace, TopComponent component, String modeName)
static Mode openInMode (TopComponent component, String modeName, int frameType)
static Mode openInMode (Workspace workspace, TopComponent component, String modeName, int frameType)
static void setPersistMode (TopComponent comp, int option)
static int getPersistMode (TopComponent comp)
static void frameResidesInDesktop (Mode mode)
static void frameResidesInDesktop (Mode mode, int frameType)
static TopComponent findTopComponent (String componentName)
static TopComponent findTopComponent (Workspace workspace, String componentName)
static Workspace createWorkspace (String codeName, String displayName)

Static Public Attributes

static final int INTERNAL_FRAME = 0
static final int TOP_FRAME = 1
static final int DESKTOP_FRAME = 2
static final int PERSIST_ONLY_OPENED = 1
static final int PERSIST_NEVER = 0
static final int PERSIST_ALWAYS = 2
static final int PERSIST_UNKNOWN = -1

Private Member Functions

 WindowUtils ()

Static Private Member Functions

static boolean performDesktopFrameAction (Mode mode, TopComponent comp, ClassLoader classLoader, Class modeImplClass, Class windowUtilsClass) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, ClassNotFoundException

Static Private Attributes

static final String INTERNAL_FRAME_STRING = "INTERNAL_FRAME"
static final String TOP_FRAME_STRING = "TOP_FRAME"
static final String DESKTOP_FRAME_STRING = "DESKTOP_FRAME"
static final String CONSTRAINT_WEST = "WEST"
static final String PERSISTENCE_TYPE = "PersistenceType"
static final String PERSIST_NEVER_STR = "Never"
static final String PERSIST_ONLY_OPENED_STR = "OnlyOpened"
static final String PERSIST_ALWAYS_STR = null
static int defaultFrameType = INTERNAL_FRAME
static String[] possibleFrameTypes = { INTERNAL_FRAME_STRING, TOP_FRAME_STRING, DESKTOP_FRAME_STRING }
static Log log = LogFactory.getLog(WindowUtils.class)

Detailed Description

Provides utility methods for windowing in NetBeans.

Author:
Katarina Sigerud
Version:
Revision
1.2
Date
2006/09/25 08:52:36

Constructor & Destructor Documentation

cern::gp::windows::WindowUtils::WindowUtils (  )  [inline, private]

do not instantiate


Member Function Documentation

static Workspace cern::gp::windows::WindowUtils::createWorkspace ( String  codeName,
String  displayName 
) [inline, static]

Utility method: creates a workspace and adds it to the WindowManager's list of workspaces. The new workspace will appear as the last one in the list.

Parameters:
codeName the code name of the new workspace
displayName the display name of the new workspace
static TopComponent cern::gp::windows::WindowUtils::findTopComponent ( Workspace  workspace,
String  componentName 
) [inline, static]

Utility method: Returns the TopComponent with the given programmatic name in the given workspace, or null if there is no such TopComponent.

Parameters:
workspace the workspace in which to look for the TopComponent
componentName the programmatic name of the TopComponent
Returns:
Returns the TopComponent with the given programmatic name, or null if there is no such TopComponent
static TopComponent cern::gp::windows::WindowUtils::findTopComponent ( String  componentName  )  [inline, static]

Utility method: Returns the TopComponent with the given programmatic name in the current workspace, or null if there is no such TopComponent.

Parameters:
componentName the programmatic name of the TopComponent
Returns:
Returns the TopComponent with the given programmatic name, or null if there is no such TopComponent
static void cern::gp::windows::WindowUtils::frameResidesInDesktop ( Mode  mode,
int  frameType 
) [inline, static]

Utility method: makes the given mode either reside in the desktop or display a separate window.

Parameters:
mode the mode to make reside in the desktop
frameType indicates the type of frame, MDI or SDI

References CONSTRAINT_WEST, DESKTOP_FRAME, INTERNAL_FRAME, and possibleFrameTypes.

static void cern::gp::windows::WindowUtils::frameResidesInDesktop ( Mode  mode  )  [inline, static]

Utility method: makes the given mode reside in the desktop instead of as a separate window.

Parameters:
mode the mode to make reside in the desktop

References defaultFrameType.

Referenced by openInMode().

static int cern::gp::windows::WindowUtils::getPersistMode ( TopComponent  comp  )  [inline, static]

Get the persistence mode of the given TopComponent

Parameters:
comp the component
Returns:
one of PERSIST_NEVER or PERSIST_ONLY_OPENED

References PERSIST_ALWAYS, PERSIST_ALWAYS_STR, PERSIST_NEVER, PERSIST_NEVER_STR, PERSIST_ONLY_OPENED, PERSIST_ONLY_OPENED_STR, PERSIST_UNKNOWN, and PERSISTENCE_TYPE.

static Mode cern::gp::windows::WindowUtils::openInMode ( Workspace  workspace,
TopComponent  component,
String  modeName,
int  frameType 
) [inline, static]

Utility method: opens a topcomponent in the given workspace in a mode with the indicated name. This method first looks if the mode already exists, or else creates it.

Parameters:
workspace the workspace top open the component in
component the component to open
modeName the (code) name of the mode
frameType indicates the type of the window frame, should be one of INTERNAL_FRAME, TOP_FRAME, or DESKTOP_FRAME
Returns:
the mode the topcomponent was opened in.

References frameResidesInDesktop(), org::openide::windows::TopComponent::open(), PERSIST_NEVER, org::openide::windows::TopComponent::requestFocus(), and setPersistMode().

static Mode cern::gp::windows::WindowUtils::openInMode ( TopComponent  component,
String  modeName,
int  frameType 
) [inline, static]

Utility method: opens a topcomponent in the current workspace in a mode with the indicated name. This method first looks if the mode already exists, or else creates it

Parameters:
component the component to open
modeName the (code) name of the mode
frameType indicates the type of the window frame, should be one of INTERNAL_FRAME, TOP_FRAME, or DESKTOP_FRAME
Returns:
the mode the topcomponent was opened in.

References openInMode().

static Mode cern::gp::windows::WindowUtils::openInMode ( Workspace  workspace,
TopComponent  component,
String  modeName 
) [inline, static]

Utility method: opens a topcomponent in the given workspace in a mode with the indicated name. This method first looks if the mode already exists, or else creates it. Opens the topcomponent in the desktop.

Parameters:
workspace the workspace top open the component in
component the component to open
modeName the (code) name of the mode
Returns:
the mode the topcomponent was opened in.

References defaultFrameType, and openInMode().

static Mode cern::gp::windows::WindowUtils::openInMode ( TopComponent  component,
String  modeName 
) [inline, static]

Utility method: opens a topcomponent in the current workspace in a mode with the indicated name. This method first looks if the mode already exists, or else creates it. Opens the topcomponent in the desktop.

Parameters:
component the component to open
modeName the (code) name of the mode
Returns:
the mode the topcomponent was opened in.

References defaultFrameType.

Referenced by openInMode().

static boolean cern::gp::windows::WindowUtils::performDesktopFrameAction ( Mode  mode,
TopComponent  comp,
ClassLoader  classLoader,
Class  modeImplClass,
Class  windowUtilsClass 
) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, ClassNotFoundException [inline, static, private]

References CONSTRAINT_WEST.

static void cern::gp::windows::WindowUtils::setFrameType ( int  frameType  )  [inline, static]

Utility method: Sets the default windowing behavior, MDI or SDI. If set to true the default behavior for new windows is to reside in the desktop.

Parameters:
type indicates that the default windowing behavior, should be one of INTERNAL_FRAME, TOP_FRAME, or DESKTOP_FRAME

References defaultFrameType.

static void cern::gp::windows::WindowUtils::setPersistMode ( TopComponent  comp,
int  option 
) [inline, static]

Determine under which conditions the TopComponent is persisted to the NetBeans system directory

Parameters:
comp the component
option one of PERSIST_NEVER or PERSIST_ONLY_OPENED

References PERSIST_ALWAYS, PERSIST_ALWAYS_STR, PERSIST_NEVER, PERSIST_NEVER_STR, PERSIST_ONLY_OPENED, PERSIST_ONLY_OPENED_STR, and PERSISTENCE_TYPE.

Referenced by openInMode().


Member Data Documentation

final String cern::gp::windows::WindowUtils::CONSTRAINT_WEST = "WEST" [static, private]

Indicates the default behavior for windows, MDI or SDI. Default is MDI.

Referenced by frameResidesInDesktop(), openInMode(), and setFrameType().

The frame resides docked left, right, top, or bottom

Referenced by frameResidesInDesktop().

final String cern::gp::windows::WindowUtils::DESKTOP_FRAME_STRING = "DESKTOP_FRAME" [static, private]

A frame that resides in the desktop

Referenced by frameResidesInDesktop().

final String cern::gp::windows::WindowUtils::INTERNAL_FRAME_STRING = "INTERNAL_FRAME" [static, private]
Log cern::gp::windows::WindowUtils::log = LogFactory.getLog(WindowUtils.class) [static, private]

always persist the TopComponent

Referenced by getPersistMode(), and setPersistMode().

final String cern::gp::windows::WindowUtils::PERSIST_ALWAYS_STR = null [static, private]

Referenced by getPersistMode(), and setPersistMode().

dont persist the TopComponent

Referenced by getPersistMode(), openInMode(), and setPersistMode().

final String cern::gp::windows::WindowUtils::PERSIST_NEVER_STR = "Never" [static, private]

Referenced by getPersistMode(), and setPersistMode().

persist a TopComponent only if it is opened

Referenced by getPersistMode(), and setPersistMode().

final String cern::gp::windows::WindowUtils::PERSIST_ONLY_OPENED_STR = "OnlyOpened" [static, private]

Referenced by getPersistMode(), and setPersistMode().

unkown persistence mode the TopComponent

Referenced by getPersistMode().

final String cern::gp::windows::WindowUtils::PERSISTENCE_TYPE = "PersistenceType" [static, private]

Referenced by getPersistMode(), and setPersistMode().

Referenced by frameResidesInDesktop().

A frame that resides as a separate window

final String cern::gp::windows::WindowUtils::TOP_FRAME_STRING = "TOP_FRAME" [static, private]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2