Package org.eclipse.pde.ui.launcher
Class AbstractLaunchShortcut
java.lang.Object
org.eclipse.pde.ui.launcher.AbstractLaunchShortcut
- All Implemented Interfaces:
ILaunchShortcut
- Direct Known Subclasses:
EclipseLaunchShortcut
,OSGiLaunchShortcut
An abstract class subclassed by the Eclipse Application and OSGi Framework launch shortcuts.
This class may be subclassed by clients.
- Since:
- 3.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ILaunchConfiguration
chooseConfiguration
(ILaunchConfiguration[] configs, String mode) Display to the user a list of matching existing launch configurations and return the user's selection.protected ILaunchConfiguration
This method first tries to locate existing launch configurations that are suitable for the application or framework being launched.protected abstract String
Returns the launch configuration type name.protected String
Returns the name assigned to the new launch configurationprotected abstract void
Initialize launch attributes on the new launch configuration.protected abstract boolean
isGoodMatch
(ILaunchConfiguration configuration) Determines whether a given launch configuration is a good match given the current application or framework being launched.protected void
Launches the application in the specified mode, or does nothing if the user canceled the launch when offered to select one of several available launch configurations.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.debug.ui.ILaunchShortcut
launch, launch
-
Constructor Details
-
AbstractLaunchShortcut
public AbstractLaunchShortcut()
-
-
Method Details
-
launch
Launches the application in the specified mode, or does nothing if the user canceled the launch when offered to select one of several available launch configurations.- Parameters:
mode
- mode of launch (run, debug or profile)- See Also:
-
findLaunchConfiguration
This method first tries to locate existing launch configurations that are suitable for the application or framework being launched.- If none are found, a new launch configuration is created and initialized
- If one is found, it is launched automatically
- If more than one is found, a selection dialog is presented to the user and the chosen one will be launched
- Parameters:
mode
- mode of launch (run, debug or profile)- Returns:
- a launch configuration to run or
null
if launch is canceled
-
chooseConfiguration
Display to the user a list of matching existing launch configurations and return the user's selection.- Parameters:
configs
- an array of matching existing launch configurationsmode
- mode of launch- Returns:
- the launch configuration selected by the user or
null
if Cancel was pressed
-
getName
Returns the name assigned to the new launch configuration- Returns:
- a name for the new launch configuration
-
initializeConfiguration
Initialize launch attributes on the new launch configuration. Must be overridden by subclasses.- Parameters:
wc
- the launch configuration working copy to be initialize- See Also:
-
getLaunchConfigurationTypeName
Returns the launch configuration type name. Must be overridden by subclasses- Returns:
- the launch configuration type name
-
isGoodMatch
Determines whether a given launch configuration is a good match given the current application or framework being launched. This method must be overridden by subclasses. Its purpose is to add criteria on what makes a good match or not.- Parameters:
configuration
- the launch configuration being evaluated- Returns:
true
if the launch configuration is a good match for the application or framework being launched,false
otherwise.
-