@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; }
/** * Computes and return common adornment flags for the given category. * * @return adornment flags defined in CompositeDebugImageDescriptor */ private int computeAdornmentFlags() { if (!DebugPlugin.getDefault().getBreakpointManager().isEnabled()) { return CompositeDebugImageDescriptor.SKIP_BREAKPOINT; } return 0; } }
/** * Returns the source container type identified by the given id, * or <code>null</code> if none. * * @param id source container type identifier * @return source container type or <code>null</code> */ protected ISourceContainerType getSourceContainerType(String id) { return DebugPlugin.getDefault().getLaunchManager().getSourceContainerType(id); } }
private static ILaunchConfiguration[] getAntLaunchConfigurations() throws CoreException { ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); // Ant launch configurations ILaunchConfigurationType configurationType = manager.getLaunchConfigurationType(IAntLaunchConstants.ID_ANT_LAUNCH_CONFIGURATION_TYPE); ILaunchConfiguration[] configs = manager.getLaunchConfigurations(configurationType); return configs; }
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); ILaunchConfigurationType antType = launchManager.getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE); ILaunchConfigurationWorkingCopy workingCopy = antType.newInstance(BuilderUtils.getBuilderFolder(project, true), "lstest" ); workingCopy.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false); workingCopy.setAttribute(IExternalToolConstants.ATTR_LOCATION, "${project_loc}\\YOUR_SHELL_SCRIPT"); workingCopy.setAttribute(....); ILaunchConfiguration ilc = workingCopy.doSave();
/** * This method is called by the debug UI plug-in at shutdown. */ public void shutdown() { DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); }
@Override protected void initialize() { DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); }
public void setRunConfVmArgs(final ILaunchConfiguration conf, final String vmargs) throws CoreException { ILaunchConfigurationWorkingCopy confWc = conf.getWorkingCopy(); confWc.setAttribute(JunitLaunchListener.VM_ARGS, vmargs); confWc.doSave(); }
/** * Returns an array of environment variables to be used when * launching the given configuration or <code>null</code> if unspecified. * * @param configuration launch configuration * @return the environment variables to be used when launching or <code>null</code> * @throws CoreException if unable to access associated attribute or if * unable to resolve a variable in an environment variable's value */ public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException { return DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration); }
public void removeListener() { if (fLaunchConfigurationListener != null) { DebugPlugin.getDefault().getLaunchManager() .removeLaunchConfigurationListener( fLaunchConfigurationListener); fLaunchConfigurationListener = null; } } }
public void handleDebugEvents(DebugEvent[] events) { DebugEvent event; for (int i= 0, numEvents= events.length; i < numEvents; i++) { event= events[i]; if ((event.getKind() & DebugEvent.SUSPEND) != 0 && event.getSource() instanceof IJavaThread && event.isEvaluation()) { fTerminated= true; } } DebugPlugin.getDefault(). removeDebugEventListener(this); }
@Override public Object[] getElements(Object inputElement) { return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); } @Override
ILaunchConfigurationWorkingCopy workingCopy = launchConfig.getWorkingCopy(); workingCopy.delete(); ILaunchConfigurationType launchType = launchConfig.getType(); IContainer container = launchConfig.getFile() == null ? null : launchConfig.getFile().getParent(); ILaunchConfigurationWorkingCopy newLaunchConfig = launchType.newInstance( container, workingCopy.getName() ); // copy all attributes from 'launchConfig' to 'newLaunchConfig' newLaunchConfig.doSave();
public void dispose() { fDisposed = true; DebugPlugin.getDefault().getMemoryBlockManager().removeListener(this); DebugPlugin.getDefault().removeDebugEventListener(this); }
/** * Fires a custom model specific event when this connector is ready to accept incoming * connections from a remote VM. */ protected void fireReadyToAcceptEvent(){ DebugPlugin manager= DebugPlugin.getDefault(); if (manager != null) { manager.fireDebugEventSet(new DebugEvent[]{new DebugEvent(this, DebugEvent.MODEL_SPECIFIC, IJavaLaunchConfigurationConstants.DETAIL_CONFIG_READY_TO_ACCEPT_REMOTE_VM_CONNECTION)}); } }
@Override protected void initialize() { DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this); }
/** * Returns the breakpoint associated with the given marker. * * @param marker breakpoint marker * @return breakpoint or <code>null</code> */ protected IBreakpoint getBreakpoint(IMarker marker) { return DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker); }
/** * Returns an array of environment variables to be used when * launching the given configuration or <code>null</code> if unspecified. * * @param configuration launch configuration * @return an array of environment variables to use when launching the given configuration or null if unspecified * @throws CoreException if unable to access associated attribute or if * unable to resolve a variable in an environment variable's value * @since 3.1 */ public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException { return DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration); }
/** * Computes and return common adornment flags for the given category. * * @return adornment flags defined in CompositeDebugImageDescriptor */ private int computeAdornmentFlags() { if (!DebugPlugin.getDefault().getBreakpointManager().isEnabled()) { return CompositeDebugImageDescriptor.SKIP_BREAKPOINT; } return 0; }
/** * Fires a custom model specific event when this connector is ready to accept incoming * connections from a remote VM. */ protected void fireReadyToAcceptEvent(){ DebugPlugin manager= DebugPlugin.getDefault(); if (manager != null) { manager.fireDebugEventSet(new DebugEvent[]{new DebugEvent(this, DebugEvent.MODEL_SPECIFIC, IJavaLaunchConfigurationConstants.DETAIL_CONFIG_READY_TO_ACCEPT_REMOTE_VM_CONNECTION)}); } }