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; }
/** * 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()]); } }
/** * @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; } }
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 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); } }); }
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); } });
return status; final ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode); if (group == null) { return status;
/** * @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); } } }
ILaunchConfiguration configuration = launch.getLaunchConfiguration(); if (configuration != null) { ILaunchGroup group= DebugUITools.getLaunchGroup(configuration, getMode()); if (group == null) { return false;
ILaunchGroup group = DebugUITools.getLaunchGroup(fConfiguration, fMode); if(group != null) { DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(fConfiguration), group.getIdentifier());
ILaunchGroup group = DebugUITools.getLaunchGroup(config, mode); final String groupId = group==null?"":group.getIdentifier(); //$NON-NLS-1$ final ILaunchConfiguration configuration = config;