Eclipse Platform
2.0

org.eclipse.core.resources
Class ResourcesPlugin

java.lang.Object
  |
  +--org.eclipse.core.runtime.Plugin
        |
        +--org.eclipse.core.resources.ResourcesPlugin

public final class ResourcesPlugin
extends Plugin

The plug-in runtime class for the Resources plug-in. This is the starting point for all workspace and resource manipulation. A typical sequence of events would be for a dependent plug-in to call ResourcesPlugin.getWorkspace(). Doing so would cause this plug-in to be activated and the workspace (if any) to be loaded from disk and initialized.


Field Summary
static String PI_RESOURCES
          Unique identifier constant (value "org.eclipse.core.resources") for the standard Resources plug-in.
static String PREF_ENCODING
          Name of a preference indicating the encoding to use when reading text files in the workspace.
static String PT_BUILDERS
          Simple identifier constant (value "builders") for the builders extension point.
static String PT_FILE_MODIFICATION_VALIDATOR
          Simple identifier constant (value "fileModificationValidator") for the file modification validator extension point.
static String PT_MARKERS
          Simple identifier constant (value "markers") for the markers extension point.
static String PT_MOVE_DELETE_HOOK
          Simple identifier constant (value "moveDeleteHook") for the move/delete hook extension point.
static String PT_NATURES
          Simple identifier constant (value "natures") for the natures extension point.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
ResourcesPlugin(IPluginDescriptor pluginDescriptor)
          Constructs an instance of this plug-in runtime class.
 
Method Summary
static String getEncoding()
          Returns the encoding to use when reading text files in the workspace.
static ResourcesPlugin getPlugin()
          Returns the Resources plug-in.
static IWorkspace getWorkspace()
          Returns the workspace.
 void shutdown()
          This implementation of the corresponding Plugin method closes the workspace (without saving).
 void startup()
          This implementation of the corresponding Plugin method opens the workspace.
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getDescriptor, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PI_RESOURCES

public static final String PI_RESOURCES
Unique identifier constant (value "org.eclipse.core.resources") for the standard Resources plug-in.

See Also:
Constant Field Values

PT_BUILDERS

public static final String PT_BUILDERS
Simple identifier constant (value "builders") for the builders extension point.

See Also:
Constant Field Values

PT_NATURES

public static final String PT_NATURES
Simple identifier constant (value "natures") for the natures extension point.

See Also:
Constant Field Values

PT_MARKERS

public static final String PT_MARKERS
Simple identifier constant (value "markers") for the markers extension point.

See Also:
Constant Field Values

PT_FILE_MODIFICATION_VALIDATOR

public static final String PT_FILE_MODIFICATION_VALIDATOR
Simple identifier constant (value "fileModificationValidator") for the file modification validator extension point.

See Also:
Constant Field Values

PT_MOVE_DELETE_HOOK

public static final String PT_MOVE_DELETE_HOOK
Simple identifier constant (value "moveDeleteHook") for the move/delete hook extension point.

Since:
2.0
See Also:
Constant Field Values

PREF_ENCODING

public static final String PREF_ENCODING
Name of a preference indicating the encoding to use when reading text files in the workspace. The value is a string, and may be the default empty string, indicating that the file system encoding should be used instead. The file system encoding can be retrieved using System.getProperty("file.encoding"). There is also a convenience method getEncoding which returns the value of this preference, or the file system encoding if this preference is not set.

Note that there is no guarantee that the value is a supported encoding. Callers should be prepared to handle UnsupportedEncodingException where this encoding is used.

See Also:
getEncoding(), UnsupportedEncodingException, Constant Field Values
Constructor Detail

ResourcesPlugin

public ResourcesPlugin(IPluginDescriptor pluginDescriptor)
Constructs an instance of this plug-in runtime class.

An instance of this plug-in runtime class is automatically created when the facilities provided by the Resources plug-in are required. Cliens must never explicitly instantiate a plug-in runtime class.

Parameters:
pluginDescriptor - the plug-in descriptor for the Resources plug-in
Method Detail

getEncoding

public static String getEncoding()
Returns the encoding to use when reading text files in the workspace. This is the value of the PREF_ENCODING preference, or the file system encoding (System.getProperty("file.encoding")) if the preference is not set.

Note that this method does not check whether the result is a supporteed encoding. Callers should be prepared to handle UnsupportedEncodingException where this encoding is used.

See Also:
UnsupportedEncodingException

getPlugin

public static ResourcesPlugin getPlugin()
Returns the Resources plug-in.

Returns:
the single instance of this plug-in runtime class

getWorkspace

public static IWorkspace getWorkspace()
Returns the workspace.

Returns:
the workspace that was created by the single instance of this plug-in runtime class

shutdown

public void shutdown()
              throws CoreException
This implementation of the corresponding Plugin method closes the workspace (without saving).

Overrides:
shutdown in class Plugin
Throws:
CoreException - if this method fails to shut down this plug-in
See Also:
Plugin.shutdown()

startup

public void startup()
             throws CoreException
This implementation of the corresponding Plugin method opens the workspace.

Overrides:
startup in class Plugin
Throws:
CoreException - if this plug-in did not start up properly
See Also:
Plugin.startup()

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.