use of org.eclipse.debug.core.ILaunchConfiguration in project titan.EclipsePlug-ins by eclipse.
the class JniExecutor method startSession.
/**
* Initializes the Executor.
*
* @param launch the ILaunch instance to start the session with.
*/
@Override
public void startSession(final ILaunch launch) {
super.startSession(launch);
if (automaticExecuteSectionExecution) {
if (!LaunchStorage.getLaunchElementMap().containsKey(launch)) {
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
LaunchElement launchElement = new LaunchElement(launchConfiguration.getName(), launch);
LaunchStorage.registerLaunchElement(launchElement);
ExecutorStorage.registerExecutorStorage(launchElement);
}
simpleExecutionRunning = true;
startTest(true);
}
}
use of org.eclipse.debug.core.ILaunchConfiguration in project titan.EclipsePlug-ins by eclipse.
the class ExecutorMonitorView method removeAllTerminated.
private void removeAllTerminated() {
if (null == viewer) {
return;
}
for (int i = root.children().size() - 1; i >= 0; i--) {
LaunchElement element = (LaunchElement) root.children().get(i);
ILaunch launched = element.launch();
if (null == launched) {
// DebugPlugin.getDefault().getLaunchManager().removeLaunch(launched);
continue;
}
ILaunchConfiguration launchConfiguration = launched.getLaunchConfiguration();
MainControllerElement mainController;
if (1 == element.children().size()) {
mainController = (MainControllerElement) element.children().get(0);
} else {
mainController = null;
}
if (isSupportedConfiguration(launchConfiguration) && null != mainController) {
BaseExecutor executor = mainController.executor();
if (executor.isTerminated()) {
DebugPlugin.getDefault().getLaunchManager().removeLaunch(launched);
}
}
}
viewer.setSelection(null);
updateActions();
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
viewer.refresh(root);
}
});
}
use of org.eclipse.debug.core.ILaunchConfiguration in project titan.EclipsePlug-ins by eclipse.
the class ExecutorMonitorView method terminateAll.
private void terminateAll() {
if (null == viewer) {
return;
}
for (int i = root.children().size() - 1; i >= 0; i--) {
LaunchElement element = (LaunchElement) root.children().get(i);
ILaunch launched = element.launch();
ILaunchConfiguration launchConfiguration = launched.getLaunchConfiguration();
MainControllerElement mainController;
if (1 == (element).children().size()) {
mainController = (MainControllerElement) (element).children().get(0);
} else {
mainController = null;
}
if (isSupportedConfiguration(launchConfiguration) && null != mainController) {
BaseExecutor executor = mainController.executor();
if (!executor.isTerminated()) {
executor.terminate(false);
}
}
}
updateActions();
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
viewer.refresh(root);
}
});
}
use of org.eclipse.debug.core.ILaunchConfiguration in project titan.EclipsePlug-ins by eclipse.
the class ExecutorMonitorView method removeSelected.
private void removeSelected() {
if (null == viewer || viewer.getSelection().isEmpty()) {
return;
}
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
viewer.getTree().setRedraw(false);
for (Iterator<?> iterator = selection.iterator(); iterator.hasNext(); ) {
ITreeLeaf element = (ITreeLeaf) iterator.next();
while (!(element instanceof LaunchElement)) {
element = element.parent();
}
ILaunch launched = ((LaunchElement) element).launch();
ILaunchConfiguration launchConfiguration = launched.getLaunchConfiguration();
MainControllerElement mainController;
if (1 == ((LaunchElement) element).children().size()) {
mainController = (MainControllerElement) ((LaunchElement) element).children().get(0);
} else {
mainController = null;
}
if (isSupportedConfiguration(launchConfiguration) && null != mainController) {
BaseExecutor executor = mainController.executor();
if (executor.isTerminated()) {
DebugPlugin.getDefault().getLaunchManager().removeLaunch(launched);
}
}
}
viewer.setSelection(null);
updateActions();
viewer.getTree().setRedraw(true);
}
use of org.eclipse.debug.core.ILaunchConfiguration in project webtools.servertools by eclipse.
the class AntPublisher method runAnt.
private void runAnt(String buildFile, String targets, Map properties, IProgressMonitor monitor) throws CoreException {
long time = System.currentTimeMillis();
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = launchManager.getLaunchConfigurationType(IAntLaunchConfigurationConstants.ID_ANT_LAUNCH_CONFIGURATION_TYPE);
if (type == null) {
IStatus s = new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, 0, GenericServerCoreMessages.antLauncherMissing, null);
throw new CoreException(s);
}
// $NON-NLS-1$
ILaunchConfigurationWorkingCopy wc = type.newInstance(null, properties.get(PROP_MODULE_NAME) + " module publisher");
wc.setContainer(null);
wc.setAttribute(ATTR_LOCATION, buildFile);
// $NON-NLS-1$
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, "org.eclipse.ant.ui.AntClasspathProvider");
wc.setAttribute(IAntLaunchConfigurationConstants.ATTR_ANT_TARGETS, targets);
wc.setAttribute(IAntLaunchConfigurationConstants.ATTR_ANT_PROPERTIES, properties);
wc.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false);
wc.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true);
wc.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
// $NON-NLS-1$
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH_PROVIDER, "org.eclipse.ant.ui.AntClasspathProvider");
IVMInstall vmInstall = getServerRuntime().getVMInstall();
if (// fallback to default VM if null.
vmInstall == null)
vmInstall = JavaRuntime.getDefaultVMInstall();
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, JavaRuntime.newJREContainerPath(vmInstall).toPortableString());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, // $NON-NLS-1$
"org.eclipse.ant.internal.ui.antsupport.InternalAntRunner");
wc.setAttribute(DebugPlugin.ATTR_PROCESS_FACTORY_ID, REMOTE_ANT_PROCESS_FACTORY_ID);
setupAntLaunchConfiguration(wc);
if (!monitor.isCanceled()) {
ILaunchConfiguration launchConfig = wc.doSave();
launchConfig.launch(ILaunchManager.RUN_MODE, monitor, false, true);
// $NON-NLS-1$ //$NON-NLS-2$
Trace.trace(Trace.PERFORMANCE, "AntPublisher.runAnt():<" + (System.currentTimeMillis() - time) + "ms> module: " + getModule()[0]);
}
}
Aggregations