# com.bea.ide
Application Class

public class Application
extends `Object`

The global service representing the state of the entire application. This service should be used to instantiate and obtain top level objects and properties.

Hierarchy
  `Object`
  `Application`

## Nested Class Summary

`public static interface` | `Application.I`

## Field Summary

`public static final `String`` | `ACTIVE` Property value for PROP_ApplicationActive indicating the Application is active.
`public static final `String`` | `EVENT_CurrentStateChanged` Application event associated with a change in the state of the current workspace.
`public static final `String`` | `EVENT_DocumentDirtyChange` Application event that indicates the document dirty state has changed (saved or modified in memory).
`public static final `String`` | `EVENT_DocumentDisplayed` Application event that indicates a document has been displayed (opened by the user).
`public static final `String`` | `EVENT_DocumentHidden` Application event that indicates a document has been hidden (closed by the user).
`public static final `String`` | `EVENT_WorkspaceSave` Application event associated with a workspace saving.
`public static final `String`` | `INACTIVE` Property value for PROP_ApplicationActive indicating the Application is NOT active.
`public static final `Object`` | `INIT_DocumentPanelReady` Initialization level indicating that the document panel is ready and any open documents are displayed.
`public static final `Object`` | `INIT_Exiting` Initialization level indicating that the application is exiting.
`public static final `Object`` | `INIT_ExtensionsLoaded` Initialization level indicating that all extensions have been loaded.
`public static final `Object`` | `INIT_FrameSvcStarted` Initialization level indicating that the frame service has started and UI is available.
`public static final `Object`` | `INIT_StartupComplete` Initialization level indicating that all startup work has completed.
`protected static `Application.I`` | `instance` Application.I
`public static final `Object`` | `KEY_Headless` Cookie that indicates we are running with no UI.
`public static final `Object`` | `KEY_RefactoringDisabled` Cookie that indicates that no refactoring should be performed on any files within this application.
`public static final `Object`` | `KEY_UndoManager` Cookie used by the Undo subsystem to lookup the current undo manager.
`public static final `String`` | `PROP_ActiveDebugClient` Property associated with the currently active debug client.
`public static final `String`` | `PROP_ActiveDocumentView` Property associated with the current document view.
`public static final `String`` | `PROP_ActiveProject` Property associated with the current project.
`public static final `String`` | `PROP_ActiveWorkspace` Property whose value is the currently active IWorkspace object.
`public static final `String`` | `PROP_ApplicationActive` Property indicating whather the application is currently active (in front, receiving user input).
`public static final `String`` | `PROP_ApplicationRefactoring` This will be Boolean.TRUE if refactoring is in progress, Boolean.FALSE otherwise.
`public static final `String`` | `PROP_FocusedURIs` Property indicating the set of URIs that currently have focus.
`public static final `String`` | `PROP_FocusedView` Property indicating the top-level IFrameView, IDocumentView or Component that has focus.
`public static final `String`` | `PROP_InitLevel` Property to indicate the initialization level of the ide during startup.
`public static final `String`` | `PROP_Modules` Property associated with the set of modules for the current workspace.
`public static final `String`` | `PROP_OpenProjects` Property associated with the set of open projects for the current workspace.
`public static final `String`` | `PROP_Roles` Property associated with the set of security roles for the current workspace.
`public static final `String`` | `PROP_SelectedElement` Property associated with the currently selected element.
`public static final `String`` | `PROP_Server` Property associated with server setting for the current workspace.
`public static final `String`` | `PROP_WebLogicHome` A property containing the string value that describes the path to the weblogic home directory.
`public static final `String`` | `PROP_WorkspaceLibraries` Property associated with the set of libraries for the current workspace.

## Constructor Summary

Application()

## Method Summary

`public static boolean` | `canUseFrameSvc`() Utility method to determine if we can use the frame service.
`public static `Application.I`` | `get`()
`public static `IDocument`` | `getActiveDocument`() Shortcut method to get the active document.
`public static `IDocumentView`` | `getActiveDocumentView`() Shortcut method to get the active document view
`public static `IProject`` | `getCurrentProject`() Shortcut method to get the active project
`public static `JFrame`` | `getRootFrame`() Shortcut method to get the root frame.
`public static `IElement`` | `getSelectedElement`() Shortcut method to get the current selected element
`public static `Object`` | `getService`(`Class` c) Shortcut method to get a service.
`public static `IWorkspace`` | `getWorkspace`() Shortcut method to get the active workspace

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Detail

