@Override public Object execute(ExecutionEvent event) throws ExecutionException { try { IParameter configparameter = event.getCommand().getParameter(PARAMETER_LAUNCHCONFIG); IParameterValues values = configparameter.getValues(); if (values instanceof LaunchParameterValues){ LaunchParameterValues launchParameterValues = (LaunchParameterValues) values; taskAttributeOverride = launchParameterValues.getOverriddenTasks(); launch = launchParameterValues.getLaunch(); postJob = launchParameterValues.getPostJob(); }else{ IDEUtil.logWarning(getClass().getSimpleName()+":parameter values without being a launch parameter value was used !??! :"+ values); } } catch (NotDefinedException | ParameterValuesException e) { throw new IllegalStateException("Cannot fetch command parameter!", e); } return super.execute(event); }
/** * This is an ugly workaround to prevent that * <code>PlatformUI.getWorkbench()</code> is called. */ private static boolean checkE4Parameter(final IParameterValues inValue) { if (inValue instanceof PerspectiveParameterValues || inValue instanceof PreferencePageParameterValues || inValue instanceof ViewParameterValues || inValue instanceof WizardParameterValues) { return false; } return true; }
public IParameterValues getValues() throws ParameterValuesException{ return new IParameterValues() { public Map getParameterValues(){ return new HashMap<String, String>(); } }; }
@Override public IParameterValues getValues() throws ParameterValuesException { return null; }