net.sf.tm.plugin
Class ContextManagerPlugin

java.lang.Object
  extended byorg.eclipse.core.runtime.Plugin
      extended byorg.eclipse.ui.plugin.AbstractUIPlugin
          extended bynet.sf.tm.plugin.ContextManagerPlugin

public class ContextManagerPlugin
extends AbstractUIPlugin

Main plugin class. Provides some access methods to the Eclipse environment (e.g. resources, workspace).

Version:
$Id: ContextManagerPlugin.java,v 1.10 2004/02/23 19:18:13 apataki Exp $
Author:
Andreas Pataki

Field Summary
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
ContextManagerPlugin(IPluginDescriptor descriptor)
          Constructor
 
Method Summary
 Shell getActiveWorkbenchShell()
           
static ContextManagerPlugin getDefault()
           
 ImageDescriptor getImageDescriptor(String name)
          Generates an Image descriptor.
 String getLocalizedString(String key)
          Localizes a given String using the current locale.
 String getLocalizedString(String key, Object arg)
          Localizes a given String using the current locale.
 String getLocalizedString(String key, Object[] args)
          Localizes a given String using the current locale.
 ResourceBundle getResourceBundle()
           
 IWorkspace getWorkspace()
           
protected  void initializeDefaultPreferences(IPreferenceStore store)
           
 void showError(String msg)
          Displays an error message box.
 void showError(String msg, Throwable exception)
          Displays an error message box.
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, initializeDefaultPluginPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getDescriptor, getLog, getPluginPreferences, getStateLocation, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextManagerPlugin

public ContextManagerPlugin(IPluginDescriptor descriptor)
Constructor

Parameters:
descriptor - plugin informations
Method Detail

getDefault

public static ContextManagerPlugin getDefault()
Returns:
Returns the shared instance.

getActiveWorkbenchShell

public Shell getActiveWorkbenchShell()
Returns:
the active workbench shell instance

getWorkspace

public IWorkspace getWorkspace()
Returns:
the workspace instance.

initializeDefaultPreferences

protected void initializeDefaultPreferences(IPreferenceStore store)
See Also:
AbstractUIPlugin.initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)

getResourceBundle

public ResourceBundle getResourceBundle()
Returns:
Returns the plugin's resource bundle,

showError

public void showError(String msg,
                      Throwable exception)
Displays an error message box. The stacktrace of the provided exception is displayed in the details part of the dialog.

Parameters:
msg - localized exception message.
exception - catched exception

showError

public void showError(String msg)
Displays an error message box.

Parameters:
msg - localized exception message.

getLocalizedString

public String getLocalizedString(String key)
Localizes a given String using the current locale.

Parameters:
key - The key of the text that should be translated
Returns:
localized String

getLocalizedString

public String getLocalizedString(String key,
                                 Object arg)
Localizes a given String using the current locale.

Parameters:
key - The key of the text that should be translated
arg - Argument which is inserted into the message at the {0} pos
Returns:
localized String

getLocalizedString

public String getLocalizedString(String key,
                                 Object[] args)
Localizes a given String using the current locale.

Parameters:
key - The key of the text that should be translated
args - The arguments which should be inserted in the message.
Returns:
localized String

getImageDescriptor

public ImageDescriptor getImageDescriptor(String name)
Generates an Image descriptor. The name of the image must be provided relative to the plugin install directory.

Parameters:
name - path to the image, relative to the plugin directory
Returns:
The image descriptor for the image


Copyright © 2003-2004 Andreas Pataki. All Rights Reserved.