use of org.eclipse.debug.core.ILaunchManager in project liferay-ide by liferay.
the class MavenProjectBuilder method _execMavenLaunch.
private boolean _execMavenLaunch(IProject project, String goal, IMavenProjectFacade facade, IProgressMonitor monitor) throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(_launchConfigurationTypeId);
IPath basedirLocation = project.getLocation();
String newName = launchManager.generateLaunchConfigurationName(basedirLocation.lastSegment());
ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(null, newName);
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "-Dmaven.multiModuleProjectDirectory");
workingCopy.setAttribute(_attrPomDir, basedirLocation.toString());
workingCopy.setAttribute(_attrGoals, goal);
// workingCopy.setAttribute( ATTR_UPDATE_SNAPSHOTS, Boolean.TRUE );
workingCopy.setAttribute(_attrWorkspaceResolution, Boolean.TRUE);
workingCopy.setAttribute(_attrSkipTests, Boolean.TRUE);
if (facade != null) {
ResolverConfiguration configuration = facade.getResolverConfiguration();
String selectedProfiles = configuration.getSelectedProfiles();
if ((selectedProfiles != null) && (selectedProfiles.length() > 0)) {
workingCopy.setAttribute(_attrProfiles, selectedProfiles);
}
new LaunchHelper().launch(workingCopy, "run", monitor);
return true;
} else {
return false;
}
}
use of org.eclipse.debug.core.ILaunchManager in project pivot by apache.
the class PivotApplicationLaunchShortcut method getExistingLaunchConfiguration.
private ILaunchConfiguration getExistingLaunchConfiguration(IType type) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfiguration existingLaunchConfiguration = null;
try {
String applicationProjectName = type.getJavaProject().getElementName();
String applicationTypeName = type.getFullyQualifiedName();
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(applicationProjectName) && programArguments.equals(applicationTypeName)) {
existingLaunchConfiguration = launchConfiguration;
break;
}
}
} catch (CoreException exception) {
MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(), exception.getMessage(), exception.getStatus().getMessage());
}
return existingLaunchConfiguration;
}
use of org.eclipse.debug.core.ILaunchManager in project mdw-designer by CenturyLinkCloud.
the class WebLogicServerConfigurator method launchNewServerCreation.
@SuppressWarnings({ "deprecation", "rawtypes", "unchecked" })
public String launchNewServerCreation(Shell shell) {
String serverHome = getServerSettings().getHome();
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType programType = manager.getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE);
try {
ILaunchConfiguration cfg = programType.newInstance(null, "WebLogic Domain Config Wizard");
ILaunchConfigurationWorkingCopy wc = cfg.getWorkingCopy();
wc.setAttribute(IExternalToolConstants.ATTR_LOCATION, serverHome + "/common/bin/config.cmd");
wc.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, serverHome + "/common/bin");
Map envVars = new HashMap();
envVars.put("MW_HOME", serverHome.substring(0, serverHome.lastIndexOf(System.getProperty("file.separator"))));
wc.setAttribute("org.eclipse.debug.core.environmentVariables", envVars);
cfg = wc.doSave();
ILaunch launch = cfg.launch(ILaunchManager.RUN_MODE, null, false, false);
StringBuilder errors = new StringBuilder("");
for (IProcess process : launch.getProcesses()) errors.append(process.getStreamsProxy().getErrorStreamMonitor().getContents() + "\n");
cfg.delete();
if (errors.toString().trim().length() > 0)
throw new IOException(errors.toString().trim());
return null;
} catch (Exception ex) {
PluginMessages.uiError(shell, ex, "Create Domain", getServerSettings().getProject());
return null;
}
}
use of org.eclipse.debug.core.ILaunchManager in project iobserve-analysis by research-iobserve.
the class PerOpteryxLaunchConfigurationBuilder method getDefaultLaunchConfiguration.
/**
* Returns a default launch configuration.
*
* @param projectModelDir
* The Peropteryx project dir in eclipse workspace
* @param sourceModelDir
* The PCM model directory
* @return The launch configuration
* @throws CoreException
* when creating or saving the launch configuration fails
*/
public static ILaunchConfiguration getDefaultLaunchConfiguration(final String projectModelDir, final String sourceModelDir) throws CoreException {
final Map<String, Object> attr = new HashMap<>();
PerOpteryxLaunchConfigurationBuilder.setDefaultConfigFiles(projectModelDir, attr);
PerOpteryxLaunchConfigurationBuilder.setDefaultGeneralOptions(attr);
PerOpteryxLaunchConfigurationBuilder.setDefaultAnalysisOptions(attr);
PerOpteryxLaunchConfigurationBuilder.setDefaultResourceOptions(attr);
PerOpteryxLaunchConfigurationBuilder.setDefaultReliabilityOptions(attr);
// setSimuComDefaultOptions(attr);
PerOpteryxLaunchConfigurationBuilder.setLQNSDefaultOptions(attr, projectModelDir, sourceModelDir);
PerOpteryxLaunchConfigurationBuilder.setDefaultTacticsOptions(attr);
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
final ILaunchConfigurationType launchConfigType = launchManager.getLaunchConfigurationType(PerOpteryxLaunchConfigurationBuilder.DSE_LAUNCH_TYPE_ID);
final ILaunchConfigurationWorkingCopy workingCopy = launchConfigType.newInstance(null, PerOpteryxLaunchConfigurationBuilder.DEFAULT_LAUNCH_CONFIG_NAME);
workingCopy.setAttributes(attr);
final ILaunchConfiguration launchConfig = workingCopy.doSave();
return launchConfig;
}
use of org.eclipse.debug.core.ILaunchManager in project egit by eclipse.
the class LaunchFinder method findLaunch.
private static ILaunchConfiguration findLaunch(Set<IProject> projects, IProgressMonitor monitor) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = launchManager.getLaunches();
SubMonitor progress = SubMonitor.convert(monitor, UIText.LaunchFinder_SearchLaunchConfiguration, launches.length);
for (ILaunch launch : launches) {
if (progress.isCanceled()) {
break;
}
if (launch.isTerminated()) {
progress.worked(1);
continue;
}
ISourceLocator locator = launch.getSourceLocator();
if (locator instanceof ISourceLookupDirector) {
ISourceLookupDirector director = (ISourceLookupDirector) locator;
ISourceContainer[] containers = director.getSourceContainers();
if (isAnyProjectInSourceContainers(containers, projects, progress.newChild(1))) {
return launch.getLaunchConfiguration();
}
} else {
progress.worked(1);
}
}
return null;
}
Aggregations