### ACTIVE

    public static final String ACTIVE

  Property value for PROP_ApplicationActive indicating the Application is active.

Related Topics

``Application.PROP_ApplicationActive``

### EVENT_CurrentStateChanged

    public static final String EVENT_CurrentStateChanged

  Application event associated with a change in the state of the current workspace.

Related Topics

``IWorkspace.setState(String, String, IActionProxy)``

### EVENT_DocumentDirtyChange

    public static final String EVENT_DocumentDirtyChange

  Application event that indicates the document dirty state has changed (saved or modified in memory). Value is the URI of the document.

### EVENT_DocumentDisplayed

    public static final String EVENT_DocumentDisplayed

  Application event that indicates a document has been displayed (opened by the user). Value is the URI of the document.

### EVENT_DocumentHidden

    public static final String EVENT_DocumentHidden

  Application event that indicates a document has been hidden (closed by the user). Value is the URI of the document.

### EVENT_WorkspaceSave

    public static final String EVENT_WorkspaceSave

  Application event associated with a workspace saving. Listeners to this can write out any preferences immediately before the workspace is saved to insure the information is persisted.

Related Topics

``IWorkspace.save()``

### INACTIVE

    public static final String INACTIVE

  Property value for PROP_ApplicationActive indicating the Application is NOT active.

Related Topics

``Application.PROP_ApplicationActive``

### INIT_DocumentPanelReady

    public static final Object INIT_DocumentPanelReady

  Initialization level indicating that the document panel is ready and any open documents are displayed.

### INIT_Exiting

    public static final Object INIT_Exiting

  Initialization level indicating that the application is exiting. Once this property is set the IDE will close and the operation cannot be cancelled.

### INIT_ExtensionsLoaded

    public static final Object INIT_ExtensionsLoaded

  Initialization level indicating that all extensions have been loaded.

### INIT_FrameSvcStarted

    public static final Object INIT_FrameSvcStarted

  Initialization level indicating that the frame service has started and UI is available.

### INIT_StartupComplete

    public static final Object INIT_StartupComplete

  Initialization level indicating that all startup work has completed. Work not needed for startup should be delayed until this level is reached.

### instance

    protected static Application.I instance

### KEY_Headless

    public static final Object KEY_Headless

  Cookie that indicates we are running with no UI. This is used for example in wlwBuild. Non-null value for this cookie indicates that there is no UI. Only the OutputWindowSvc and MessageSvc should be used to output information.

### KEY_RefactoringDisabled

    public static final Object KEY_RefactoringDisabled

  Cookie that indicates that no refactoring should be performed on any files within this application. This can be used to disable refactoring for sequences of actions that would normally take place (copy files, move files, etc...).

### KEY_UndoManager

    public static final Object KEY_UndoManager

  Cookie used by the Undo subsystem to lookup the current undo manager. Participants in undo are responsible for setting and unsetting the UndoManager when they receive and lose focus.

### PROP_ActiveDebugClient

    public static final String PROP_ActiveDebugClient

  Property associated with the currently active debug client.

Related Topics

``IDebugClient``

### PROP_ActiveDocumentView

    public static final String PROP_ActiveDocumentView

  Property associated with the current document view. This is the document view that has or last had focus. The document for this view is the active document. Value is an IDocumentView.

Related Topics

``IDocumentView``
``IDocument``

### PROP_ActiveProject

    public static final String PROP_ActiveProject

  Property associated with the current project. Value is an IProject. The current project is defined as the project of the currently active document.

Related Topics

``IProject``

### PROP_ActiveWorkspace

    public static final String PROP_ActiveWorkspace

  Property whose value is the currently active IWorkspace object.

Related Topics

``IWorkspace``

### PROP_ApplicationActive

    public static final String PROP_ApplicationActive

  Property indicating whather the application is currently active (in front, receiving user input).

### PROP_ApplicationRefactoring

    public static final String PROP_ApplicationRefactoring

  This will be Boolean.TRUE if refactoring is in progress, Boolean.FALSE otherwise. Take care when depending on this property - it can be set and unset many times during some operations, and can be changed off the AWT thread.

