1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 07:35:24 +02:00
cdt/rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/RSESamplesPlugin.html
2006-05-30 15:32:53 +00:00

133 lines
3.8 KiB
HTML
Executable file

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
<title>RSESamplesPlugin Class</title>
</head>
<body bgcolor="#ffffff">
<h1>RSESamplesPlugin Class</h1>
<p>
<pre><samp>
package RSESamples;
import org.eclipse.ui.plugin.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.resources.*;
import java.util.*;
import com.ibm.etools.systems.core.*;
import com.ibm.etools.systems.core.ui.messages.*;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.preference.*;
/**
* The main plugin class to be used in the desktop.
*/
public class <b>RSESamplesPlugin</b> extends SystemBasePlugin {
<i>//The shared instance.</i>
private static RSESamplesPlugin plugin;
<i>//Resource bundle.</i>
private ResourceBundle resourceBundle;
private static SystemMessageFile messageFile = null;
/**
* The constructor.
*/
public <b>RSESamplesPlugin</b>(IPluginDescriptor descriptor) {
super(descriptor, &quot;RSESamples&quot;);
plugin = this;
<i>//try {</i>
<i>// resourceBundle= ResourceBundle.getBundle(&quot;RSESamples.RSESamplesPluginResources&quot;);</i>
<i>//} catch (MissingResourceException x) {</i>
<i>// resourceBundle = null;</i>
<i>//}</i>
resourceBundle = loadResourceBundle(descriptor,&quot;rseSamplesResources&quot;);
messageFile = loadMessageFile(descriptor,&quot;rseSamplesMessages.xml&quot;);
}
/**
* Returns the shared instance.
*/
public static RSESamplesPlugin <b>getDefault</b>() {
return plugin;
}
/**
* Returns the workspace instance.
*/
public static IWorkspace <b>getWorkspace</b>() {
return ResourcesPlugin.getWorkspace();
}
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String <b>getResourceString</b>(String key) {
ResourceBundle bundle= RSESamplesPlugin.getDefault().getResourceBundle();
return getString(bundle, key); <i>// inherited method.</i>
<i>//try {</i>
<i>// return bundle.getString(key);</i>
<i>//} catch (MissingResourceException e) {</i>
<i>// return key;</i>
<i>//}</i>
}
/**
* Returns the plugin's resource bundle,
*/
public ResourceBundle <b>getResourceBundle</b>() {
return resourceBundle;
}
/**
* @see AbstractUIPlugin#initializeDefaultPreferences
*/
protected void <b>initializeDefaultPreferences</b>(IPreferenceStore store)
{
super.initializeDefaultPreferences(store);
<i>//RSESamplesPreferencePage.initDefaults(store);</i>
}
/**
* Initialize the image registry by declaring all of the required graphics.
*/
protected void <b>initializeImageRegistry</b>()
{
String path = getIconPath();
<i>//putImageInRegistry(ISamplesConstants.ICON_XXX_ID,</i>
<i>// path+ISampleConstants.ICON_XXX);</i>
<i>// TO RETRIEVE AN ICON, CALL GETIMAGE OR GETIMAGEDESCRIPTOR WITH ITS XXX_ID ID</i>
}
/**
* Starts up this plug-in and returns whether startup was successful.
*/
public void <b>startup</b>() throws CoreException
{
super.startup();
}
/**
* Return our message file
*/
public static SystemMessageFile <b>getPluginMessageFile</b>()
{
return messageFile;
}
/**
* Retrieve a message from this plugin's message file
*/
public static SystemMessage <b>getPluginMessage</b>(String msgId)
{
return getMessage(messageFile, msgId);
}
}
</samp></pre>
</p>
</body>
</html>