Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

oracle.ide
Class Ide

java.lang.Object
  extended by oracle.ide.Ide

public final class Ide
extends java.lang.Object

This class is responsible for coordinating startup of the IDE.


Method Summary
static void addIdeListener(IdeListener l)
          Adds a listener to the IDE.
static boolean canRestart()
          Get whether the IDE is capable of being restarted.
static int createCmdID(java.lang.String commandName)
           
static java.lang.Integer findCmdID(java.lang.String commandName)
          If the specified String is associated with a command ID number, that number is returned as an Integer.
static java.lang.String findCmdName(int cmdID)
          Find the command name associated with the specified id.
static int findOrCreateCmdID(java.lang.String commandName)
          This is the primary method that addins should use to allocate a command ID for actions that will be handled by a Controller.
static Project getActiveProject()
          Returns the currently active Project.
static Workspace getActiveWorkspace()
          Returns the currently active Workspace.
static java.lang.String getBinDirectory()
          Gets the directory the product was started from.
static Project getDefaultProject()
          Gets the default project node
static Workspace getDefaultWorkspace()
          Gets the default Workspace
static DTCache getDTCache()
          Gets the DTCache
static EnvironOptions getEnvironOptions()
          Gets the EnvironOptions
static java.lang.String getHomeDirectory()
          Deprecated. since 11.0 - use getProductHomeDirectory() instead.
static javax.swing.ActionMap getIdeActionMap()
          Returns an ActionMap for the IDE's accelerator keys.
static IdeArgs getIdeArgs()
          Gets the {@link IdeArgs)
static Controller getIdeController()
          Internal only.
static javax.swing.InputMap getIdeInputMap()
          Returns an InputMap for the IDE's accelerator keys.
static IdeProperties getIdeProperties()
          Gets the IdeProperties instance
static java.lang.String getInstallDirectory(java.io.File systemDir)
          Gets the install directory
static KeyStrokeContextRegistry getKeyStrokeContextRegistry()
          Gets the KeyStrokeContextRegistry
static NavigatorWindow getLastActiveNavigator()
          Gets the NavigatorWindow of the last active navigator.
static java.lang.String getLibDirectory()
          Retrieves the IDE lib directory.
static java.util.Map getMacros()
          Gets the default Map of the macros in use by the IDE.
static IdeMainWindow getMainWindow()
          Gets the IdeMainWindow instance.
static Menubar getMenubar()
          Gets the menubar.
static java.lang.String getOracleHomeDirectory()
          Returns the Oracle products install directory.
static java.lang.String getProductHomeDirectory()
          Gets the path of the product home directory.
static java.lang.String getProductID()
          Gets the extension ID of the current product.
static java.lang.String getProductVersion()
          Gets a human readable description of the product name and version.
static java.lang.String getProgramName()
          Return the IDE product's full program name.
static java.lang.String getProgramShortName()
          Returns the short name of the product.
static java.lang.String getProperty(java.lang.String key)
          Gets the IDE property indicated by the specified key.
static java.lang.String getProperty(java.lang.String key, java.lang.String def)
          Gets the IDE property indicated by the specified key.
static IdeSettings getSettings()
          Gets the IdeSettings
static StatusBar getStatusBar()
          Gets the StatusBar instance.
static IdeSystem getSystem()
          Gets the user's system.
static java.lang.String getSystemDirectory()
           
static Toolbar getToolbar()
          Gets the Toolbar.
static java.lang.String getTrueUserHomeDirectory()
          Get the user's actual home directory, represented by the "user.home" system property.
static java.lang.String getUserHomeDirectory()
          Deprecated. since 11.0 - Use getUserSettingsDirectory() to get the location where user settings are stored, or getTrueUserHomeDirectory() to get the user's actual home directory.
static java.lang.String getUserSettingsDirectory()
          Gets the directory that contains user specific settings.
static float getVersion()
          Gets the current IDE version number.
static ComponentVersionManager getVersionInfo()
          Gets the ComponentVersionManager
static WaitCursor getWaitCursor()
          Gets the WaitCursor
