/** * @param configuration */ private void relaunchInDebugMode(ILaunchConfiguration configuration) { DebugUITools.launch(configuration, ILaunchManager.DEBUG_MODE); } }
@Override protected IBaseLabelProvider getLabelProvider() { return DebugUITools.newDebugModelPresentation(); } }
@Override public Image getImage() { return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_BREAKPOINTS); } }
private IAdaptable getDebugContext() { if (fView != null) { return DebugUITools.getPartDebugContext(fView.getSite()); } else { return DebugUITools.getDebugContext(); } } }
public void run() { DebugPlugin.getDefault().getLaunchManager().addLaunchListener(new SPLaunchListener(config)); if (identifier.getType() == ProcIdentifier.TYPE_TRIGGER) { ILaunchGroup group = DebugUITools.getLaunchGroup(config, spmode); String groupId = group == null ? "" : group.getIdentifier(); //$NON-NLS-1$ DebugUITools.openLaunchConfigurationDialog(getShell(), config, groupId, null); return; } DebugUITools.launch(config, spmode); } });
/** * Delegate method to launch the specified <code>ILaunchConfiguration</code> in the specified mode * * @param mode * the mode to launch in * @param configuration * the <code>ILaunchConfiguration</code> to launch */ private void launch(String mode, ILaunchConfiguration configuration) { if (fShowDialog) { /* * // Offer to save dirty editors before opening the dialog as the contents // of an Ant editor often affect the contents of the dialog. * if (!DebugUITools.saveBeforeLaunch()) { return; } */ IStatus status = new Status(IStatus.INFO, IAntUIConstants.PLUGIN_ID, IAntUIConstants.STATUS_INIT_RUN_ANT, IAntCoreConstants.EMPTY_STRING, null); String groupId; if (mode.equals(ILaunchManager.DEBUG_MODE)) { groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP; } else { groupId = org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_GROUP; } DebugUITools.openLaunchConfigurationDialog(AntUIPlugin.getActiveWorkbenchWindow().getShell(), configuration, groupId, status); } else { DebugUITools.launch(configuration, mode); } }
@Override public ImageDescriptor getImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_EXPORT_CONFIG); }
private static void handleInvocationTargetException(InvocationTargetException e, ILaunchConfiguration configuration, String mode) { Throwable targetException = e.getTargetException(); Throwable t = e; if (targetException instanceof CoreException) { t = targetException; } if (t instanceof CoreException) { CoreException ce = (CoreException)t; IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(ce.getStatus()); if (handler != null) { ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode); if (group != null) { DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(configuration), group.getIdentifier(), ce.getStatus()); return; } } if ((ce.getStatus().getSeverity() & (IStatus.ERROR | IStatus.WARNING)) == 0) { // If the exception is a CoreException with a status other // than ERROR or WARNING, don't open an error dialog. return; } } DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, DebugUIMessages.DebugUITools_Exception_occurred_during_launch_2, t); // }
private IDebugElement getContext() { IAdaptable object = DebugUITools.getDebugContext(); IDebugElement context = null; if (object instanceof IDebugElement) { context = (IDebugElement) object; } else if (object instanceof ILaunch) { context = ((ILaunch) object).getDebugTarget(); } return context; }
try { if (w.isEnabled()) { return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_WATCHPOINT); return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_WATCHPOINT_DISABLED); return DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED); if (ll.isEnabled()) { String key = flags + "enabled"; key, new ScriptDebugImageDescriptor(DebugUITools .getImageDescriptor(IDebugUIConstants.IMG_OBJS_BREAKPOINT), flags)); return registry.get(key); key, new ScriptDebugImageDescriptor(DebugUITools .getImageDescriptor(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED), flags)); return registry.get(key);
/** * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object) */ @Override public Object handleStatus(IStatus status, Object source) throws CoreException { if(source instanceof Object[]) { Object[] infos = (Object[]) source; if(infos.length == 2) { final ILaunchConfiguration config = (ILaunchConfiguration) infos[0]; final String mode = (String) infos[1]; final Shell shell = DebugUIPlugin.getShell(); Runnable runnable = () -> { ILaunchGroup group = DebugUITools.getLaunchGroup(config, mode); if (group != null) { DebugUITools.openLaunchConfigurationDialog(shell, config, group.getIdentifier(), null); } }; DebugUIPlugin.getStandardDisplay().asyncExec(runnable); } } return Status.OK_STATUS; } }
ILaunchGroup getLaunchConfigurationGroup(ILaunchConfiguration configuration, ILaunchRequest request) { ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, request.getLaunchMode()); // if (group == null) // { // group = // getLaunchConfigurationManager().getDefaultLanuchGroup( // request.getLaunchMode()); // } if (group == null) { throw new InternalError("LaunchConfigurationManager.getDefaultLanuchGroup() returns null"); } return group; }
ILaunchConfiguration configuration = launch.getLaunchConfiguration(); if (configuration != null) { ILaunchGroup group= DebugUITools.getLaunchGroup(configuration, getMode()); if (group == null) { return false; return false; if (DebugUITools.isPrivate(config)) { return false;
public void run() { DebugUITools.openLaunchConfigurationDialog(getShell(), configuration, groupId, null); } }
@Override public ImageDescriptor getDisabledImageDescriptor() { return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DUPLICATE_CONFIG); }
private static void generateErrorDialog(final String title, final String message, final ILaunchConfiguration launchConfig, final String mode) { getDisplay().syncExec(() -> { Shell parentShell = getActiveShell(); MessageDialog dialog = new MessageDialog(parentShell, title, null, message, MessageDialog.ERROR, 1, PDEUIMessages.LauncherUtils_edit, PDEUIMessages.LauncherUtils_cancelLaunch); int res = dialog.open(); if (res == 0) { IStructuredSelection selection = new StructuredSelection(launchConfig); ILaunchGroup group = DebugUITools.getLaunchGroup(launchConfig, mode); String groupIdentifier = group == null ? IDebugUIConstants.ID_RUN_LAUNCH_GROUP : group.getIdentifier(); IStatus status = new Status(IStatus.OK, PDELaunchingPlugin.getPluginId(), LauncherUtils.SELECT_WORKSPACE_FIELD, "", null); //$NON-NLS-1$ DebugUITools.openLaunchConfigurationDialogOnGroup(parentShell, selection, groupIdentifier, status); } }); }
/** * Returns the stack frame in which to search for properties, or <code>null</code> if none. * * @return the stack frame in which to search for properties, or <code>null</code> if none */ private AntStackFrame getFrame() { IAdaptable adaptable = DebugUITools.getDebugContext(); if (adaptable != null) { return adaptable.getAdapter(AntStackFrame.class); } return null; }
/** * @see org.eclipse.jface.action.IAction#run() */ @Override public void run() { ILaunchGroup group = DebugUITools.getLaunchGroup(getLaunchConfiguration(), getMode()); if (group != null) { if(isTerminated()) { DebugUITools.openLaunchConfigurationDialog( DebugUIPlugin.getShell(), getLaunchConfiguration(), group.getIdentifier(), null); } else { DebugUIPlugin.openLaunchConfigurationEditDialog( DebugUIPlugin.getShell(), getLaunchConfiguration(), group.getIdentifier(), null, false); } } }
/** * Collects all of the launch groups associated with the specified <code>ILaunchConfiguration</code> * @param config the config to collect launch groups for * @return the listing of associated <code>ILaunchGroup</code>s for the specified <code>ILaunchConfiguration</code>, or * an empty listing, never <code>null</code> * @since 3.4 */ private ILaunchGroup[] getAllGroupsForConfiguration(ILaunchConfiguration config) { ArrayList<ILaunchGroup> list = new ArrayList<>(); try { ILaunchConfigurationType type = config.getType(); Set<Set<String>> modes = type.getSupportedModeCombinations(); String mode = null; ILaunchGroup group = null; for (Set<String> modesets : modes) { if(modesets.size() == 1) { mode = (String) modesets.toArray()[0]; group = DebugUITools.getLaunchGroup(config, mode); if(group != null && !list.contains(group)) { list.add(group); } } } } catch(CoreException ce) {} return list.toArray(new ILaunchGroup[list.size()]); } }
/** * Re-launches the given configuration in the specified mode. * */ public static void relaunch(ILaunchConfiguration config, String mode) { DebugUITools.launch(config, mode); }