Here are the steps to change the wizard-generated plug-in class to extend the RSE plug-in class.
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.*;
public class RSESamplesPlugin extends SystemBasePlugin {
private static SystemMessageFile messageFile = null;
/**
* The constructor.
*/
public RSESamplesPlugin(IPluginDescriptor descriptor) {
super(descriptor, "RSESamples");
plugin = this;
//try {
// resourceBundle= ResourceBundle.getBundle("RSESamples.RSESamplesPluginResources");
//} catch (MissingResourceException x) {
// resourceBundle = null;
//}
resourceBundle = loadResourceBundle(descriptor,"rseSamplesResources");
messageFile = loadMessageFile(descriptor,"rseSamplesMessages.xml");
}
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String getResourceString(String key) {
ResourceBundle bundle= RSESamplesPlugin.getDefault().getResourceBundle();
return getString(bundle, key); // inherited method.
//try {
// return bundle.getString(key);
//} catch (MissingResourceException e) {
// return key;
//}
}
/**
* @see AbstractUIPlugin#initializeDefaultPreferences
*/
protected void initializeDefaultPreferences(IPreferenceStore store)
{
super.initializeDefaultPreferences(store);
//RSESamplesPreferencePage.initDefaults(store);
}
/**
* Initialize the image registry by declaring all of the required graphics.
*/
protected void initializeImageRegistry()
{
String path = getIconPath();
//putImageInRegistry(ISamplesConstants.ICON_XXX_ID,
// path+ISamplesConstants.ICON_XXX);
// TO RETRIEVE AN ICON, CALL GETIMAGE OR GETIMAGEDESCRIPTOR WITH ITS XXX_ID ID
}
/**
* Starts up this plug-in and returns whether startup was successful.
*/
public void startup() throws CoreException
{
super.startup();
}
/**
* Return our message file
*/
public static SystemMessageFile getPluginMessageFile()
{
return messageFile;
}
/**
* Retrieve a message from this plugin's message file
*/
public static SystemMessage getPluginMessage(String msgId)
{
return getMessage(messageFile, msgId);
}