static java.lang.String getWorkDirectory()
          Gets the full path name of the current work directory.
static Workspaces getWorkspaces()
          Gets the workspaces.
static IdeCore installNullCore()
          Installs a null instance core into the ide.
static boolean isQuitting()
          Returns true when the IDE is quitting.
static boolean isRunning()
          Returns true when the IDE is running, even if the IDE is just starting or quitting.
static boolean isStarting()
          Returns true when the IDE is starting up.
static HistoryList loadHistoryList(java.lang.String name)
          Loads the history list
static int quit()
          Perform a controlled shut down of the IDE.
static int quit(IdeAction action, Context context)
          Perform a controlled shut down of the IDE.
static void removeIdeListener(IdeListener l)
          Removes a listener to the IDE.
static void restart()
          Restarts the product with the exact same arguments as this instance of the product was started with.
static void setActiveProject(Project project)
          Sets the active project
static void setActiveWorkspace(Workspace workspace)
          Sets the active workspace
static java.lang.String setProperty(java.lang.String key, java.lang.String value)
          Sets the IDE property indicated by the specified key.
static void startup(IdeArgs args)
          Used to startup the IDE
static void startup(IdeCore core)
          Used to startup the IDE
static void uninstallNullCore(IdeCore oldCore)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

installNullCore

public static IdeCore installNullCore()
Installs a null instance core into the ide. Used only for unit testing. Returns the existing core if any

Since:
11.1.1

uninstallNullCore

public static void uninstallNullCore(IdeCore oldCore)
Since:
11.1.1

getVersion

public static float getVersion()
Gets the current IDE version number. You should not rely on a specific value being returned from this method since JDeveloper's version number cannot accurately be represented using a float.

However, we do guarantee that for builds a and b of JDeveloper, where b is a later minor release of the same major release or a later major release that b.getVersion() > a.getVersion().

For a more accurate representation of the product version, use getProductVersion().

Returns:
a float value indicating which version of JDeveloper this is.

isRunning

public static boolean isRunning()
Returns true when the IDE is running, even if the IDE is just starting or quitting.


getMainWindow

public static IdeMainWindow getMainWindow()
Gets the IdeMainWindow instance.


getIdeArgs

public static IdeArgs getIdeArgs()
Gets the {@link IdeArgs)

Returns:
the IdeArgs

getProductID

public static java.lang.String getProductID()
Gets the extension ID of the current product. This value may be used when retrieving detailed version information from the AddinManager.

Returns:
the product id.

getProductVersion

public static java.lang.String getProductVersion()
Gets a human readable description of the product name and version. This is suitable only for text in dialogs, etc. The value returned is not necessarily suitable for parsing out a reliable version.

Returns:
the product version.

getBinDirectory

public static java.lang.String getBinDirectory()
Gets the directory the product was started from. This is usually a bin directory under the product home.

Returns:
the directory the IDE was started from (for example, /opt/sqldeveloper/sqldeveloper/bin).

getHomeDirectory

public static java.lang.String getHomeDirectory()
Deprecated. since 11.0 - use getProductHomeDirectory() instead.


getProductHomeDirectory

public static java.lang.String getProductHomeDirectory()
Gets the path of the product home directory. This is usually the subdirectory of getOracleHomeDirectory() that contains the current product, for example jdev or sqldeveloper.

Returns:
the product home directory.
Since:
11.0

getOracleHomeDirectory

public static java.lang.String getOracleHomeDirectory()
Returns the Oracle products install directory. This is the parent directory of the IDE product's home directory.


getLibDirectory

public static java.lang.String getLibDirectory()
Retrieves the IDE lib directory. The directory path will include a trailing path separator.

Returns:
the full pathname of the IDE product's lib directory. (for example, C:\Oracle\JDeveloper50\lib\, or /opt/JDeveloper50/lib/)

getUserHomeDirectory

public static java.lang.String getUserHomeDirectory()
Deprecated. since 11.0 - Use getUserSettingsDirectory() to get the location where user settings are stored, or getTrueUserHomeDirectory() to get the user's actual home directory.


getUserSettingsDirectory

