PTP
Release 5.0

org.eclipse.ptp.launch
Class PTPLaunchPlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by org.eclipse.ptp.launch.PTPLaunchPlugin
All Implemented Interfaces:
BundleActivator

public class PTPLaunchPlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin

The main plugin class to be used in the desktop.


Field Summary
static String EXTENSION_POINT_ID
           
static String RESOURCE_BUNDLE
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
PTPLaunchPlugin()
          The constructor.
 
Method Summary
 void addLaunchNotificationListener(ILaunchNotification listener)
          Add a listener for ILaunchNotification events
static void errorDialog(String message, org.eclipse.core.runtime.IStatus status)
          Convenience method to create an error dialog given an IStatus.
static void errorDialog(String message, Throwable t)
          Convenience method to create an error dialog given a message and Throwable.
static org.eclipse.ui.IWorkbenchPage getActivePage()
          Convenience method to get the currently active page
static org.eclipse.swt.widgets.Shell getActiveWorkbenchShell()
          Returns the active workbench shell or null if none
static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()
          Convenience method to get the currently active workbench window
static PTPLaunchPlugin getDefault()
          Returns the shared instance.
static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(String path)
          Returns an image descriptor for the image file at the given plug-in relative path.
 ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
 org.eclipse.ptp.rmsystem.IResourceManager getResourceManager(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Find the resource manager that corresponds to the unique name specified in the configuration
static String getResourceString(String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
 org.eclipse.ptp.launch.ui.extensions.AbstractRMLaunchConfigurationFactory getRMLaunchConfigurationFactory(org.eclipse.ptp.rmsystem.IResourceManager rm)
          Find the launch configuration factory for a resource manager
static String getUniqueIdentifier()
          Get a unique identifier for this plugin
static void log(org.eclipse.core.runtime.IStatus status)
          Logs the specified status with this plug-in's log.
static void log(Throwable e)
          Logs an internal error with the specified throwable
static void logErrorMessage(String message)
          Logs an internal error with the specified message.
 void notifyJobStateChange(org.eclipse.ptp.core.elements.IPJob job, org.eclipse.ptp.core.elements.attributes.JobAttributes.State state)
          Notify listeners when a job changes status
 void removeLaunchNotificationListener(ILaunchNotification listener)
          Remove a listener for ILaunchNotification events
 void start(BundleContext context)
          This method is called upon plug-in activation
 void stop(BundleContext context)
          This method is called when the plug-in is stopped
 org.eclipse.core.runtime.IPath verifyResource(String path, org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor)
          Verify that the resource "path" actually exists.
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, 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

EXTENSION_POINT_ID

public static final String EXTENSION_POINT_ID
See Also:
Constant Field Values

RESOURCE_BUNDLE

public static final String RESOURCE_BUNDLE
See Also:
Constant Field Values
Constructor Detail

PTPLaunchPlugin

public PTPLaunchPlugin()
The constructor.

Method Detail

errorDialog

public static void errorDialog(String message,
                               org.eclipse.core.runtime.IStatus status)
Convenience method to create an error dialog given an IStatus.

Parameters:
message -
status -

errorDialog

public static void errorDialog(String message,
                               Throwable t)
Convenience method to create an error dialog given a message and Throwable.

Parameters:
message -
t -

getActivePage

public static org.eclipse.ui.IWorkbenchPage getActivePage()
Convenience method to get the currently active page

Returns:
currently active page

getActiveWorkbenchShell

public static org.eclipse.swt.widgets.Shell getActiveWorkbenchShell()
Returns the active workbench shell or null if none

Returns:
the active workbench shell or null if none

getActiveWorkbenchWindow

public static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()
Convenience method to get the currently active workbench window

Returns:
currently active workbench window

getDefault

public static PTPLaunchPlugin getDefault()
Returns the shared instance.


getImageDescriptor

public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(String path)
Returns an image descriptor for the image file at the given plug-in relative path.

Parameters:
path - the path
Returns:
the image descriptor

getResourceString

public static String getResourceString(String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.


getUniqueIdentifier

public static String getUniqueIdentifier()
Get a unique identifier for this plugin

Returns:
unique identifier

log

public static void log(org.eclipse.core.runtime.IStatus status)
Logs the specified status with this plug-in's log.

Parameters:
status - status to log

log

public static void log(Throwable e)
Logs an internal error with the specified throwable

Parameters:
e - the exception to be logged

logErrorMessage

public static void logErrorMessage(String message)
Logs an internal error with the specified message.

Parameters:
message - the error message to log

addLaunchNotificationListener

public void addLaunchNotificationListener(ILaunchNotification listener)
Add a listener for ILaunchNotification events

Parameters:
listener - listener to add

getResourceBundle

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


getResourceManager

public org.eclipse.ptp.rmsystem.IResourceManager getResourceManager(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                             throws org.eclipse.core.runtime.CoreException
Find the resource manager that corresponds to the unique name specified in the configuration

Parameters:
configuration - launch configuration
Returns:
resource manager
Throws:
org.eclipse.core.runtime.CoreException
Since:
5.0

getRMLaunchConfigurationFactory

public org.eclipse.ptp.launch.ui.extensions.AbstractRMLaunchConfigurationFactory getRMLaunchConfigurationFactory(org.eclipse.ptp.rmsystem.IResourceManager rm)
Find the launch configuration factory for a resource manager

Parameters:
rm - resource manager
Returns:
launch configuration factory
Since:
5.0

notifyJobStateChange

public void notifyJobStateChange(org.eclipse.ptp.core.elements.IPJob job,
                                 org.eclipse.ptp.core.elements.attributes.JobAttributes.State state)
Notify listeners when a job changes status

Parameters:
job - job that has changed status

removeLaunchNotificationListener

public void removeLaunchNotificationListener(ILaunchNotification listener)
Remove a listener for ILaunchNotification events

Parameters:
listener - listener to remove

start

public void start(BundleContext context)
           throws Exception
This method is called upon plug-in activation

Specified by:
start in interface BundleActivator
Overrides:
start in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
Exception

stop

public void stop(BundleContext context)
          throws Exception
This method is called when the plug-in is stopped

Specified by:
stop in interface BundleActivator
Overrides:
stop in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
Exception

verifyResource

public org.eclipse.core.runtime.IPath verifyResource(String path,
                                                     org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                     org.eclipse.core.runtime.IProgressMonitor monitor)
                                              throws org.eclipse.core.runtime.CoreException
Verify that the resource "path" actually exists. This just checks that the path references something real.

Parameters:
path - path to check
configuration - launch configuration
monitor - progress monitor
Returns:
IPath representation of path
Throws:
org.eclipse.core.runtime.CoreException - if the resource doesn't exist or the monitor is cancelled
Since:
5.0

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.