@Override public void launchesRemoved(ILaunch[] launches) { //we want to ensure that even if a launch is removed from the debug view //when it is not terminated we update the label just in case. //bug 195232 for(int i = 0; i < launches.length; i++) { if(!launches[i].isTerminated()) { fUpdateLabel = true; return; } } } }
protected boolean isTerminated(Object element) { ILaunch launch = DebugUIPlugin.getLaunch(element); if (launch != null) { return launch.isTerminated(); } return false; }
@Override public void launchesRemoved(ILaunch[] launches) { for (int i = 0; i < launches.length; i++) { ILaunch launch = launches[i]; if (!launch.isTerminated()) { SourceLookupUtils.closeArchives(); return; } } }
public boolean isStarting() { return getStartTime() == 0 && fLaunch != null && ! fLaunch.isTerminated(); }
private void update(ILaunch launch, boolean remove) { if (managedLaunches.contains(launch)) { if (remove || launch.isTerminated()) { managedLaunches.remove(launch); if (managedLaunches.size() == 0) { hookListener(false); } } } }
public static ILaunch getActiveLaunch(String launchId) { ILaunch launch = getLaunch(launchId); return launch != null && !launch.isTerminated() ? launch : null; }
public boolean isStarting() { return getStartTime() == 0 && fLaunch != null && ! fLaunch.isTerminated(); }
public static void removeTerminatedLaunches(ILaunch[] elements) { List<ILaunch> removed = new ArrayList<>(); for (int i = 0; i < elements.length; i++) { ILaunch launch = elements[i]; if (launch.isTerminated()) { removed.add(launch); } } if (!removed.isEmpty()) { ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.removeLaunches(removed.toArray(new ILaunch[removed.size()])); } }
private static void terminateLaunch(ILaunch launch) throws DebugException { if (!launch.isTerminated()) { IProcess[] processes = launch.getProcesses(); if (processes != null) { for (IProcess proc : processes) { if (proc != null) proc.terminate(); } } } }
/** * Determines all current coverage launches which are running. * * @return list of running coverage launches */ public static List<ICoverageLaunch> getRunningCoverageLaunches() { final List<ICoverageLaunch> result = new ArrayList<ICoverageLaunch>(); for (final ILaunch launch : DebugPlugin.getDefault().getLaunchManager() .getLaunches()) { if (launch instanceof ICoverageLaunch && !launch.isTerminated()) { result.add((ICoverageLaunch) launch); } } return result; }
private void stopProcess() { if (m_launch != null && !m_launch.isTerminated()) { try { if (Platform.OS_WIN32.equals(Platform.getOS())) { m_launch.terminate(); } else { for (IProcess p : m_launch.getProcesses()) { try { Method m = p.getClass().getDeclaredMethod("getSystemProcess"); m.setAccessible(true); Process proc = (Process) m.invoke(p); Field f = proc.getClass().getDeclaredField("pid"); f.setAccessible(true); int pid = (int) f.get(proc); // force kill the process on OSX and Linux-like platform // since on Linux the default behaviour of Process.destroy() is to gracefully shutdown // which rarely can stop the busy process Runtime rt = Runtime.getRuntime(); rt.exec("kill -9 " + pid); } catch (Exception ex) { TestNGPlugin.log(ex); } } } } catch (DebugException e) { TestNGPlugin.log(e); } } }
public synchronized void update() { ILaunch launch = getLaunch(); if (launch != null) { setEnabled(launch.isTerminated()); } else { setEnabled(false); } }
if (launch == null || launch.isTerminated()) { return;
@Override protected boolean isEnabled() { ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); if (launches != null) { for (int i= 0; i < launches.length; i++) { if (launches[i].isTerminated()) { return true; } } } return false; }
public boolean isLaunchRunning() { if (runningLaunch == null) { return false; } if (runningLaunch.isTerminated()) { return false; } IProcess[] processes = runningLaunch.getProcesses(); if (ListUtil.isEmpty(processes)) { return false; } IProcess process = processes[0]; if ((process == null) || process.isTerminated()) { return false; } return true; }
@Override public void update() { ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); for (int i = 0; i < launches.length; i++) { ILaunch launch = launches[i]; if (launch.isTerminated()) { setEnabled(true); return; } } setEnabled(false); }
/** * Goes through all the dart launches registered with the {@link ILaunchManager} and removes the * terminated launches * * @throws CoreException */ public static void removeTerminatedLaunches() throws CoreException { ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); for (ILaunch launch : launches) { if (launch.getLaunchConfiguration() == null || (launch.getLaunchConfiguration().getType().getIdentifier().startsWith( "com.github.sdbg") && launch.isTerminated())) { removeLaunch(launch); } } }
/** * Appends the text '(already running)' to the tooltip label if there is a launch currently * running (not terminated) with the same backing launch configuration as the one specified * @param config the {@link ILaunchConfiguration} to check for running state * @return the appended string for the tooltip label or the configuration name (default) */ private String appendLaunched(ILaunchConfiguration config) { ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches(); boolean launched = false; ILaunchConfiguration tmp = null; for(int i = 0; i < launches.length; i++) { tmp = launches[i].getLaunchConfiguration(); if(tmp != null) { if(!launches[i].isTerminated() && tmp.equals(config)) { launched = true; break; } } } if(launched) { return MessageFormat.format(ContextMessages.LaunchingResourceManager_0, new Object[] { config.getName() }); } return config.getName(); }
if ((monitor != null) && monitor.isCanceled() && !launch.isTerminated()) { if (process != null) { process.terminate();
/** * Removes terminated launches from the launch view, leaving the specified launch in the view * @param newLaunch the newly added launch to leave in the view */ protected void removeTerminatedLaunches(ILaunch newLaunch) { if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES)) { ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager(); Object[] launches= lManager.getLaunches(); for (int i= 0; i < launches.length; i++) { ILaunch launch= (ILaunch)launches[i]; if (launch != newLaunch && launch.isTerminated()) { lManager.removeLaunch(launch); } } } }