public class WindowUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DESKTOP_FRAME
The frame resides docked left, right, top, or bottom
|
static int |
INTERNAL_FRAME
A frame that resides in the desktop
|
static int |
PERSIST_ALWAYS
always persist the TopComponent
|
static int |
PERSIST_NEVER
dont persist the TopComponent
|
static int |
PERSIST_ONLY_OPENED
persist a TopComponent only if it is opened
|
static int |
PERSIST_UNKNOWN
unkown persistence mode the TopComponent
|
static int |
TOP_FRAME
A frame that resides as a separate window
|
| Modifier and Type | Method and Description |
|---|---|
static Workspace |
createWorkspace(java.lang.String codeName,
java.lang.String displayName)
Utility method: creates a workspace and adds it to the WindowManager's list of workspaces.
|
static TopComponent |
findTopComponent(java.lang.String componentName)
Utility method: Returns the TopComponent with the given programmatic name in the current workspace,
or
null if there is no such TopComponent. |
static TopComponent |
findTopComponent(Workspace workspace,
java.lang.String componentName)
Utility method: Returns the TopComponent with the given programmatic name in the given workspace,
or
null if there is no such TopComponent. |
static void |
frameResidesInDesktop(Mode mode)
Utility method: makes the given mode reside in the desktop instead of as a separate window.
|
static void |
frameResidesInDesktop(Mode mode,
int frameType)
Utility method: makes the given mode either reside in the desktop or display a separate window.
|
static int |
getPersistMode(TopComponent comp)
Get the persistence mode of the given TopComponent
|
static Mode |
openInMode(TopComponent component,
java.lang.String modeName)
Utility method: opens a topcomponent in the current workspace in a mode with the
indicated name.
|
static Mode |
openInMode(TopComponent component,
java.lang.String modeName,
int frameType)
Utility method: opens a topcomponent in the current workspace in a mode with the
indicated name.
|
static Mode |
openInMode(Workspace workspace,
TopComponent component,
java.lang.String modeName)
Utility method: opens a topcomponent in the given workspace in a mode with the
indicated name.
|
static Mode |
openInMode(Workspace workspace,
TopComponent component,
java.lang.String modeName,
int frameType)
Utility method: opens a topcomponent in the given workspace in a mode with the
indicated name.
|
static void |
setFrameType(int frameType)
Utility method: Sets the default windowing behavior, MDI or SDI.
|
static void |
setPersistMode(TopComponent comp,
int option)
Determine under which conditions the TopComponent is persisted to the NetBeans
system directory
|
public static final int INTERNAL_FRAME
public static final int TOP_FRAME
public static final int DESKTOP_FRAME
public static final int PERSIST_ONLY_OPENED
public static final int PERSIST_NEVER
public static final int PERSIST_ALWAYS
public static final int PERSIST_UNKNOWN
public static void setFrameType(int frameType)
true the default behavior for new windows is to reside in the desktop.type - indicates that the default windowing behavior,
should be one of INTERNAL_FRAME, TOP_FRAME, or DESKTOP_FRAMEpublic static Mode openInMode(TopComponent component, java.lang.String modeName)
component - the component to openmodeName - the (code) name of the modepublic static Mode openInMode(Workspace workspace,
TopComponent component,
java.lang.String modeName)
workspace - the workspace top open the component incomponent - the component to openmodeName - the (code) name of the modepublic static Mode openInMode(TopComponent component, java.lang.String modeName, int frameType)
component - the component to openmodeName - the (code) name of the modeframeType - indicates the type of the window frame,
should be one of INTERNAL_FRAME, TOP_FRAME, or DESKTOP_FRAMEpublic static Mode openInMode(Workspace workspace,
TopComponent component,
java.lang.String modeName,
int frameType)
workspace - the workspace top open the component incomponent - the component to openmodeName - the (code) name of the modeframeType - indicates the type of the window frame,
should be one of INTERNAL_FRAME, TOP_FRAME, or DESKTOP_FRAMEpublic static void setPersistMode(TopComponent comp, int option)
comp - the componentoption - one of PERSIST_NEVER or PERSIST_ONLY_OPENEDpublic static int getPersistMode(TopComponent comp)
comp - the componentPERSIST_NEVER or PERSIST_ONLY_OPENEDpublic static void frameResidesInDesktop(Mode mode)
mode - the mode to make reside in the desktoppublic static void frameResidesInDesktop(Mode mode,
int frameType)
mode - the mode to make reside in the desktopframeType - indicates the type of frame, MDI or SDIpublic static TopComponent findTopComponent(java.lang.String componentName)
null if there is no such TopComponent.componentName - the programmatic name of the TopComponentnull if there is no such TopComponentpublic static TopComponent findTopComponent(Workspace workspace, java.lang.String componentName)
null if there is no such TopComponent.workspace - the workspace in which to look for the TopComponentcomponentName - the programmatic name of the TopComponentnull if there is no such TopComponentpublic static Workspace createWorkspace(java.lang.String codeName,
java.lang.String displayName)
codeName - the code name of the new workspacedisplayName - the display name of the new workspace