public static boolean generateConfigIni() throws CoreException { Status status = new Status(IStatus.ERROR, IPDEConstants.PLUGIN_ID, GENERATE_CONFIG_INI, null, null); IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); return statusHandler == null ? true : ((Boolean) statusHandler.handleStatus(status, null)).booleanValue(); }
/** * Issues an user prompt using the status handler registered for the given * status. * * @param status * IStatus object to find prompter for * @param info * additional information passed to the handler * @return boolean result returned by the status handler * @throws CoreException * if the status has severity error and no handler is available */ private boolean showPrompt(IStatus status, Object info) throws CoreException { IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler( PROMPT_STATUS); if (prompter == null) { if (status.getSeverity() == IStatus.ERROR) { throw new CoreException(status); } else { return true; } } else { return ((Boolean) prompter.handleStatus(status, info)).booleanValue(); } }
protected boolean handleClasspathTooLongStatus() throws CoreException { IStatus status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), IJavaLaunchConfigurationConstants.ERR_CLASSPATH_TOO_LONG, "", null); //$NON-NLS-1$ IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); if (handler == null) { return false; } Object result = handler.handleStatus(status, launch); if (!(result instanceof Boolean)) { return false; } return (boolean) result; }
if(!((Boolean)prompter.handleStatus(saveScopedDirtyEditors, new Object[]{configuration, buildOrder})).booleanValue()) { return false;
public static void runValidationOperation(final LaunchValidationOperation op, IProgressMonitor monitor) throws CoreException { op.run(monitor); if (op.hasErrors()) { String message = NLS.bind(PDEMessages.PluginValidation_error, op.getInput().toString()); Status status = new Status(IStatus.ERROR, IPDEConstants.PLUGIN_ID, DISPLAY_VALIDATION_ERROR_CODE, message, null); IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); if (statusHandler == null) PDELaunchingPlugin.log(status); else statusHandler.handleStatus(status, op); } }
return handler.handleStatus(status, source); Runnable r = () -> { try { result[0] = handler.handleStatus(status, source); } catch (CoreException e) { exception[0] = e;
Object result = handler.handleStatus(status, null); if (result instanceof Boolean && ((Boolean)result).booleanValue()) { p= exec(cmdLine, null);
/** * Consult a status handler for the given status, if any. The status handler * is passed this launch config dialog as an argument. * * @param status the status to be handled */ public void handleStatus(IStatus status) { IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); if (handler != null) { try { handler.handleStatus(status, this); return; } catch (CoreException e) {status = e.getStatus();} } // if no handler, or handler failed, display error/warning dialog String title = null; switch (status.getSeverity()) { case IStatus.ERROR: title = LaunchConfigurationsMessages.LaunchConfigurationsDialog_Error_1; break; case IStatus.WARNING: title = LaunchConfigurationsMessages.LaunchConfigurationsDialog_Warning_2; break; default: title = LaunchConfigurationsMessages.LaunchConfigurationsDialog_Information_3; break; } ErrorDialog.openError(getShell(), title, null, status); }
@Override public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 1); //$NON-NLS-1$ try { IProject[] projects = getProjectsForProblemSearch(configuration, mode); if (projects == null) { return true; //continue launch } boolean continueLaunch = true; monitor.subTask(DebugCoreMessages.LaunchConfigurationDelegate_6); List<IAdaptable> errors = new ArrayList<IAdaptable>(); for (int i = 0; i < projects.length; i++) { monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchConfigurationDelegate_7, new Object[] { projects[i].getName() })); if (existsProblems(projects[i])) { errors.add(projects[i]); } } if (!errors.isEmpty()) { errors.add(0, configuration); IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); if (prompter != null) { continueLaunch = ((Boolean) prompter.handleStatus(complileErrorProjectPromptStatus, errors)).booleanValue(); } } return continueLaunch; } finally { monitor.done(); } }
private void validateExtensions() { try { String[] required = RequirementHelper.getApplicationRequirements(fLaunchConfiguration); for (int i = 0; i < required.length; i++) { BundleDescription bundle = getState().getBundle(required[i], null); if (bundle == null) { String message = NLS.bind(PDEMessages.EclipsePluginValidationOperation_pluginMissing, required[i]); Status status = new Status(IStatus.ERROR, IPDEConstants.PLUGIN_ID, CREATE_EXTENSION_ERROR_CODE, message, null); IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); Object extensionError = null; if (statusHandler == null) extensionError = status.getMessage(); else extensionError = statusHandler.handleStatus(status, required[i]); fExtensionErrors.put(extensionError, EMPTY); } } } catch (CoreException e) { PDELaunchingPlugin.log(e); } }
if (prompter != null) { try { Object result = prompter.handleStatus(fResolveDuplicatesStatus, new Object[]{element, sources}); if (result != null) { cacheResolvedElement(sources, result);
@Override public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { if (!saveBeforeLaunch(configuration, mode, monitor)) { return false; } if (mode.equals(ILaunchManager.RUN_MODE) && configuration.supportsMode(ILaunchManager.DEBUG_MODE)) { IBreakpoint[] breakpoints= getBreakpoints(configuration); if (breakpoints == null) { return true; } for (int i = 0; i < breakpoints.length; i++) { if (breakpoints[i].isEnabled()) { IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); if (prompter != null) { boolean launchInDebugModeInstead = ((Boolean)prompter.handleStatus(switchToDebugPromptStatus, configuration)).booleanValue(); if (launchInDebugModeInstead) { return false; //kill this launch } } // if no user prompt, or user says to continue (no need to check other breakpoints) return true; } } } // no enabled breakpoints... continue launch return true; }
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration(); String workspace = launchConfiguration.getAttribute(IPDELauncherConstants.LOCATION, ""); //$NON-NLS-1$ statusHandler.handleStatus(status, new Object[] {workspace, launchConfiguration, launch.getLaunchMode()}); PDELaunchingPlugin.log(status); else statusHandler.handleStatus(status, launch); return;
private void doRestart(ILaunch launch) { ILaunchConfiguration config = launch.getLaunchConfiguration(); try { ILaunchConfigurationWorkingCopy copy = config.getWorkingCopy(); copy.setAttribute(IPDEConstants.RESTART, true); copy.launch(launch.getLaunchMode(), new NullProgressMonitor()); } catch (CoreException e) { Status status = new Status(IStatus.ERROR, IPDEConstants.PLUGIN_ID, 42, null, e); IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); if (statusHandler == null) PDELaunchingPlugin.log(e); else { try { statusHandler.handleStatus(status, null); } catch (CoreException e1) { // status handler failed to log the original exception // log it ourselves PDELaunchingPlugin.log(e); } } } }
Boolean status = (Boolean)handler.handleStatus(PROMPT_STATUS, proc); if (!status.booleanValue())
IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); if (statusHandler != null) statusHandler.handleStatus(status, new Object[] {workspace, configuration, fLastLaunchMode}); subMon.done(); if (monitor != null) { IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); if (statusHandler != null) result = ((Integer) statusHandler.handleStatus(status, null)).intValue(); } else { Status status = new Status(IStatus.ERROR, IPDEConstants.PLUGIN_ID, DELETE_WORKSPACE, null, null); IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); if (statusHandler != null) result = ((Integer) statusHandler.handleStatus(status, workspaceFile.getPath())).intValue();
IStatusHandler statusHandler = DebugPlugin.getDefault().getStatusHandler(status); if (statusHandler != null) statusHandler.handleStatus(status, new Object[] {projects, monitor, getLastRun()});
Object result = handler.handleStatus(status, this); if (result instanceof Boolean) { retry = ((Boolean)result).booleanValue();
Object result = handler.handleStatus(status, this); if (result instanceof Boolean) { retry = ((Boolean)result).booleanValue();
IStatusHandler handler = new SaveRoutineStatusHandler(); Boolean status = (Boolean)handler.handleStatus(SPLaunchShortcut.PROMPT_STATUS, profile); if (!status.booleanValue())