|
|||||||||
| Home >> All >> org >> eclipse >> core >> [ runtime overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.core.runtime
Class Platform

java.lang.Objectorg.eclipse.core.runtime.Platform
- public final class Platform
- extends java.lang.Object
The central class of the Eclipse Platform Runtime. This class cannot be instantiated or subclassed by clients; all functionality is provided by static methods. Features include:
- the platform registry of installed plug-ins
- the platform adapter manager
- the platform log
- the authorization info management
| Field Summary | |
static java.lang.String |
ARCH_AMD64
Constant string (value "amd64") indicating the platform is running on an AMD64-based architecture. |
static java.lang.String |
ARCH_IA64
Constant string (value "ia64") indicating the platform is running on an IA64-based architecture. |
static java.lang.String |
ARCH_PA_RISC
Constant string (value "PA_RISC") indicating the platform is running on an PA_RISC-based architecture. |
static java.lang.String |
ARCH_PPC
Constant string (value "ppc") indicating the platform is running on an PowerPC-based architecture. |
static java.lang.String |
ARCH_SPARC
Constant string (value "sparc") indicating the platform is running on an Sparc-based architecture. |
static java.lang.String |
ARCH_X86
Constant string (value "x86") indicating the platform is running on an x86-based architecture. |
static int |
FAILED_DELETE_METADATA
Status code constant (value 6) indicating the platform could not delete some of its metadata. |
static int |
FAILED_READ_METADATA
Status code constant (value 4) indicating the platform could not read some of its metadata. |
static int |
FAILED_WRITE_METADATA
Status code constant (value 5) indicating the platform could not write some of its metadata. |
static int |
INTERNAL_ERROR
Status code constant (value 3) indicating an error internal to the platform has occurred. |
static int |
MAX_PERFORMANCE
Constant (value 5) indicating the maximum allowed value for the PREF_PLATFORM_PERFORMANCE preference setting. |
static int |
MIN_PERFORMANCE
Constant (value 1) indicating the minimum allowed value for the PREF_PLATFORM_PERFORMANCE preference setting. |
static java.lang.String |
OPTION_STARTTIME
Debug option value denoting the time at which the platform runtime was started. |
static java.lang.String |
OS_AIX
Constant string (value "aix") indicating the platform is running on an AIX-based operating system. |
static java.lang.String |
OS_HPUX
Constant string (value "hpux") indicating the platform is running on an HP/UX-based operating system. |
static java.lang.String |
OS_LINUX
Constant string (value "linux") indicating the platform is running on a Linux-based operating system. |
static java.lang.String |
OS_MACOSX
Constant string (value "macosx") indicating the platform is running on a Mac OS X operating system. |
static java.lang.String |
OS_QNX
Constant string (value "qnx") indicating the platform is running on a QNX-based operating system. |
static java.lang.String |
OS_SOLARIS
Constant string (value "solaris") indicating the platform is running on a Solaris-based operating system. |
static java.lang.String |
OS_UNKNOWN
Constant string (value "unknown") indicating the platform is running on a machine running an unknown operating system. |
static java.lang.String |
OS_WIN32
Constant string (value "win32") indicating the platform is running on a Window 32-bit operating system (e.g., Windows 98, NT, 2000). |
static int |
PARSE_PROBLEM
Status code constant (value 1) indicating a problem in a plug-in manifest ( plugin.xml) file. |
static java.lang.String |
PI_RUNTIME
The unique identifier constant (value " org.eclipse.core.runtime")
of the Core Runtime (pseudo-) plug-in. |
static int |
PLUGIN_ERROR
Status code constant (value 2) indicating an error occurred while running a plug-in. |
static java.lang.String |
PREF_PLATFORM_PERFORMANCE
Name of a preference for configuring the performance level for this system. |
static java.lang.String |
PT_ADAPTERS
The simple identifier constant (value " adapters") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of adapter factories. |
static java.lang.String |
PT_APPLICATIONS
The simple identifier constant (value " applications") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of runnable applications. |
static java.lang.String |
PT_PREFERENCES
The simple identifier constant (value " preferences") of
the extension point of the Core Runtime plug-in where plug-ins declare
extensions to the preference facility. |
static java.lang.String |
PT_PRODUCT
The simple identifier constant (value " products") of
the extension point of the Core Runtime plug-in where plug-ins declare
the existence of a product. |
static java.lang.String |
WS_CARBON
Constant string (value "carbon") indicating the platform is running on a machine using the Carbon windowing system (Mac OS X). |
static java.lang.String |
WS_GTK
Constant string (value "gtk") indicating the platform is running on a machine using the GTK windowing system. |
static java.lang.String |
WS_MOTIF
Constant string (value "motif") indicating the platform is running on a machine using the Motif windowing system. |
static java.lang.String |
WS_PHOTON
Constant string (value "photon") indicating the platform is running on a machine using the Photon windowing system. |
static java.lang.String |
WS_UNKNOWN
Constant string (value "unknown") indicating the platform is running on a machine running an unknown windowing system. |
static java.lang.String |
WS_WIN32
Constant string (value "win32") indicating the platform is running on a machine using the Windows windowing system. |
| Constructor Summary | |
private |
Platform()
Private constructor to block instance creation. |
| Method Summary | |
static void |
addAuthorizationInfo(java.net.URL serverUrl,
java.lang.String realm,
java.lang.String authScheme,
java.util.Map info)
Adds the given authorization information to the keyring. |
static void |
addLogListener(ILogListener listener)
Adds the given log listener to the notification list of the platform. |
static void |
addProtectionSpace(java.net.URL resourceUrl,
java.lang.String realm)
Adds the specified resource to the protection space specified by the given realm. |
static java.net.URL |
asLocalURL(java.net.URL url)
Returns a URL which is the local equivalent of the supplied URL. |
static void |
endSplash()
Takes down the splash screen if one was put up. |
static java.net.URL |
find(org.osgi.framework.Bundle bundle,
IPath path)
Returns a URL for the given path in the given bundle. |
static java.net.URL |
find(org.osgi.framework.Bundle bundle,
IPath path,
java.util.Map override)
Returns a URL for the given path in the given bundle. |
static void |
flushAuthorizationInfo(java.net.URL serverUrl,
java.lang.String realm,
java.lang.String authScheme)
Removes the authorization information for the specified protection space and given authorization scheme. |
static IAdapterManager |
getAdapterManager()
Returns the adapter manager used for extending IAdaptable objects. |
static java.lang.String[] |
getApplicationArgs()
Returns the arguments not consumed by the framework implementation itself. |
static java.util.Map |
getAuthorizationInfo(java.net.URL serverUrl,
java.lang.String realm,
java.lang.String authScheme)
Returns the authorization information for the specified protection space and given authorization scheme. |
static org.osgi.framework.Bundle |
getBundle(java.lang.String symbolicName)
Returns the resolved bundle with the specified symbolic name that has the highest version. |
static IBundleGroupProvider[] |
getBundleGroupProviders()
Returns the currently registered bundle group providers |
static org.osgi.framework.Bundle[] |
getBundles(java.lang.String symbolicName,
java.lang.String version)
Returns all bundles with the specified symbolic name. |
static java.lang.String[] |
getCommandLineArgs()
Returns the command line args provided to the Eclipse runtime layer when it was first run. |
static org.eclipse.osgi.service.datalocation.Location |
getConfigurationLocation()
Returns the location of the configuration information used to run this instance of Eclipse. |
static org.eclipse.core.runtime.content.IContentTypeManager |
getContentTypeManager()
Returns the content type manager. |
static java.lang.String |
getDebugOption(java.lang.String option)
Returns the identified option. |
static IExtensionRegistry |
getExtensionRegistry()
Returns the extension registry for this platform. |
static org.osgi.framework.Bundle[] |
getFragments(org.osgi.framework.Bundle bundle)
Returns an array of attached fragment bundles for the specified bundle. |
static org.osgi.framework.Bundle[] |
getHosts(org.osgi.framework.Bundle bundle)
Returns an array of host bundles that the specified fragment bundle is attached to or null if the specified bundle is not attached to a host. |
static org.eclipse.osgi.service.datalocation.Location |
getInstallLocation()
Returns the location of the base installation for the running platform null is returned if the platform is running without a configuration location. |
static org.eclipse.osgi.service.datalocation.Location |
getInstanceLocation()
Returns the location of the platform's working directory (also known as the instance data area). |
static org.eclipse.core.runtime.jobs.IJobManager |
getJobManager()
Returns the platform job manager. |
static IPath |
getLocation()
Returns the location of the platform working directory. |
static ILog |
getLog(org.osgi.framework.Bundle bundle)
Returns the log for the given bundle. |
static IPath |
getLogFileLocation()
Returns the location of the platform log file. |
static java.lang.String |
getNL()
Returns the string name of the current locale for use in finding files whose path starts with $nl$. |
static java.lang.String |
getOS()
Returns the string name of the current operating system for use in finding files whose path starts with $os$. |
static java.lang.String |
getOSArch()
Returns the string name of the current system architecture. |
static org.eclipse.osgi.service.resolver.PlatformAdmin |
getPlatformAdmin()
Returns the platform administrator for this running Eclipse. |
static Plugin |
getPlugin(java.lang.String id)
Deprecated. This method only works if the compatibility layer is installed and must not be used otherwise. See the comments on IPluginDescriptor.getPlugin() 55 for details. |
static IPluginRegistry |
getPluginRegistry()
Deprecated. IPluginRegistry was refactored in Eclipse 3.0.
This method only works if the compatibility layer is installed and must not be used otherwise.
See the comments on IPluginRegistry and its methods for details. |
static IPath |
getPluginStateLocation(Plugin plugin)
Returns the location in the local file system of the plug-in state area for the given plug-in. |
static org.eclipse.core.runtime.preferences.IPreferencesService |
getPreferencesService()
Return the interface into the preference mechanism. |
static IProduct |
getProduct()
Returns the product which was selected when running this Eclipse instance or null if none |
static java.lang.String |
getProtectionSpace(java.net.URL resourceUrl)
Returns the protection space (realm) for the specified resource, or null if the realm is unknown. |
static java.util.ResourceBundle |
getResourceBundle(org.osgi.framework.Bundle bundle)
Returns the given bundle's resource bundle for the current locale. |
static java.lang.String |
getResourceString(org.osgi.framework.Bundle bundle,
java.lang.String value)
Returns a resource string corresponding to the given argument value. |
static java.lang.String |
getResourceString(org.osgi.framework.Bundle bundle,
java.lang.String value,
java.util.ResourceBundle resourceBundle)
Returns a resource string corresponding to the given argument value and resource bundle in the given runtime bundle. |
static IPath |
getStateLocation(org.osgi.framework.Bundle bundle)
Returns the location in the local file system of the plug-in state area for the given bundle. |
static org.eclipse.osgi.service.datalocation.Location |
getUserLocation()
Returns the location of the platform's user data area. |
static java.lang.String |
getWS()
Returns the string name of the current window system for use in finding files whose path starts with $ws$. |
static boolean |
inDebugMode()
Returns true if the platform is currently running in
debug mode. |
static boolean |
inDevelopmentMode()
Returns true if the platform is currently running in
development mode. |
static boolean |
isFragment(org.osgi.framework.Bundle bundle)
Checks if the specified bundle is a fragment bundle. |
static boolean |
isRunning()
Returns whether the platform is running. |
static java.lang.String[] |
knownOSArchValues()
Returns a list of known system architectures. |
static java.lang.String[] |
knownOSValues()
Returns a list of known operating system names. |
static java.lang.String[] |
knownWSValues()
Returns a list of known windowing system names. |
static void |
registerBundleGroupProvider(IBundleGroupProvider provider)
Registers the given bundle group provider with the platform |
static void |
removeLogListener(ILogListener listener)
Removes the indicated (identical) log listener from the notification list of the platform. |
static java.net.URL |
resolve(java.net.URL url)
Returns a URL which is the resolved equivalent of the supplied URL. |
static void |
run(ISafeRunnable runnable)
Runs the given runnable in a protected mode. |
static void |
unregisterBundleGroupProvider(IBundleGroupProvider provider)
Deregisters the given bundle group provider with the platform |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
PI_RUNTIME
public static final java.lang.String PI_RUNTIME
- The unique identifier constant (value "
org.eclipse.core.runtime") of the Core Runtime (pseudo-) plug-in.- See Also:
- Constant Field Values
PT_APPLICATIONS
public static final java.lang.String PT_APPLICATIONS
- The simple identifier constant (value "
applications") of the extension point of the Core Runtime plug-in where plug-ins declare the existence of runnable applications. A plug-in may define any number of applications; however, the platform is only capable of running one application at a time.- See Also:
- Constant Field Values
PT_ADAPTERS
public static final java.lang.String PT_ADAPTERS
- The simple identifier constant (value "
adapters") of the extension point of the Core Runtime plug-in where plug-ins declare the existence of adapter factories. A plug-in may define any number of adapters.- Since:
- 3.0
- See Also:
IAdapterManager.hasAdapter(Object, String)55 , Constant Field Values
PT_PREFERENCES
public static final java.lang.String PT_PREFERENCES
- The simple identifier constant (value "
preferences") of the extension point of the Core Runtime plug-in where plug-ins declare extensions to the preference facility. A plug-in may define any number of preference extensions.- Since:
- 3.0
- See Also:
getPreferencesService()55 , Constant Field Values
PT_PRODUCT
public static final java.lang.String PT_PRODUCT
- The simple identifier constant (value "
products") of the extension point of the Core Runtime plug-in where plug-ins declare the existence of a product. A plug-in may define any number of products; however, the platform is only capable of running one product at a time.- Since:
- 3.0
- See Also:
getProduct()55 , Constant Field Values
OPTION_STARTTIME
public static final java.lang.String OPTION_STARTTIME
- Debug option value denoting the time at which the platform runtime
was started. This constant can be used in conjunction with
getDebugOptionto find the string value ofSystem.currentTimeMillis()when the platform was started.- See Also:
- Constant Field Values
PREF_PLATFORM_PERFORMANCE
public static final java.lang.String PREF_PLATFORM_PERFORMANCE
- Name of a preference for configuring the performance level for this system.
This value can be used by all components to customize features to suit the speed of the user's machine. The platform job manager uses this value to make scheduling decisions about background jobs.
The preference value must be an integer between the constant values MIN_PERFORMANCE and MAX_PERFORMANCE
- Since:
- 3.0
- See Also:
MIN_PERFORMANCE55 ,MAX_PERFORMANCE55 , Constant Field Values
MIN_PERFORMANCE
public static final int MIN_PERFORMANCE
- Constant (value 1) indicating the minimum allowed value for the
PREF_PLATFORM_PERFORMANCEpreference setting.- Since:
- 3.0
- See Also:
- Constant Field Values
MAX_PERFORMANCE
public static final int MAX_PERFORMANCE
- Constant (value 5) indicating the maximum allowed value for the
PREF_PLATFORM_PERFORMANCEpreference setting.- Since:
- 3.0
- See Also:
- Constant Field Values
PARSE_PROBLEM
public static final int PARSE_PROBLEM
- Status code constant (value 1) indicating a problem in a plug-in
manifest (
plugin.xml) file.- See Also:
- Constant Field Values
PLUGIN_ERROR
public static final int PLUGIN_ERROR
- Status code constant (value 2) indicating an error occurred while running a plug-in.
- See Also:
- Constant Field Values
INTERNAL_ERROR
public static final int INTERNAL_ERROR
- Status code constant (value 3) indicating an error internal to the
platform has occurred.
- See Also:
- Constant Field Values
FAILED_READ_METADATA
public static final int FAILED_READ_METADATA
- Status code constant (value 4) indicating the platform could not read
some of its metadata.
- See Also:
- Constant Field Values
FAILED_WRITE_METADATA
public static final int FAILED_WRITE_METADATA
- Status code constant (value 5) indicating the platform could not write
some of its metadata.
- See Also:
- Constant Field Values
FAILED_DELETE_METADATA
public static final int FAILED_DELETE_METADATA
- Status code constant (value 6) indicating the platform could not delete
some of its metadata.
- See Also:
- Constant Field Values
OS_WIN32
public static final java.lang.String OS_WIN32
- Constant string (value "win32") indicating the platform is running on a
Window 32-bit operating system (e.g., Windows 98, NT, 2000).
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_LINUX
public static final java.lang.String OS_LINUX
- Constant string (value "linux") indicating the platform is running on a
Linux-based operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_AIX
public static final java.lang.String OS_AIX
- Constant string (value "aix") indicating the platform is running on an
AIX-based operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_SOLARIS
public static final java.lang.String OS_SOLARIS
- Constant string (value "solaris") indicating the platform is running on a
Solaris-based operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_HPUX
public static final java.lang.String OS_HPUX
- Constant string (value "hpux") indicating the platform is running on an
HP/UX-based operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_QNX
public static final java.lang.String OS_QNX
- Constant string (value "qnx") indicating the platform is running on a
QNX-based operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_MACOSX
public static final java.lang.String OS_MACOSX
- Constant string (value "macosx") indicating the platform is running on a
Mac OS X operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
OS_UNKNOWN
public static final java.lang.String OS_UNKNOWN
- Constant string (value "unknown") indicating the platform is running on a
machine running an unknown operating system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
ARCH_X86
public static final java.lang.String ARCH_X86
- Constant string (value "x86") indicating the platform is running on an
x86-based architecture.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
ARCH_PA_RISC
public static final java.lang.String ARCH_PA_RISC
- Constant string (value "PA_RISC") indicating the platform is running on an
PA_RISC-based architecture.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
ARCH_PPC
public static final java.lang.String ARCH_PPC
- Constant string (value "ppc") indicating the platform is running on an
PowerPC-based architecture.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
ARCH_SPARC
public static final java.lang.String ARCH_SPARC
- Constant string (value "sparc") indicating the platform is running on an
Sparc-based architecture.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
ARCH_AMD64
public static final java.lang.String ARCH_AMD64
- Constant string (value "amd64") indicating the platform is running on an
AMD64-based architecture.
- Since:
- 3.0
- See Also:
- Constant Field Values
ARCH_IA64
public static final java.lang.String ARCH_IA64
- Constant string (value "ia64") indicating the platform is running on an
IA64-based architecture.
- Since:
- 3.0
- See Also:
- Constant Field Values
WS_WIN32
public static final java.lang.String WS_WIN32
- Constant string (value "win32") indicating the platform is running on a
machine using the Windows windowing system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
WS_MOTIF
public static final java.lang.String WS_MOTIF
- Constant string (value "motif") indicating the platform is running on a
machine using the Motif windowing system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
WS_GTK
public static final java.lang.String WS_GTK
- Constant string (value "gtk") indicating the platform is running on a
machine using the GTK windowing system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
WS_PHOTON
public static final java.lang.String WS_PHOTON
- Constant string (value "photon") indicating the platform is running on a
machine using the Photon windowing system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
WS_CARBON
public static final java.lang.String WS_CARBON
- Constant string (value "carbon") indicating the platform is running on a
machine using the Carbon windowing system (Mac OS X).
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
WS_UNKNOWN
public static final java.lang.String WS_UNKNOWN
- Constant string (value "unknown") indicating the platform is running on a
machine running an unknown windowing system.
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
- Since:
- 3.0
- See Also:
- Constant Field Values
| Constructor Detail |
Platform
private Platform()
- Private constructor to block instance creation.
| Method Detail |
addAuthorizationInfo
public static void addAuthorizationInfo(java.net.URL serverUrl, java.lang.String realm, java.lang.String authScheme, java.util.Map info) throws CoreException
- Adds the given authorization information to the keyring. The
information is relevant for the specified protection space and the
given authorization scheme. The protection space is defined by the
combination of the given server URL and realm. The authorization
scheme determines what the authorization information contains and how
it should be used. The authorization information is a
MapofStringtoStringand typically contains information such as usernames and passwords.
addLogListener
public static void addLogListener(ILogListener listener)
- Adds the given log listener to the notification list of the platform.
Once registered, a listener starts receiving notification as entries are added to plug-in logs via
ILog.log(). The listener continues to receive notifications until it is replaced or removed.
addProtectionSpace
public static void addProtectionSpace(java.net.URL resourceUrl, java.lang.String realm) throws CoreException
- Adds the specified resource to the protection space specified by the
given realm. All targets at or deeper than the depth of the last
symbolic element in the path of the given resource URL are assumed to
be in the same protection space.
asLocalURL
public static java.net.URL asLocalURL(java.net.URL url) throws java.io.IOException
- Returns a URL which is the local equivalent of the
supplied URL. This method is expected to be used with the
plug-in-relative URLs returned by IPluginDescriptor, Bundle.getEntry()
and Platform.find().
If the specified URL is not a plug-in-relative URL, it
is returned asis. If the specified URL is a plug-in-relative
URL of a file (incl. .jar archive), it is returned as
a locally-accessible URL using "file:" or "jar:file:" protocol
(caching the file locally, if required). If the specified URL
is a plug-in-relative URL of a directory,
an exception is thrown.
endSplash
public static void endSplash()
- Takes down the splash screen if one was put up.
flushAuthorizationInfo
public static void flushAuthorizationInfo(java.net.URL serverUrl, java.lang.String realm, java.lang.String authScheme) throws CoreException
- Removes the authorization information for the specified protection
space and given authorization scheme. The protection space is defined
by the given server URL and realm.
getAdapterManager
public static IAdapterManager getAdapterManager()
- Returns the adapter manager used for extending
IAdaptableobjects.
getAuthorizationInfo
public static java.util.Map getAuthorizationInfo(java.net.URL serverUrl, java.lang.String realm, java.lang.String authScheme)
- Returns the authorization information for the specified protection
space and given authorization scheme. The protection space is defined
by the given server URL and realm. Returns
nullif no such information exists.
getCommandLineArgs
public static java.lang.String[] getCommandLineArgs()
- Returns the command line args provided to the Eclipse runtime layer when it was first run.
The returned value does not include arguments consumed by the lower levels of Eclipse
(e.g., OSGi or the launcher).
Note that individual platform runnables may be provided with different arguments
if they are being run individually rather than with
Platform.run().
getContentTypeManager
public static org.eclipse.core.runtime.content.IContentTypeManager getContentTypeManager()
- Returns the content type manager.
- Since:
- 3.0
getDebugOption
public static java.lang.String getDebugOption(java.lang.String option)
- Returns the identified option.
nullis returned if no such option is found. Options are specified in the general form <plug-in id>/<option-path>. For example,org.eclipse.core.runtime/debug
getLocation
public static IPath getLocation() throws java.lang.IllegalStateException
- Returns the location of the platform working directory.
Callers of this method should consider using
getInstanceLocationinstead. In various, typically non IDE-related configurations of Eclipse, the platform working directory may not be on the local filesystem. As such, the more general form of this location is as a URL.
getLogFileLocation
public static IPath getLogFileLocation()
- Returns the location of the platform log file. This file may contain information
about errors that have previously occurred during this invocation of the Platform.
It is recommended not to keep this value, as the log location may vary when an instance
location is being set.
s
Note: it is very important that users of this method do not leave the log
file open for extended periods of time. Doing so may prevent others
from writing to the log file, which could result in important error messages
being lost. It is strongly recommended that clients wanting to read the
log file for extended periods should copy the log file contents elsewhere,
and immediately close the original file.
getPlugin
public static Plugin getPlugin(java.lang.String id)
- Deprecated. This method only works if the compatibility layer is installed and must not be used otherwise.
See the comments on
IPluginDescriptor.getPlugin()55 for details.- Returns the plug-in runtime object for the identified plug-in or
nullif no such plug-in can be found. If the plug-in is defined but not yet activated, the plug-in will be activated before being returned.Note: This method is only able to find and return plug-in objects for plug-ins described using plugin.xml according to the traditional Eclipse conventions. Eclipse 3.0 permits plug-ins to be described in manifest.mf files and to define their own bundle activators. Such plug-ins cannot be discovered by this method.
- Returns the plug-in runtime object for the identified plug-in or
getPluginRegistry
public static IPluginRegistry getPluginRegistry()
- Deprecated.
IPluginRegistrywas refactored in Eclipse 3.0. This method only works if the compatibility layer is installed and must not be used otherwise. See the comments on IPluginRegistry and its methods for details.- Returns the plug-in registry for this platform.
- Returns the plug-in registry for this platform.
getPluginStateLocation
public static IPath getPluginStateLocation(Plugin plugin)
- Returns the location in the local file system of the plug-in
state area for the given plug-in.
The platform must be running.
The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings.
getProtectionSpace
public static java.lang.String getProtectionSpace(java.net.URL resourceUrl)
- Returns the protection space (realm) for the specified resource, or
nullif the realm is unknown.
removeLogListener
public static void removeLogListener(ILogListener listener)
- Removes the indicated (identical) log listener from the notification list
of the platform. If no such listener exists, no action is taken.
resolve
public static java.net.URL resolve(java.net.URL url) throws java.io.IOException
- Returns a URL which is the resolved equivalent of the
supplied URL. This method is expected to be used with the
plug-in-relative URLs returned by IPluginDescriptor, Bundle.getEntry()
and Platform.find().
If the specified URL is not a plug-in-relative URL, it is returned as is. If the specified URL is a plug-in-relative URL, this method attempts to reduce the given URL to one which is native to the Java class library (eg. file, http, etc).
Note however that users of this API should not assume too much about the results of this method. While it may consistently return a file: URL in certain installation configurations, others may result in jar: or http: URLs.
run
public static void run(ISafeRunnable runnable)
- Runs the given runnable in a protected mode. Exceptions
thrown in the runnable are logged and passed to the runnable's
exception handler. Such exceptions are not rethrown by this method.
getJobManager
public static org.eclipse.core.runtime.jobs.IJobManager getJobManager()
- Returns the platform job manager.
- Since:
- 3.0
getExtensionRegistry
public static IExtensionRegistry getExtensionRegistry()
- Returns the extension registry for this platform.
- Since:
- 3.0
find
public static java.net.URL find(org.osgi.framework.Bundle bundle, IPath path)
- Returns a URL for the given path in the given bundle. Returns
nullif the URL could not be computed or created.- Since:
- 3.0
find
public static java.net.URL find(org.osgi.framework.Bundle bundle, IPath path, java.util.Map override)
- Returns a URL for the given path in the given bundle. Returns
nullif the URL could not be computed or created.find looks for this path in given bundle and any attached fragments.
nullis returned if no such entry is found. Note that there is no specific order to the fragments.The following arguments may also be used
$nl$ - for language specific information $os$ - for operating system specific information $ws$ - for windowing system specific informationA path of $nl$/about.properties in an environment with a default locale of en_CA will return a URL corresponding to the first place about.properties is found according to the following order:
plugin root/nl/en/CA/about.properties fragment1 root/nl/en/CA/about.properties fragment2 root/nl/en/CA/about.properties ... plugin root/nl/en/about.properties fragment1 root/nl/en/about.properties fragment2 root/nl/en/about.properties ... plugin root/about.properties fragment1 root/about.properties fragment2 root/about.properties ...The current environment variable values can be overridden using the override map argument.
- Since:
- 3.0
getStateLocation
public static IPath getStateLocation(org.osgi.framework.Bundle bundle)
- Returns the location in the local file system of the
plug-in state area for the given bundle.
If the plug-in state area did not exist prior to this call,
it is created.
The plug-in state area is a file directory within the platform's metadata area where a plug-in is free to create files. The content and structure of this area is defined by the plug-in, and the particular plug-in is solely responsible for any files it puts there. It is recommended for plug-in preference settings and other configuration parameters.
- Since:
- 3.0
getLog
public static ILog getLog(org.osgi.framework.Bundle bundle)
- Returns the log for the given bundle. If no such log exists, one is created.
- Since:
- 3.0
getResourceBundle
public static java.util.ResourceBundle getResourceBundle(org.osgi.framework.Bundle bundle) throws java.util.MissingResourceException
- Returns the given bundle's resource bundle for the current locale.
The resource bundle is typcially stored as the
plugin.propertiesfile in the plug-in itself, and contains any translatable strings used in the plug-in manifest file (plugin.xml) along with other resource strings used by the plug-in implementation.- Since:
- 3.0
getResourceString
public static java.lang.String getResourceString(org.osgi.framework.Bundle bundle, java.lang.String value)
- Returns a resource string corresponding to the given argument value.
If the argument value specifies a resource key, the string
is looked up in the default resource bundle for the given runtime bundle. If the argument does not
specify a valid key, the argument itself is returned as the
resource string. The key lookup is performed in the
file referenced in the Bundle-Localization header of the bundle manifest. If a resource string
corresponding to the key is not found in the resource bundle
the key value, or any default text following the key in the
argument value is returned as the resource string.
A key is identified as a string begining with the "%" character.
Note, that the "%" character is stripped off prior to lookup
in the resource bundle.
Equivalent to
getResourceString(bundle, value, getResourceBundle())- Since:
- 3.0
getResourceString
public static java.lang.String getResourceString(org.osgi.framework.Bundle bundle, java.lang.String value, java.util.ResourceBundle resourceBundle)
- Returns a resource string corresponding to the given argument
value and resource bundle in the given runtime bundle.
If the argument value specifies a resource key, the string
is looked up in the given resource bundle. If the argument does not
specify a valid key, the argument itself is returned as the
resource string. The key lookup is performed against the
specified resource bundle. If a resource string
corresponding to the key is not found in the resource bundle
the key value, or any default text following the key in the
argument value is returned as the resource string.
A key is identified as a string begining with the "%" character.
Note that the "%" character is stripped off prior to lookup
in the resource bundle.
For example, assume resource bundle plugin.properties contains name = Project Name
getResourceString("Hello World") returns "Hello World" getResourceString("%name") returns "Project Name" getResourceString("%name Hello World") returns "Project Name" getResourceString("%abcd Hello World") returns "Hello World" getResourceString("%abcd") returns "%abcd" getResourceString("%%name") returns "%name"- Since:
- 3.0
getOSArch
public static java.lang.String getOSArch()
- Returns the string name of the current system architecture.
The value is a user-defined string if the architecture is
specified on the command line, otherwise it is the value
returned by
java.lang.System.getProperty("os.arch").- Since:
- 3.0
getNL
public static java.lang.String getNL()
- Returns the string name of the current locale for use in finding files
whose path starts with
$nl$.- Since:
- 3.0
getOS
public static java.lang.String getOS()
- Returns the string name of the current operating system for use in finding
files whose path starts with
$os$.OS_UNKNOWNis returned if the operating system cannot be determined. The value may indicate one of the operating systems known to the platform (as specified inknownOSValues) or a user-defined string if the operating system name is specified on the command line.- Since:
- 3.0
getWS
public static java.lang.String getWS()
- Returns the string name of the current window system for use in finding files
whose path starts with
$ws$.nullis returned if the window system cannot be determined.- Since:
- 3.0
getApplicationArgs
public static java.lang.String[] getApplicationArgs()
- Returns the arguments not consumed by the framework implementation itself. Which
arguments are consumed is implementation specific. These arguments are available
for use by the application.
- Since:
- 3.0
getPlatformAdmin
public static org.eclipse.osgi.service.resolver.PlatformAdmin getPlatformAdmin()
- Returns the platform administrator for this running Eclipse.
Note: This is an early access API to the new OSGI-based Eclipse 3.0 Platform Runtime. Because the APIs for the new runtime have not yet been full stabilized, they should only be used by clients needing to take particular advantage of new OSGI-specific functionality, and only then with the understanding that these APIs are likely to change in incompatible ways until they reach their finished, stable form (post-3.0).
getInstanceLocation
public static org.eclipse.osgi.service.datalocation.Location getInstanceLocation()
- Returns the location of the platform's working directory (also known as the instance data area).
nullis returned if the platform is running without an instance location.This method is equivalent to acquiring the
org.eclipse.osgi.service.datalocation.Locationservice with the property "type" = "osgi.instance.area".- Since:
- 3.0
getBundleGroupProviders
public static IBundleGroupProvider[] getBundleGroupProviders()
- Returns the currently registered bundle group providers
- Since:
- 3.0
getPreferencesService
public static org.eclipse.core.runtime.preferences.IPreferencesService getPreferencesService()
- Return the interface into the preference mechanism. The returned
object can be used for such operations as searching for preference
values across multiple scopes and preference import/export.
- Since:
- 3.0
getProduct
public static IProduct getProduct()
- Returns the product which was selected when running this Eclipse instance
or
nullif none- Since:
- 3.0
registerBundleGroupProvider
public static void registerBundleGroupProvider(IBundleGroupProvider provider)
- Registers the given bundle group provider with the platform
- Since:
- 3.0
unregisterBundleGroupProvider
public static void unregisterBundleGroupProvider(IBundleGroupProvider provider)
- Deregisters the given bundle group provider with the platform
- Since:
- 3.0
getConfigurationLocation
public static org.eclipse.osgi.service.datalocation.Location getConfigurationLocation()
- Returns the location of the configuration information
used to run this instance of Eclipse. The configuration area typically
contains the list of plug-ins available for use, various setttings
(those shared across different instances of the same configuration)
and any other such data needed by plug-ins.
nullis returned if the platform is running without a configuration location.This method is equivalent to acquiring the
org.eclipse.osgi.service.datalocation.Locationservice with the property "type" = "osgi.configuration.area".- Since:
- 3.0
getUserLocation
public static org.eclipse.osgi.service.datalocation.Location getUserLocation()
- Returns the location of the platform's user data area. The user data area is a location on the system
which is specific to the system's current user. By default it is located relative to the
location given by the System property "user.home".
nullis returned if the platform is running without an user location.This method is equivalent to acquiring the
org.eclipse.osgi.service.datalocation.Locationservice with the property "type" = "osgi.user.area".- Since:
- 3.0
getInstallLocation
public static org.eclipse.osgi.service.datalocation.Location getInstallLocation()
- Returns the location of the base installation for the running platform
nullis returned if the platform is running without a configuration location.This method is equivalent to acquiring the
org.eclipse.osgi.service.datalocation.Locationservice with the property "type" = "osgi.install.area".- Since:
- 3.0
isFragment
public static boolean isFragment(org.osgi.framework.Bundle bundle)
- Checks if the specified bundle is a fragment bundle.
- Since:
- 3.0
getFragments
public static org.osgi.framework.Bundle[] getFragments(org.osgi.framework.Bundle bundle)
- Returns an array of attached fragment bundles for the specified bundle. If the
specified bundle is a fragment then null is returned. If no fragments are
attached to the specified bundle then null is returned.
- Since:
- 3.0
getBundle
public static org.osgi.framework.Bundle getBundle(java.lang.String symbolicName)
- Returns the resolved bundle with the specified symbolic name that has the
highest version. If no resolved bundles are installed that have the
specified symbolic name then null is returned.
- Since:
- 3.0
getBundles
public static org.osgi.framework.Bundle[] getBundles(java.lang.String symbolicName, java.lang.String version)
- Returns all bundles with the specified symbolic name. If no resolved bundles
with the specified symbolic name can be found, null is returned.
If the version argument is not null then only the Bundles that have
the specified symbolic name and a version greater than or equal to the
specified version are returned. The returned bundles are ordered in
descending bundle version order.
getHosts
public static org.osgi.framework.Bundle[] getHosts(org.osgi.framework.Bundle bundle)
- Returns an array of host bundles that the specified fragment bundle is
attached to or null if the specified bundle is not attached to a host.
If the bundle is not a fragment bundle then null is returned.
- Since:
- 3.0
isRunning
public static boolean isRunning()
- Returns whether the platform is running.
- Since:
- 3.0
knownOSArchValues
public static java.lang.String[] knownOSArchValues()
- Returns a list of known system architectures.
Note that this list is not authoritative; there may be legal values not included in this list. Indeed, the value returned by
getOSArchmay not be in this list. Also, this list may change over time as Eclipse comes to run on more operating environments.- Since:
- 3.0
knownOSValues
public static java.lang.String[] knownOSValues()
- Returns a list of known operating system names.
Note that this list is not authoritative; there may be legal values not included in this list. Indeed, the value returned by
getOSmay not be in this list. Also, this list may change over time as Eclipse comes to run on more operating environments.- Since:
- 3.0
knownWSValues
public static java.lang.String[] knownWSValues()
- Returns a list of known windowing system names.
Note that this list is not authoritative; there may be legal values not included in this list. Indeed, the value returned by
getWSmay not be in this list. Also, this list may change over time as Eclipse comes to run on more operating environments.- Since:
- 3.0
inDebugMode
public static boolean inDebugMode()
- Returns
trueif the platform is currently running in debug mode. The platform is typically put in debug mode using the "-debug" command line argument.- Since:
- 3.0
inDevelopmentMode
public static boolean inDevelopmentMode()
- Returns
trueif the platform is currently running in development mode. That is, if special procedures are to be taken when defining plug-in class paths. The platform is typically put in development mode using the "-dev" command line argument.- Since:
- 3.0
|
|||||||||
| Home >> All >> org >> eclipse >> core >> [ runtime overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.eclipse.core.runtime.Platform