Class JavaLaunchShortcut
java.lang.Object
org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut
- All Implemented Interfaces:
org.eclipse.debug.ui.ILaunchShortcut,org.eclipse.debug.ui.ILaunchShortcut2
- Direct Known Subclasses:
JavaAppletLaunchShortcut,JavaApplicationLaunchShortcut
public abstract class JavaLaunchShortcut
extends Object
implements org.eclipse.debug.ui.ILaunchShortcut2
Common behavior for Java launch shortcuts
This class may be sub-classed.
- Since:
- 3.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.debug.core.ILaunchConfigurationchooseConfiguration(List<org.eclipse.debug.core.ILaunchConfiguration> configList) Returns a configuration from the given collection of configurations that should be launched, ornullto cancel.protected ITypechooseType(IType[] types, String title) Prompts the user to select a type from the given types.protected abstract org.eclipse.debug.core.ILaunchConfigurationcreateConfiguration(IType type) Creates and returns a new configuration based on the specified type.protected org.eclipse.debug.core.ILaunchConfigurationfindLaunchConfiguration(IType type, org.eclipse.debug.core.ILaunchConfigurationType configType) Finds and returns an existing configuration to re-launch for the given type, ornullif there is no existing configuration.protected abstract IType[]Finds and returns the types in the given collection of elements that can be launched.protected abstract org.eclipse.debug.core.ILaunchConfigurationTypeReturns the type of configuration this shortcut is applicable to.protected abstract StringReturns an error message to use when the editor does not contain a type that can be launched.org.eclipse.core.resources.IResourcegetLaunchableResource(org.eclipse.jface.viewers.ISelection selection) org.eclipse.core.resources.IResourcegetLaunchableResource(org.eclipse.ui.IEditorPart editorpart) org.eclipse.debug.core.ILaunchConfiguration[]getLaunchConfigurations(org.eclipse.jface.viewers.ISelection selection) org.eclipse.debug.core.ILaunchConfiguration[]getLaunchConfigurations(org.eclipse.ui.IEditorPart editorpart) protected abstract StringReturns an error message to use when the selection does not contain a type that can be launched.protected org.eclipse.swt.widgets.ShellgetShell()Convenience method to return the active workbench window shell.protected abstract StringReturns a title for a type selection dialog used to prompt the user when there is more than one type that can be launched.protected voidLaunches the given type in the specified mode.voidvoid
-
Constructor Details
-
JavaLaunchShortcut
public JavaLaunchShortcut()
-
-
Method Details
-
getConfigurationType
protected abstract org.eclipse.debug.core.ILaunchConfigurationType getConfigurationType()Returns the type of configuration this shortcut is applicable to.- Returns:
- the type of configuration this shortcut is applicable to
-
createConfiguration
Creates and returns a new configuration based on the specified type.- Parameters:
type- type to create a launch configuration for- Returns:
- launch configuration configured to launch the specified type
-
findTypes
protected abstract IType[] findTypes(Object[] elements, org.eclipse.jface.operation.IRunnableContext context) throws InterruptedException, org.eclipse.core.runtime.CoreException Finds and returns the types in the given collection of elements that can be launched.- Parameters:
elements- scope to search for types that can be launchedcontext- progress reporting context- Returns:
- collection of types that can be launched, possibly empty
- Throws:
InterruptedException- if the search is canceledorg.eclipse.core.runtime.CoreException- if the search fails
-
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.- Returns:
- type selection dialog title
-
getEditorEmptyMessage
Returns an error message to use when the editor does not contain a type that can be launched.- Returns:
- error message when editor cannot be launched
-
getSelectionEmptyMessage
Returns an error message to use when the selection does not contain a type that can be launched.- Returns:
- error message when selection cannot be launched
-
chooseType
Prompts the user to select a type from the given types.- Parameters:
types- the types to choose fromtitle- the selection dialog title- Returns:
- the selected type or
nullif none.
-
launch
Launches the given type in the specified mode.- Parameters:
type- type to launchmode- launch mode- Since:
- 3.5
-
findLaunchConfiguration
protected org.eclipse.debug.core.ILaunchConfiguration findLaunchConfiguration(IType type, org.eclipse.debug.core.ILaunchConfigurationType configType) Finds and returns an existing configuration to re-launch for the given type, ornullif there is no existing configuration.- Parameters:
type- theITypeto try and find theILaunchConfigurationforconfigType- theILaunchConfigurationTypeto try and narrow down the search- Returns:
- a configuration to use for launching the given type or
nullif none
-
chooseConfiguration
protected org.eclipse.debug.core.ILaunchConfiguration chooseConfiguration(List<org.eclipse.debug.core.ILaunchConfiguration> configList) Returns a configuration from the given collection of configurations that should be launched, ornullto cancel. Default implementation opens a selection dialog that allows the user to choose one of the specified launch configurations. Returns the chosen configuration, ornullif the user cancels.- Parameters:
configList- list of configurations to choose from- Returns:
- configuration to launch or
nullto cancel
-
getShell
protected org.eclipse.swt.widgets.Shell getShell()Convenience method to return the active workbench window shell.- Returns:
- active workbench window shell
-
launch
- Specified by:
launchin interfaceorg.eclipse.debug.ui.ILaunchShortcut
-
launch
- Specified by:
launchin interfaceorg.eclipse.debug.ui.ILaunchShortcut
-
getLaunchableResource
public org.eclipse.core.resources.IResource getLaunchableResource(org.eclipse.ui.IEditorPart editorpart) - Specified by:
getLaunchableResourcein interfaceorg.eclipse.debug.ui.ILaunchShortcut2
-
getLaunchableResource
public org.eclipse.core.resources.IResource getLaunchableResource(org.eclipse.jface.viewers.ISelection selection) - Specified by:
getLaunchableResourcein interfaceorg.eclipse.debug.ui.ILaunchShortcut2
-
getLaunchConfigurations
public org.eclipse.debug.core.ILaunchConfiguration[] getLaunchConfigurations(org.eclipse.ui.IEditorPart editorpart) - Specified by:
getLaunchConfigurationsin interfaceorg.eclipse.debug.ui.ILaunchShortcut2
-
getLaunchConfigurations
public org.eclipse.debug.core.ILaunchConfiguration[] getLaunchConfigurations(org.eclipse.jface.viewers.ISelection selection) - Specified by:
getLaunchConfigurationsin interfaceorg.eclipse.debug.ui.ILaunchShortcut2
-