blob: 5dcc28df7241a229e2469d8cb0bd58d135a7b16b [file] [log] [blame]
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
package org.eclipse.help.internal;
import org.eclipse.core.runtime.*;
/**
* Simple plugin for a remote help system.
*/
public class HelpPlugin extends Plugin {
protected static HelpPlugin plugin;
/**
* HelpViewerPlugin constructor. It is called as part of plugin
* activation.
*/
public HelpPlugin(IPluginDescriptor descriptor) {
super(descriptor);
plugin = this;
}
/**
* @return the singleton instance of the help plugin
*/
public static HelpPlugin getDefault() {
return plugin;
}
/**
* Shuts down this plug-in and discards all plug-in state.
* <p>
* This method should be re-implemented in subclasses that need to do something
* when the plug-in is shut down. Implementors should call the inherited method
* to ensure that any system requirements can be met.
* </p>
* <p>
* Plug-in shutdown code should be robust. In particular, this method
* should always make an effort to shut down the plug-in. Furthermore,
* the code should not assume that the plug-in was started successfully,
* as this method will be invoked in the event of a failure during startup.
* </p>
* <p>
* Note 1: If a plug-in has been started, this method will be automatically
* invoked by the platform when the platform is shut down.
* </p>
* <p>
* Note 2: This method is intended to perform simple termination
* of the plug-in environment. The platform may terminate invocations
* that do not complete in a timely fashion.
* </p>
* <b>Cliens must never explicitly call this method.</b>
*
* @exception CoreException if this method fails to shut down
* this plug-in
*/
public void shutdown() throws CoreException {
HelpSystem.shutdown();
}
/**
* Starts up this plug-in.
* <p>
* This method should be overridden in subclasses that need to do something
* when this plug-in is started. Implementors should call the inherited method
* to ensure that any system requirements can be met.
* </p>
* <p>
* If this method throws an exception, it is taken as an indication that
* plug-in initialization has failed; as a result, the plug-in will not
* be activated; moreover, the plug-in will be marked as disabled and
* ineligible for activation for the duration.
* </p>
* <p>
* Plug-in startup code should be robust. In the event of a startup failure,
* the plug-in's <code>shutdown</code> method will be invoked automatically,
* in an attempt to close open files, etc.
* </p>
* <p>
* Note 1: This method is automatically invoked by the platform
* the first time any code in the plug-in is executed.
* </p>
* <p>
* Note 2: This method is intended to perform simple initialization
* of the plug-in environment. The platform may terminate initializers
* that do not complete in a timely fashion.
* </p>
* <b>Cliens must never explicitly call this method.</b>
*
* @exception CoreException if this plug-in did not start up properly
*/
public void startup() throws CoreException {
HelpSystem.startup();
}
/**
* Initializes the default preferences settings for this plug-in.
*
* @since 2.0
*/
protected void initializeDefaultPluginPreferences() {
Preferences prefs = getPluginPreferences();
prefs.setDefault(HelpSystem.LOG_LEVEL_KEY,0);
}
}