public final class Platform extends Object
Most users don't have to worry about Platform's lifecycle. However, if your
code can call methods of this class when Platform is not running, it becomes
necessary to check isRunning()
before making the call. A runtime
exception might be thrown or incorrect result might be returned if a method
from this class is called while Platform is not running.
Modifier and Type | Field and Description |
---|---|
static String |
ARCH_AMD64
Deprecated.
use
ARCH_X86_64 instead. Note the values
has been changed to be the value of the ARCH_X86_64 constant. |
static String |
ARCH_IA64
Constant string (value "ia64") indicating the platform is running on an
IA64-based architecture.
|
static String |
ARCH_IA64_32
Constant string (value "ia64_32") indicating the platform is running on an
IA64 32bit-based architecture.
|
static String |
ARCH_PA_RISC
Constant string (value "PA_RISC") indicating the platform is running on an
PA_RISC-based architecture.
|
static String |
ARCH_PPC
Constant string (value "ppc") indicating the platform is running on an
PowerPC-based architecture.
|
static String |
ARCH_SPARC
Constant string (value "sparc") indicating the platform is running on an
Sparc-based architecture.
|
static String |
ARCH_X86
Constant string (value "x86") indicating the platform is running on an
x86-based architecture.
|
static String |
ARCH_X86_64
Constant string (value "x86_64") indicating the platform is running on an
x86 64bit-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 String |
OPTION_STARTTIME
Debug option value denoting the time at which the platform runtime
was started.
|
static String |
OS_AIX
Constant string (value "aix") indicating the platform is running on an
AIX-based operating system.
|
static String |
OS_HPUX
Constant string (value "hpux") indicating the platform is running on an
HP/UX-based operating system.
|
static String |
OS_LINUX
Constant string (value "linux") indicating the platform is running on a
Linux-based operating system.
|
static String |
OS_MACOSX
Constant string (value "macosx") indicating the platform is running on a
Mac OS X operating system.
|
static String |
OS_QNX
Constant string (value "qnx") indicating the platform is running on a
QNX-based operating system.
|
static String |
OS_SOLARIS
Constant string (value "solaris") indicating the platform is running on a
Solaris-based operating system.
|
static String |
OS_UNKNOWN
Constant string (value "unknown") indicating the platform is running on a
machine running an unknown operating system.
|
static 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 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 String |
PREF_LINE_SEPARATOR
Constant (value "line.separator") name of the preference used for storing
the line separator.
|
static String |
PREF_PLATFORM_PERFORMANCE
Name of a preference for configuring the performance level for this system.
|
static 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 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 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 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 String |
WS_CARBON
Constant string (value "carbon") indicating the platform is running on a
machine using the Carbon windowing system (Mac OS X).
|
static String |
WS_COCOA
Constant string (value "cocoa") indicating the platform is running on a
machine using the Cocoa windowing system (Mac OS X).
|
static String |
WS_GTK
Constant string (value "gtk") indicating the platform is running on a
machine using the GTK windowing system.
|
static String |
WS_MOTIF
Constant string (value "motif") indicating the platform is running on a
machine using the Motif windowing system.
|
static String |
WS_PHOTON
Constant string (value "photon") indicating the platform is running on a
machine using the Photon windowing system.
|
static String |
WS_UNKNOWN
Constant string (value "unknown") indicating the platform is running on a
machine running an unknown windowing system.
|
static String |
WS_WIN32
Constant string (value "win32") indicating the platform is running on a
machine using the Windows windowing system.
|
static String |
WS_WPF
Constant string (value "wpf") indicating the platform is running on a
machine using the WPF windowing system.
|
Modifier and Type | Method and Description |
---|---|
static void |
addAuthorizationInfo(URL serverUrl,
String realm,
String authScheme,
Map<String,String> info)
Deprecated.
Authorization database is superseded by the Equinox secure storage.
Use
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
Consider using ISecurePreferences#put(String, String, boolean) as a replacement of this method.
This API will be deleted in a future release. See bug 370248 for details. |
static void |
addLogListener(ILogListener listener)
Adds the given log listener to the notification list of the platform.
|
static void |
addProtectionSpace(URL resourceUrl,
String realm)
Deprecated.
Authorization database is superseded by the Equinox secure storage.
Use
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
This API will be deleted in a future release. See bug 370248 for details. |
static URL |
asLocalURL(URL url)
Deprecated.
use
FileLocator.toFileURL(URL) instead |
static void |
endSplash()
Deprecated.
use
IApplicationContext.applicationRunning() instead |
static URL |
find(Bundle bundle,
IPath path)
Deprecated.
|
static URL |
find(Bundle bundle,
IPath path,
Map<String,String> override)
Deprecated.
use
FileLocator.find(Bundle, IPath, Map) instead |
static void |
flushAuthorizationInfo(URL serverUrl,
String realm,
String authScheme)
Deprecated.
Authorization database is superseded by the Equinox secure storage.
Use
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
Consider using ISecurePreferences#clear() as a replacement of this method.
This API will be deleted in a future release. See bug 370248 for details. |
static IAdapterManager |
getAdapterManager()
Returns the adapter manager used for extending
IAdaptable objects. |
static String[] |
getApplicationArgs()
Returns the arguments not consumed by the framework implementation itself.
|
static Map<String,String> |
getAuthorizationInfo(URL serverUrl,
String realm,
String authScheme)
Deprecated.
Authorization database is superseded by the Equinox secure storage.
Use
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
Consider using ISecurePreferences#get(String, String) as a replacement of this method.
This API will be deleted in a future release. See bug 370248 for details. |
static Bundle |
getBundle(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 Bundle[] |
getBundles(String symbolicName,
String version)
Returns all bundles with the specified symbolic name.
|
static String[] |
getCommandLineArgs()
Returns the command line args provided to the Eclipse runtime layer when it was first run.
|
static Location |
getConfigurationLocation()
Returns the location of the configuration information
used to run this instance of Eclipse.
|
static IContentTypeManager |
getContentTypeManager()
Returns the content type manager.
|
static String |
getDebugOption(String option)
Returns the identified option.
|
static IExtensionRegistry |
getExtensionRegistry()
Returns the extension registry for this platform.
|
static Bundle[] |
getFragments(Bundle bundle)
Returns an array of attached fragment bundles for the specified bundle.
|
static Bundle[] |
getHosts(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 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 Location |
getInstanceLocation()
Returns the location of the platform's working directory (also known as the instance data area).
|
static IJobManager |
getJobManager()
Deprecated.
The method
Job.getJobManager() should be used instead. |
static IPath |
getLocation()
Returns the location of the platform working directory.
|
static ILog |
getLog(Bundle bundle)
Returns the log for the given bundle.
|
static IPath |
getLogFileLocation()
Returns the location of the platform log file.
|
static String |
getNL()
Returns the string name of the current locale for use in finding files
whose path starts with
$nl$ . |
static String |
getNLExtensions()
Returns Unicode locale extensions for the Unicode locale identifier, if they are
defined.
|
static String |
getOS()
Returns the string name of the current operating system for use in finding
files whose path starts with
$os$ . |
static String |
getOSArch()
Returns the string name of the current system architecture.
|
static PlatformAdmin |
getPlatformAdmin()
Returns the platform administrator for this running Eclipse.
|
static Plugin |
getPlugin(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() for details. |
static IPluginRegistry |
getPluginRegistry()
Deprecated.
use
getExtensionRegistry() instead.
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)
Deprecated.
clients should call
getStateLocation(Bundle) instead |
static 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 String |
getProtectionSpace(URL resourceUrl)
Deprecated.
Authorization database is superseded by the Equinox secure storage.
Use
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
This API will be deleted in a future release. See bug 370248 for details. |
static ResourceBundle |
getResourceBundle(Bundle bundle)
Returns the given bundle's resource bundle for the current locale.
|
static String |
getResourceString(Bundle bundle,
String value)
Returns a resource string corresponding to the given argument value.
|
static String |
getResourceString(Bundle bundle,
String value,
ResourceBundle resourceBundle)
Returns a resource string corresponding to the given argument
value and resource bundle in the given runtime bundle.
|
static IPath |
getStateLocation(Bundle bundle)
Returns the location in the local file system of the
plug-in state area for the given bundle.
|
static long |
getStateStamp()
Returns a number that changes whenever the set of installed plug-ins
changes.
|
static Location |
getUserLocation()
Returns the location of the platform's user data area.
|
static 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(Bundle bundle)
Checks if the specified bundle is a fragment bundle.
|
static boolean |
isRunning()
Returns whether the platform is running.
|
static String[] |
knownOSArchValues()
Returns a list of known system architectures.
|
static String[] |
knownOSValues()
Returns a list of known operating system names.
|
static Map<String,String> |
knownPlatformLineSeparators()
Returns a map of known platform line separators.
|
static 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 URL |
resolve(URL url)
Deprecated.
use
FileLocator.resolve(URL) instead |
static void |
run(ISafeRunnable runnable)
Deprecated.
clients should use
SafeRunner#run instead |
static void |
unregisterBundleGroupProvider(IBundleGroupProvider provider)
De-registers the given bundle group provider with the platform.
|
public static final String PI_RUNTIME
org.eclipse.core.runtime
")
of the Core Runtime (pseudo-) plug-in.public static final String PT_APPLICATIONS
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.public static final String PT_ADAPTERS
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.IAdapterManager.hasAdapter(Object, String)
,
Constant Field Valuespublic static final String PT_PREFERENCES
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.getPreferencesService()
,
Constant Field Valuespublic static final String PT_PRODUCT
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.getProduct()
,
Constant Field Valuespublic static final String OPTION_STARTTIME
getDebugOption
to find the string value of
System.currentTimeMillis()
when the platform was started.public static final String PREF_PLATFORM_PERFORMANCE
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
MIN_PERFORMANCE
,
MAX_PERFORMANCE
,
Constant Field Valuespublic static final String PREF_LINE_SEPARATOR
knownPlatformLineSeparators()
,
Constant Field Valuespublic static final int MIN_PERFORMANCE
PREF_PLATFORM_PERFORMANCE
preference setting.public static final int MAX_PERFORMANCE
PREF_PLATFORM_PERFORMANCE
preference setting.public static final int PARSE_PROBLEM
plugin.xml
) file.public static final int PLUGIN_ERROR
public static final int INTERNAL_ERROR
public static final int FAILED_READ_METADATA
public static final int FAILED_WRITE_METADATA
public static final int FAILED_DELETE_METADATA
public static final String OS_WIN32
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_LINUX
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_AIX
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_SOLARIS
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_HPUX
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_QNX
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_MACOSX
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String OS_UNKNOWN
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String ARCH_X86
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String ARCH_PA_RISC
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String ARCH_PPC
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String ARCH_SPARC
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String ARCH_X86_64
@Deprecated public static final String ARCH_AMD64
ARCH_X86_64
instead. Note the values
has been changed to be the value of the ARCH_X86_64
constant.public static final String ARCH_IA64
public static final String ARCH_IA64_32
public static final String WS_WIN32
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String WS_MOTIF
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String WS_GTK
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String WS_PHOTON
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String WS_CARBON
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
public static final String WS_COCOA
public static final String WS_WPF
public static final String WS_UNKNOWN
Note this constant has been moved from the deprecated org.eclipse.core.boot.BootLoader class and its value has not changed.
@Deprecated public static void addAuthorizationInfo(URL serverUrl, String realm, String authScheme, Map<String,String> info) throws CoreException
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
Consider using ISecurePreferences#put(String, String, boolean)
as a replacement of this method.
This API will be deleted in a future release. See bug 370248 for details.Map
of String
to String
and typically
contains information such as user names and passwords.serverUrl
- the URL identifying the server for this authorization
information. For example, "http://www.example.com/".realm
- the subsection of the given server to which this
authorization information applies. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which this authorization information
applies. For example, "Basic" or "" for no authorization schemeinfo
- a Map
containing authorization information
such as user names and passwords (key type : String
,
value type : String
)CoreException
- if there are problems setting the
authorization information. Reasons include:
public static void addLogListener(ILogListener listener)
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.
listener
- the listener to registerILog.addLogListener(ILogListener)
,
removeLogListener(ILogListener)
@Deprecated public static void addProtectionSpace(URL resourceUrl, String realm) throws CoreException
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
This API will be deleted in a future release. See bug 370248 for details.resourceUrl
- the URL identifying the resources to be added to
the specified protection space. For example,
"http://www.example.com/folder/".realm
- the name of the protection space. For example,
"realm1@example.com"CoreException
- if there are problems setting the
authorization information. Reasons include:
@Deprecated public static URL asLocalURL(URL url) throws IOException
FileLocator.toFileURL(URL)
insteadurl
- original plug-in-relative URL.IOException
- if unable to resolve URLresolve(URL)
,
find(Bundle, IPath)
,
Bundle.getEntry(String)
@Deprecated public static void endSplash()
IApplicationContext.applicationRunning()
instead@Deprecated public static void flushAuthorizationInfo(URL serverUrl, String realm, String authScheme) throws CoreException
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
Consider using ISecurePreferences#clear()
as a replacement of this method.
This API will be deleted in a future release. See bug 370248 for details.serverUrl
- the URL identifying the server to remove the
authorization information for. For example,
"http://www.example.com/".realm
- the subsection of the given server to remove the
authorization information for. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which the authorization information
to remove applies. For example, "Basic" or "" for no
authorization scheme.CoreException
- if there are problems removing the
authorization information. Reasons include:
public static IAdapterManager getAdapterManager()
IAdaptable
objects.IAdapterManager
@Deprecated public static Map<String,String> getAuthorizationInfo(URL serverUrl, String realm, String authScheme)
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
Consider using ISecurePreferences#get(String, String)
as a replacement of this method.
This API will be deleted in a future release. See bug 370248 for details.null
if no
such information exists.serverUrl
- the URL identifying the server for the authorization
information. For example, "http://www.example.com/".realm
- the subsection of the given server to which the
authorization information applies. For example,
"realm1@example.com" or "" for no realm.authScheme
- the scheme for which the authorization information
applies. For example, "Basic" or "" for no authorization schemenull
if no
such information existspublic static String[] getCommandLineArgs()
Platform.run()
.
Clients are also able to acquire the EnvironmentInfo
service and query it for
the command-line arguments.
public static IContentTypeManager getContentTypeManager()
Clients are also able to acquire the IContentTypeManager
service.
public static String getDebugOption(String option)
null
is 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
Clients are also able to acquire the DebugOptions
service
and query it for debug options.
option
- the name of the option to lookupnull
public static IPath getLocation() throws IllegalStateException
Callers of this method should consider using getInstanceLocation
instead. In various, typically non IDE-related configurations of Eclipse, the platform
working directory may not be on the local file system. As such, the more general
form of this location is as a URL.
Alternatively, instead of calling getInstanceLocation
clients are
able to acquire the Location
service (with the type Location.INSTANCE_FILTER
)
and then change the resulting URL to a path. See the javadoc for getInstanceLocation
for more details.
IllegalStateException
getInstanceLocation()
public static IPath getLogFileLocation()
It is recommended not to keep this value, as the log location may vary when an instance location is being set.
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.
@Deprecated public static Plugin getPlugin(String id)
IPluginDescriptor.getPlugin()
for details.null
if 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.
id
- the unique identifier of the desired plug-in
(e.g., "com.example.acme"
).null
@Deprecated public static IPluginRegistry getPluginRegistry()
getExtensionRegistry()
instead.
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.IPluginRegistry
@Deprecated public static IPath getPluginStateLocation(Plugin plugin)
getStateLocation(Bundle)
insteadThe 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.
plugin
- the plug-in whose state location is returned@Deprecated public static String getProtectionSpace(URL resourceUrl)
org.eclipse.equinox.security.storage.SecurePreferencesFactory
to obtain secure preferences and org.eclipse.equinox.security.storage.ISecurePreferences
for data access and modifications.
This API will be deleted in a future release. See bug 370248 for details.null
if the realm is unknown.resourceUrl
- the URL of the resource whose protection space is
returned. For example, "http://www.example.com/folder/".null
if the realm is unknownpublic static void removeLogListener(ILogListener listener)
listener
- the listener to de-registerILog.removeLogListener(ILogListener)
,
addLogListener(ILogListener)
@Deprecated public static URL resolve(URL url) throws IOException
FileLocator.resolve(URL)
insteadIf 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.
url
- original plug-in-relative URL.IOException
- if unable to resolve URLasLocalURL(URL)
,
find(Bundle, IPath)
,
Bundle.getEntry(String)
@Deprecated public static void run(ISafeRunnable runnable)
SafeRunner#run
insteadrunnable
- the runnable to run@Deprecated public static IJobManager getJobManager()
Job.getJobManager()
should be used instead.public static IExtensionRegistry getExtensionRegistry()
Note this method is purely a convenience and RegistryFactory.getRegistry()
should generally be used instead.
IExtensionRegistry
@Deprecated public static URL find(Bundle bundle, IPath path)
FileLocator.find(Bundle, IPath, Map)
null
if the URL
could not be computed or created.bundle
- the bundle in which to searchpath
- path relative to plug-in installation locationnull
. The actual form
of the returned URL is not specified.find(Bundle, IPath, Map)
,
resolve(URL)
,
asLocalURL(URL)
@Deprecated public static URL find(Bundle bundle, IPath path, Map<String,String> override)
FileLocator.find(Bundle, IPath, Map)
insteadnull
if the URL
could not be computed or created.
find looks for this path in given bundle and any attached fragments.
null
is 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 information
A 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.
bundle
- the bundle in which to searchpath
- file path relative to plug-in installation locationoverride
- map of override substitution arguments to be used for
any $arg$ path elements. The map keys correspond to the substitution
arguments (eg. "$nl$" or "$os$"). The resulting
values must be of type java.lang.String. If the map is null
,
or does not contain the required substitution argument, the default
is used.null
. The actual form
of the returned URL is not specified.resolve(URL)
,
asLocalURL(URL)
public static IPath getStateLocation(Bundle bundle)
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.
bundle
- the bundle whose state location if returnedpublic static long getStateStamp()
Clients are also able to acquire the PlatformAdmin
service
and get the timestamp from its state object.
public static ILog getLog(Bundle bundle)
bundle
- the bundle whose log is returnedpublic static ResourceBundle getResourceBundle(Bundle bundle) throws MissingResourceException
This resource bundle is typically stored as the plugin.properties file in the plug-in itself, and contains any translatable strings used in the plug-in manifest file (plugin.xml).
This mechanism is intended only for externalizing strings found in the plug-in manifest file. Using this method for externalizing strings in your code may result in degraded memory performance.
bundle
- the bundle whose resource bundle is being queriedMissingResourceException
- if the resource bundle was not foundpublic static String getResourceString(Bundle bundle, String value)
Equivalent to getResourceString(bundle, value, getResourceBundle())
bundle
- the bundle whose resource bundle is being queriedvalue
- the value to look forgetResourceBundle(Bundle)
public static String getResourceString(Bundle bundle, String value, ResourceBundle resourceBundle)
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"
bundle
- the bundle whose resource bundle is being queriedvalue
- the valueresourceBundle
- the resource bundle to querygetResourceBundle(Bundle)
public static String getOSArch()
java.lang.System.getProperty("os.arch")
.
Clients are also able to acquire the EnvironmentInfo
service and query it for
the operating-system architecture.
public static String getNL()
$nl$
.
Clients are also able to acquire the EnvironmentInfo
service and query it for
the NL.
public static String getNLExtensions()
For more information on Unicode locale extensions, see Unicode Technical Standard #35.
public static String getOS()
$os$
. OS_UNKNOWN
is
returned if the operating system cannot be determined.
The value may indicate one of the operating systems known to the platform
(as specified in knownOSValues
) or a user-defined string if
the operating system name is specified on the command line.
Clients are also able to acquire the EnvironmentInfo
service and query it for
the operating-system.
public static String getWS()
$ws$
. null
is returned
if the window system cannot be determined.
Clients are also able to acquire the EnvironmentInfo
service and query it for
the windowing system.
null
public static String[] getApplicationArgs()
public static PlatformAdmin getPlatformAdmin()
Note: This is an internal method and must not be used by clients which are not part of the Eclipse Platform. This method allows access to classes which are not Eclipse Platform API but are part of the OSGi runtime that the Eclipse Platform is built on. Even as the Eclipse Platform evolves in compatible ways from release to release, the details of the OSGi implementation might not.
Clients can also acquire the PlatformAdmin
service
to retrieve this object.
public static Location getInstanceLocation()
null
is returned if the platform is running without an instance location.
This method is equivalent to acquiring the org.eclipse.osgi.service.datalocation.Location
service with the property "type" equal to Location.INSTANCE_FILTER
.
null
if noneLocation.INSTANCE_FILTER
public static IBundleGroupProvider[] getBundleGroupProviders()
Clients are also able to acquire the IBundleGroupProvider
service and query it for
the registered bundle group providers.
public static IPreferencesService getPreferencesService()
Clients are also able to acquire the IPreferencesService
service via
OSGi mechanisms and use it for preference functions.
public static IProduct getProduct()
null
if nonenull
if nonepublic static void registerBundleGroupProvider(IBundleGroupProvider provider)
Clients are also able to use the IBundleGroupProvider
service to
register themselves as a bundle group provider.
provider
- a provider to registerpublic static void unregisterBundleGroupProvider(IBundleGroupProvider provider)
Clients are also able to use the IBundleGroupProvider
service mechanism
for unregistering themselves.
provider
- a provider to de-registerregisterBundleGroupProvider(IBundleGroupProvider)
public static Location getConfigurationLocation()
null
is returned if the platform is running without a configuration location.
This method is equivalent to acquiring the org.eclipse.osgi.service.datalocation.Location
service with the property "type" equal to Location.CONFIGURATION_FILTER
.
null
if noneLocation.CONFIGURATION_FILTER
public static Location getUserLocation()
null
is returned if the platform is running without an user location.
This method is equivalent to acquiring the org.eclipse.osgi.service.datalocation.Location
service with the property "type" equal to Location.USER_FILTER
.
null
if noneLocation.USER_FILTER
public static Location getInstallLocation()
null
is returned if the platform is running without a configuration location.
This method is equivalent to acquiring the org.eclipse.osgi.service.datalocation.Location
service with the property "type" equal to Location.INSTALL_FILTER
.
null
if noneLocation.INSTALL_FILTER
public static boolean isFragment(Bundle bundle)
Clients are also able to acquire the PackageAdmin
service
to query if the given bundle is a fragment by asking for the bundle type
and checking against constants on the service interface.
bundle
- the bundle to querypublic static Bundle[] getFragments(Bundle bundle)
Clients are also able to acquire the PackageAdmin
service and query
it for the fragments of the given bundle.
bundle
- the bundle to get the attached fragment bundles for.public static Bundle getBundle(String symbolicName)
Clients are also able to acquire the PackageAdmin
service and query
it for the bundle with the specified symbolic name. Clients can ask the
service for all bundles with that particular name and then determine the
one with the highest version. Note that clients may want to filter
the results based on the state of the bundles.
symbolicName
- the symbolic name of the bundle to be returned.public static Bundle[] getBundles(String symbolicName, String version)
Clients are also able to acquire the PackageAdmin
service and query
it for all bundle versions with the given symbolic name, after turning the
specific version into a version range. Note that clients may want to filter
the results based on the state of the bundles.
symbolicName
- the symbolic name of the bundles that are to be returned.version
- the version that the return bundle versions must match,
or null if no version matching is to be done.public static Bundle[] getHosts(Bundle bundle)
Clients are also able to acquire the PackageAdmin
service and query
it for the hosts for the given bundle.
bundle
- the bundle to get the host bundles for.public static boolean isRunning()
true
if the platform is running,
and false
otherwisepublic static String[] knownOSArchValues()
Note that this list is not authoritative; there may be legal values
not included in this list. Indeed, the value returned by
getOSArch
may not be in this list. Also, this list may
change over time as Eclipse comes to run on more operating environments.
getOSArch()
public static String[] knownOSValues()
Note that this list is not authoritative; there may be legal values
not included in this list. Indeed, the value returned by
getOS
may not be in this list. Also, this list may
change over time as Eclipse comes to run on more operating environments.
getOS()
public static Map<String,String> knownPlatformLineSeparators()
public static String[] knownWSValues()
Note that this list is not authoritative; there may be legal values
not included in this list. Indeed, the value returned by
getWS
may not be in this list. Also, this list may
change over time as Eclipse comes to run on more operating environments.
getWS()
public static boolean inDebugMode()
true
if the platform is currently running in
debug mode. The platform is typically put in debug mode using the
"-debug" command line argument.
Clients are also able to acquire the EnvironmentInfo
service and query it
to see if they are in debug mode.
public static boolean inDevelopmentMode()
true
if 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.
Clients are also able to acquire the EnvironmentInfo
service and query it
to see if they are in development mode.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.