use of org.eclipse.debug.core.ILaunchConfigurationType in project webtools.servertools by eclipse.
the class ServerType method supportsLaunchMode.
/**
* Returns true if this server can start or may already be started
* in the given mode, and false if not. Uses the launchMode attribute,
* which may contain the strings "run", "debug", and/or "profile".
*
* @param launchMode String
* @return boolean
*/
public boolean supportsLaunchMode(String launchMode) {
try {
ILaunchConfigurationType configType = getLaunchConfigurationType();
if (configType != null)
return configType.supportsMode(launchMode);
String mode = element.getAttribute("launchModes");
if (mode == null)
return false;
return mode.indexOf(launchMode) >= 0;
} catch (Exception e) {
return false;
}
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project jbosstools-openshift by jbosstools.
the class ExternalLaunchUtil method findExternalToolsLaunchConfig.
public static ILaunchConfigurationWorkingCopy findExternalToolsLaunchConfig(IServer s, String launchName) throws CoreException {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(EXTERNAL_TOOLS);
ILaunchConfiguration[] all = manager.getLaunchConfigurations(type);
for (int i = 0; i < all.length; i++) {
if (all[i].getName().equals(launchName)) {
return all[i].getWorkingCopy();
}
}
ILaunchConfigurationWorkingCopy wc = type.newInstance(null, launchName);
return wc;
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project jbosstools-openshift by jbosstools.
the class DebugLaunchConfigs method getRemoteDebuggerLaunchConfiguration.
public ILaunchConfiguration getRemoteDebuggerLaunchConfiguration(IServer server) throws CoreException {
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(ID_REMOTE_JAVA_APPLICATION);
ILaunchConfiguration[] launchConfigs = launchManager.getLaunchConfigurations(launchConfigurationType);
String name = getRemoteDebuggerLaunchConfigurationName(server);
Optional<ILaunchConfiguration> maybeLaunch = Stream.of(launchConfigs).filter(lc -> name.equals(lc.getName())).findFirst();
return maybeLaunch.orElse(null);
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project pivot by apache.
the class PivotApplicationLaunchShortcut method createLaunchConfiguration.
protected ILaunchConfiguration createLaunchConfiguration(IType type) {
ILaunchConfiguration launchConfiguration = null;
try {
String applicationProjectName = type.getJavaProject().getElementName();
String applicationTypeName = type.getFullyQualifiedName();
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType configurationType = launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
String name = launchManager.generateUniqueLaunchConfigurationNameFrom(type.getElementName());
ILaunchConfigurationWorkingCopy workingLaunchConfiguration = configurationType.newInstance(null, name);
workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, PivotPlugin.MAIN_TYPE_NAME);
workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, applicationProjectName);
workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, applicationTypeName);
workingLaunchConfiguration.setMappedResources(new IResource[] { type.getUnderlyingResource() });
launchConfiguration = workingLaunchConfiguration.doSave();
} catch (CoreException exception) {
MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(), exception.getMessage(), exception.getStatus().getMessage());
}
return launchConfiguration;
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project pivot by apache.
the class PivotScriptApplicationLaunchShortcut method getExistingLaunchConfiguration.
private ILaunchConfiguration getExistingLaunchConfiguration(IFile file) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfiguration existingLaunchConfiguration = null;
try {
String fileProjectName = file.getProject().getName();
ILaunchConfiguration[] launchConfigurations = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(launchConfigurationType);
for (int i = 0; i < launchConfigurations.length; i++) {
ILaunchConfiguration launchConfiguration = launchConfigurations[i];
String mainTypeName = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "");
String projectName = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
String programArguments = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
if (mainTypeName.equals(PivotPlugin.MAIN_TYPE_NAME) && projectName.equals(fileProjectName) && programArguments.equals(getProgramArguments(file))) {
existingLaunchConfiguration = launchConfiguration;
break;
}
}
} catch (CoreException exception) {
MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(), exception.getMessage(), exception.getStatus().getMessage());
}
return existingLaunchConfiguration;
}
Aggregations