public abstract class JavaLaunchShortcut extends Object implements ILaunchShortcut2
This class may be sub-classed.
Constructor and Description |
---|
JavaLaunchShortcut() |
Modifier and Type | Method and Description |
---|---|
protected ILaunchConfiguration |
chooseConfiguration(List<ILaunchConfiguration> configList)
Returns a configuration from the given collection of configurations that should be launched,
or
null to cancel. |
protected IType |
chooseType(IType[] types,
String title)
Prompts the user to select a type from the given types.
|
protected abstract ILaunchConfiguration |
createConfiguration(IType type)
Creates and returns a new configuration based on the specified type.
|
protected ILaunchConfiguration |
findLaunchConfiguration(IType type,
ILaunchConfigurationType configType)
Finds and returns an existing configuration to re-launch for the given type,
or
null if there is no existing configuration. |
protected abstract IType[] |
findTypes(Object[] elements,
IRunnableContext context)
Finds and returns the types in the given collection of elements that can be launched.
|
protected abstract ILaunchConfigurationType |
getConfigurationType()
Returns the type of configuration this shortcut is applicable to.
|
protected abstract String |
getEditorEmptyMessage()
Returns an error message to use when the editor does not contain a type that can be launched.
|
IResource |
getLaunchableResource(IEditorPart editorpart) |
IResource |
getLaunchableResource(ISelection selection) |
ILaunchConfiguration[] |
getLaunchConfigurations(IEditorPart editorpart) |
ILaunchConfiguration[] |
getLaunchConfigurations(ISelection selection) |
protected abstract String |
getSelectionEmptyMessage()
Returns an error message to use when the selection does not contain a type that can be launched.
|
protected Shell |
getShell()
Convenience method to return the active workbench window shell.
|
protected abstract String |
getTypeSelectionTitle()
Returns a title for a type selection dialog used to prompt the user when there is more than
one type that can be launched.
|
void |
launch(IEditorPart editor,
String mode) |
void |
launch(ISelection selection,
String mode) |
protected void |
launch(IType type,
String mode)
Launches the given type in the specified mode.
|
protected abstract ILaunchConfigurationType getConfigurationType()
protected abstract ILaunchConfiguration createConfiguration(IType type)
type
- type to create a launch configuration forprotected abstract IType[] findTypes(Object[] elements, IRunnableContext context) throws InterruptedException, CoreException
elements
- scope to search for types that can be launchedcontext
- progress reporting contextInterruptedException
- if the search is canceledCoreException
- if the search failsprotected abstract String getTypeSelectionTitle()
protected abstract String getEditorEmptyMessage()
protected abstract String getSelectionEmptyMessage()
protected IType chooseType(IType[] types, String title)
types
- the types to choose fromtitle
- the selection dialog titlenull
if none.protected void launch(IType type, String mode)
type
- type to launchmode
- launch modeprotected ILaunchConfiguration findLaunchConfiguration(IType type, ILaunchConfigurationType configType)
null
if there is no existing configuration.type
- the IType
to try and find the ILaunchConfiguration
forconfigType
- the ILaunchConfigurationType
to try and narrow down the searchnull
if noneprotected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList)
null
to cancel. Default implementation opens a selection dialog that allows
the user to choose one of the specified launch configurations. Returns the chosen configuration,
or null
if the user cancels.configList
- list of configurations to choose fromnull
to cancelprotected Shell getShell()
public void launch(IEditorPart editor, String mode)
launch
in interface ILaunchShortcut
public void launch(ISelection selection, String mode)
launch
in interface ILaunchShortcut
public IResource getLaunchableResource(IEditorPart editorpart)
getLaunchableResource
in interface ILaunchShortcut2
public IResource getLaunchableResource(ISelection selection)
getLaunchableResource
in interface ILaunchShortcut2
public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart)
getLaunchConfigurations
in interface ILaunchShortcut2
public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection)
getLaunchConfigurations
in interface ILaunchShortcut2
Copyright (c) 2000, 2013 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.