public static java.lang.String getUserSettingsDirectory()
Gets the directory that contains user specific settings. The location of this directory is operating system dependent. The following are examples only, and may vary with different operating system versions.
 On Windows: c:\Documents and Settings\jsmith\Application Data\Oracle\SQLDeveloper
 On Mac: /Users/jsmith/Libary/Application Support/JDeveloper
 On Linux: /home/jsmith/.owb
 

Returns:
the path of the directory in which user specific settings are stored. This directory is not guaranteed to exist at the time this method is called.
Since:
11.1.1

getTrueUserHomeDirectory

public static java.lang.String getTrueUserHomeDirectory()
Get the user's actual home directory, represented by the "user.home" system property. If the user.home property is not set, then this method returns the same value as getUserHomeDirectory().

Returns:
The full pathname to the user's home directory.

getSystemDirectory

public static java.lang.String getSystemDirectory()
Returns:
the full pathname of the 'System' directory which is the root directory for all system property files.

getWorkDirectory

public static java.lang.String getWorkDirectory()
Gets the full path name of the current work directory.

Important: the work directory is not a fixed location. It starts off in a standard place (usually "mywork" under the user directory). However, as new applications are created, the work directory will change. You should not rely on this method returning the same location between calls.

Returns:
the full pathname of the current work directory.

getProgramName

public static java.lang.String getProgramName()
Return the IDE product's full program name.

Returns:
the name of the product.

getProgramShortName

public static java.lang.String getProgramShortName()
Returns the short name of the product.

Returns:
the short name of the product.

getIdeProperties

public static IdeProperties getIdeProperties()
Gets the IdeProperties instance

Returns:
the ide properties

getProperty

public static java.lang.String getProperty(java.lang.String key)
Gets the IDE property indicated by the specified key.

Parameters:
key - the name of the IDE property.
Returns:
the string value of the IDE property, or null if there is no property with that key.
See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String def)
Gets the IDE property indicated by the specified key.

Parameters:
key - the name of the IDE property.
def - a default value.
Returns:
the string value of the IDE property, or the default value if there is no property with that key.
See Also:
setProperty(java.lang.String, java.lang.String)

setProperty

public static java.lang.String setProperty(java.lang.String key,
                                           java.lang.String value)
Sets the IDE property indicated by the specified key.

Parameters:
key - the name of the IDE property.
value - the value of the IDE property.
Returns:
the previous value of the IDE property, or null if it did not have one.
See Also:
getProperty(String)

getWaitCursor

public static WaitCursor getWaitCursor()
Gets the WaitCursor

Returns:
the wait cursor

getVersionInfo

public static ComponentVersionManager getVersionInfo()
Gets the ComponentVersionManager

Returns:
the component version manager

getSettings

public static IdeSettings getSettings()
Gets the IdeSettings

Returns:
the ide settings

getKeyStrokeContextRegistry

public static KeyStrokeContextRegistry getKeyStrokeContextRegistry()
Gets the KeyStrokeContextRegistry

Returns:
the key stroke context registry

getEnvironOptions

public static EnvironOptions getEnvironOptions()
Gets the EnvironOptions

Returns:
the environ options

getDTCache

public static DTCache getDTCache()
Gets the DTCache

Returns:
the design-time cache

getSystem

public static IdeSystem getSystem()
Gets the user's system. The workspace contains all the users work, settings,giving him access to the database and repositories.

Returns:
the user's system.

getWorkspaces

public static Workspaces getWorkspaces()
Gets the workspaces.

Returns:
the user's workspaces. Returns an empty Workspaces object when there are no workspaces available.

getActiveWorkspace

public static Workspace getActiveWorkspace()
Returns the currently active Workspace. If there is no currently active Workspace, this method will return null.


setActiveWorkspace

public static void setActiveWorkspace(Workspace workspace)
Sets the active workspace

Parameters:
workspace - to set as the active workspace

getActiveProject

public static Project getActiveProject()
Returns the currently active Project. If there is no currently active Project, this method will return null.


setActiveProject

public static void setActiveProject(Project project)
Sets the active project

Parameters:
project - to set as the active project

