use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class DockerComposeUpJob method run.
@Override
protected IStatus run(final IProgressMonitor monitor) {
final String dockerComposeInstallDir = Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.DOCKER_COMPOSE_INSTALLATION_DIRECTORY);
final Thread commandThread = new Thread(() -> {
// open console view
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(dockerComposeConsole);
try {
// run the 'docker-compose up' command
final Process dockerComposeSystemProcess = DockerCompose.getInstance().up(this.connection, dockerComposeInstallDir, this.workingDir);
final ILaunch launch = new Launch(launchConfiguration, ILaunchManager.RUN_MODE, null);
final IProcess dockerComposeProcess = DebugPlugin.newProcess(launch, dockerComposeSystemProcess, // $NON-NLS-1$
"docker-compose up");
dockerComposeConsole.setDockerComposeProcess(// $NON-NLS-1$
dockerComposeProcess);
final int exitCode = dockerComposeSystemProcess.waitFor();
if (exitCode != 0) {
Display.getDefault().asyncExec(() -> MessageDialog.openError(Display.getDefault().getActiveShell(), JobMessages.getString(// $NON-NLS-1$
"DockerCompose.dialog.title"), JobMessages.getString(// $NON-NLS-1$
"DockerComposeUp.start.error")));
}
} catch (DockerCommandNotFoundException e) {
// just display the error to the user, there's no need to report
// an error in the log and in AERI for that.
Display.getDefault().asyncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(), JobMessages.getString(// $NON-NLS-1$
"DockerCompose.dialog.title"), e.getMessage()));
} catch (DockerException | InterruptedException e) {
Display.getDefault().asyncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(), JobMessages.getString(// $NON-NLS-1$
"DockerCompose.dialog.title"), e.getMessage()));
Activator.log(e);
}
});
commandThread.start();
return Status.OK_STATUS;
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class TestLaunching method testDefaultLaunch.
@Test
public void testDefaultLaunch() throws CoreException {
TestingOprofileLaunchConfigurationDelegate delegate = new TestingOprofileLaunchConfigurationDelegate();
ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
LaunchTestingOptions options = new LaunchTestingOptions();
options.setOprofileProject(proj.getProject());
options.loadConfiguration(config);
assertTrue(options.isValid());
assertTrue(options.getBinaryImage().isEmpty());
assertTrue(options.getKernelImageFile().isEmpty());
assertEquals(OprofileDaemonOptions.SEPARATE_NONE, options.getSeparateSamples());
Oprofile.OprofileProject.setProfilingBinary(Oprofile.OprofileProject.OPERF_BINARY);
delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class TestLaunchingExternalProject method testLaunchExternalProject.
/**
* Testcase for Eclipse BugZilla 321905/RedHat BZ
*
* @throws CoreException
*/
@Test
public void testLaunchExternalProject() throws CoreException {
LaunchTestingOptions options = new LaunchTestingOptions();
options.setOprofileProject(externalProject);
options.loadConfiguration(config);
TestingOprofileLaunchConfigurationDelegate delegate = new TestingOprofileLaunchConfigurationDelegate();
ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
assertTrue(options.isValid());
assertTrue(options.getBinaryImage().isEmpty());
assertTrue(options.getKernelImageFile().isEmpty());
assertEquals(OprofileDaemonOptions.SEPARATE_NONE, options.getSeparateSamples());
OprofileProject.setProfilingBinary(OprofileProject.OPERF_BINARY);
delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class LaunchTest method testDelegate.
@Test
public void testDelegate() throws CoreException {
ILaunchConfiguration config = createConfiguration(proj.getProject());
ProviderLaunchConfigurationDelegate delegate = new ProviderLaunchConfigurationDelegate();
ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
setProfileAttributes(wc);
delegate.launch(wc, ILaunchManager.PROFILE_MODE, launch, null);
}
use of org.eclipse.debug.core.Launch in project statecharts by Yakindu.
the class AbstractDebugTargetView method debugContextChanged.
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
PlatformObject object = (PlatformObject) ((IStructuredSelection) event.getContext()).getFirstElement();
if (object == null)
return;
IDebugTarget newTarget = null;
if (object instanceof Launch) {
newTarget = ((Launch) object).getDebugTarget();
} else {
newTarget = (IDebugTarget) object.getAdapter(IDebugTarget.class);
}
changeTarget(newTarget);
}
}
Aggregations