### PROP_FocusedURIs

    public static final String PROP_FocusedURIs

  Property indicating the set of URIs that currently have focus. Generally, this will be a single URI that is the URI for the current document. However, when focus is in the application tree for example, this will be the set of URIs that are selected in the tree. The value is an IURISelectionContext.

Related Topics

``IURISelectionContext``

### PROP_FocusedView

    public static final String PROP_FocusedView

  Property indicating the top-level IFrameView, IDocumentView or Component that has focus.

### PROP_InitLevel

    public static final String PROP_InitLevel

  Property to indicate the initialization level of the ide during startup. Values are INIT_* values.

### PROP_Modules

    public static final String PROP_Modules

  Property associated with the set of modules for the current workspace. Whenever a module is added or removed, the difference between the old value and the new value will allow listeners to determine what changed. Value is an IModule[].

Related Topics

``IModule``
``IWorkspace.getModules()``

### PROP_OpenProjects

    public static final String PROP_OpenProjects

  Property associated with the set of open projects for the current workspace. Whenever a project is added or removed, the difference between the old value and the new value will allow listeners to determine what changed. Value is an IProject[].

Related Topics

``IWorkspace.getProjects()``
``IProject``

### PROP_Roles

    public static final String PROP_Roles

  Property associated with the set of security roles for the current workspace. Whenever a security role is added or removed, the difference between the old value and the new value will allow listeners to determine what changed. Value is an ISecurityRole[].

Related Topics

``ISecurityRole``
``IWorkspace``

### PROP_SelectedElement

    public static final String PROP_SelectedElement

  Property associated with the currently selected element. This is the IElement selected in the currently focused view.

Related Topics

``Application.PROP_FocusedView``

### PROP_Server

    public static final String PROP_Server

  Property associated with server setting for the current workspace. When the server settings change, this property is set. The value of the property is not important. The ServerSvc should be used to find out about the new server settings. This property should really be an event, but is not for historical reasons.

Related Topics

``ServerSvc``

### PROP_WebLogicHome

    public static final String PROP_WebLogicHome

  A property containing the string value that describes the path to the weblogic home directory. This is the parent of the workshop and server directories in a BEA installation.

### PROP_WorkspaceLibraries

    public static final String PROP_WorkspaceLibraries

  Property associated with the set of libraries for the current workspace. Whenever a library is added or removed, the difference between the old value and the new value will allow listeners to determine what changed. Value is a URI[].

Related Topics

``IWorkspace.getLibraries()``

## Constructor Detail

### Application

    public Application()

## Method Detail

### canUseFrameSvc() Method

    public static boolean canUseFrameSvc()

Utility method to determine if we can use the frame service. This is true if the frame service has been started and we are not exiting.

### get() Method

    public static Application.I get()

### getActiveDocument() Method

    public static IDocument getActiveDocument()

Shortcut method to get the active document. The active document is the document of the currently active document view.

#### Returns

current document or null

Related Topics

``Application.PROP_ActiveDocumentView``
``IDocumentView``
``IDocument``

### getActiveDocumentView() Method

    public static IDocumentView getActiveDocumentView()

Shortcut method to get the active document view

#### Returns

current document view or null

Related Topics

``Application.PROP_ActiveDocumentView``
``IDocumentView``

### getCurrentProject() Method

    public static IProject getCurrentProject()

Shortcut method to get the active project

#### Returns

current project or null

Related Topics

``Application.PROP_ActiveProject``
``IProject``

### getRootFrame() Method

    public static JFrame getRootFrame()

Shortcut method to get the root frame.

Related Topics

``FrameSvc.I.getRootFrame()``

### getSelectedElement() Method

    public static IElement getSelectedElement()

Shortcut method to get the current selected element

#### Returns

current selected element or null

Related Topics

``Application.PROP_SelectedElement``
``IElement``

### getService(Class) Method

    public static Object getService(Class c)

Shortcut method to get a service.

Related Topics

``Application.I.getService(Class)``

### getWorkspace() Method

    public static IWorkspace getWorkspace()

Shortcut method to get the active workspace

#### Returns

current workspace or null

Related Topics

``Application.PROP_ActiveWorkspace``
``IWorkspace``