getDefaultProject

public static Project getDefaultProject()
Gets the default project node

Returns:
the default project node

getDefaultWorkspace

public static Workspace getDefaultWorkspace()
Gets the default Workspace

Returns:
the default workspace

addIdeListener

public static void addIdeListener(IdeListener l)
Adds a listener to the IDE.

See Also:
IdeListener

removeIdeListener

public static void removeIdeListener(IdeListener l)
Removes a listener to the IDE.

See Also:
IdeListener

getIdeInputMap

public static javax.swing.InputMap getIdeInputMap()
Returns an InputMap for the IDE's accelerator keys. If this method is called before the main window is created it throws an exception.


getIdeActionMap

public static javax.swing.ActionMap getIdeActionMap()
Returns an ActionMap for the IDE's accelerator keys. If this method is called before the main window is created it returns any action map.


isQuitting

public static boolean isQuitting()
Returns true when the IDE is quitting.


isStarting

public static boolean isStarting()
Returns true when the IDE is starting up. Returns false all other times.


findCmdID

public static java.lang.Integer findCmdID(java.lang.String commandName)
If the specified String is associated with a command ID number, that number is returned as an Integer. If no assocation exists, null is returned.


findCmdName

public static java.lang.String findCmdName(int cmdID)
Find the command name associated with the specified id.


createCmdID

public static int createCmdID(java.lang.String commandName)
Returns:
a command id used to identify a system command. System commands are recorded in a hashtable because they can be overriden by specifying a different command class in the addins.properties file.

findOrCreateCmdID

public static int findOrCreateCmdID(java.lang.String commandName)
This is the primary method that addins should use to allocate a command ID for actions that will be handled by a Controller. For the specified String, this method will return either an existing command ID number if such a number has already been allotted for the String or a new command ID.


getMacros

public static java.util.Map getMacros()
Gets the default Map of the macros in use by the IDE.

Returns:
Map of IDE macros

quit

public static int quit(IdeAction action,
                       Context context)
Perform a controlled shut down of the IDE.

Parameters:
action - the action to shut down with.
context - the context in which to shut down

quit

public static int quit()
Perform a controlled shut down of the IDE.


getMenubar

public static Menubar getMenubar()
Gets the menubar. The menubar is a singleton object used to add menus to the ide main window.

Returns:
the menu bar.

getToolbar

public static Toolbar getToolbar()
Gets the Toolbar. The toolbar is a singleton object used to add tools to the ide main window toolbar.

Returns:
the toolbar.

getStatusBar

public static StatusBar getStatusBar()
Gets the StatusBar instance.


getLastActiveNavigator

public static NavigatorWindow getLastActiveNavigator()
Gets the NavigatorWindow of the last active navigator.

Returns:
the last active navigator window; may return null

loadHistoryList

public static HistoryList loadHistoryList(java.lang.String name)
Loads the history list

Parameters:
name -
Returns:
the HistoryList

startup

public static void startup(IdeArgs args)
Used to startup the IDE

Parameters:
args -

startup

public static void startup(IdeCore core)
Used to startup the IDE


getIdeController

public static Controller getIdeController()
Internal only. Do not use.


getInstallDirectory

public static java.lang.String getInstallDirectory(java.io.File systemDir)
Gets the install directory

Parameters:
systemDir -
Returns:
string that represents the install directory

canRestart

public static boolean canRestart()
Get whether the IDE is capable of being restarted. Support for automatic restart is platform dependent.

Note that a return value of true does not guarantee that a call to restart() will be successful. However, it does provide immediate information about whether restarting is supported at all on the current platform prior to actually calling restart().

Returns:
true if the IDE can be restarted on the current platform.

restart

public static void restart()
                    throws java.lang.UnsupportedOperationException
Restarts the product with the exact same arguments as this instance of the product was started with. The implementation of this method is platform specific and it therefore may not work on all platforms. To determine whether restarting is supported on the current platform, call canRestart().

Throws:
java.lang.UnsupportedOperationException - if restarting is not possible.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

Copyright © 1997, 2009, Oracle. All rights reserved.