/** * {@inheritDoc} */ @Override public Object getVariable(String name) { return fManagedPool.getVariable(name); }
/** * {@inheritDoc} */ @Override public Object getVariable(String name) { return fManagedPool.getVariable(name); }
@Override public Object getVariable(String name) { return fParent.getVariable(name); } @Override
@Override public Object getVariable(String name) { return fParent.getVariable(name); } @Override
/** * Returns the variable of the given name. * * @param name * The name of the variable to get; must not be <code>null</code>. * @return The variable of the given name; <code>null</code> if none. */ protected final Object getVariable(final String name) { return context.getVariable(name); }
/** * {@inheritDoc} */ public Object getVariable(String name) { return fManagedPool.getVariable(name); }
@Override public Object getVariable(String name) { return fParent.getVariable(name); } @Override
@Override public EvaluationResult evaluate(final IEvaluationContext context) throws CoreException { if (window != null) { Object value = context .getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); if (window.equals(value)) { return EvaluationResult.TRUE; } } return EvaluationResult.FALSE; }
/** * Returns the first element of the current selection * @param context the current evaluation context * @return the first item in the selection, or <code>null</code> if none * @since 3.3 */ private Object getSelection(IEvaluationContext context) { List<?> list = (List<?>) context.getVariable("selection"); //$NON-NLS-1$ return (list.isEmpty() ? null : list.get(0)); }
private void copyVariable(IEvaluationContext context, IEvaluationContext tmpContext, String var) { Object o = tmpContext.getVariable(var); if (o != null) { context.addVariable(var, o); } }
@Override public void setEnabled(Object evaluationContext) { super.setEnabled(evaluationContext); if (evaluationContext instanceof IEvaluationContext) { Object activePart = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME); if (activePart instanceof LogView) { logView = (LogView) activePart; } } }
@Override public final EvaluationResult evaluate(final IEvaluationContext context) { final Object variable = context .getVariable(ISources.ACTIVE_PART_ID_NAME); if (equals(activeEditorId, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
@Override public void setEnabled(Object evaluationContext) { fStrictCheckIfTextLocation= true; if (evaluationContext instanceof IEvaluationContext) { Object selection= ((IEvaluationContext)evaluationContext).getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME); fStrictCheckIfTextLocation= !(selection instanceof ITextSelection); } super.setEnabled(evaluationContext); } }
@Override public EvaluationResult evaluate(final IEvaluationContext context) { final Object variable = context.getVariable(ISources.ACTIVE_PART_NAME); if (equals(activePart, variable)) { return EvaluationResult.TRUE; } return EvaluationResult.FALSE; }
/** * {@inheritDoc} */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { // Get the input definition out of the context IEvaluationContext context = (IEvaluationContext) event.getApplicationContext(); Item column = (Item) context.getVariable(COLUMN_PARAM); Boolean visible = (Boolean) context.getVariable(VISIBLE_PARAM); Class<?> inputControllerClass = (Class<?>) context.getVariable(CONTROLLER_CLASS_PARAM); showHideColumn(column, column.getText(), visible.booleanValue(), inputControllerClass); return null; }
@Override public void setEnabled(Object evaluationContext) { boolean enabled = false; if (evaluationContext instanceof IEvaluationContext) { Object activeEditor = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_EDITOR_NAME); if (activeEditor instanceof IEditorPart) { enabled = getActiveTextEditor((IEditorPart) activeEditor) != null; } } setBaseEnabled(enabled); }
@Override public void setEnabled(Object evaluationContext) { boolean contentAssistAvailable = false; if (evaluationContext instanceof IEvaluationContext) { Object var = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_EDITOR_NAME); if (var instanceof XtextEditor) { contentAssistAvailable = ((XtextEditor) var).isContentAssistAvailable(); } } super.setBaseEnabled(isEnabled() & contentAssistAvailable); } }
@Override public Object execute(ExecutionEvent event) throws ExecutionException { IEvaluationContext context = (IEvaluationContext) event.getApplicationContext(); IWorkbench workbench = (IWorkbench) context.getVariable(IWorkbench.class.getName()); if (TRUE.equals(event.getParameter(COMMAND_PARAMETER_ID_MAY_PROMPT))) { workbench.getDisplay().close(); } else { workbench.close(); } return null; } }
public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object variable= context.getVariable(fVariable); if (variable == null) { throw new CoreException(new ExpressionStatus( ExpressionStatus.VARIABLE_NOT_DEFINED, Messages.format(ExpressionMessages.WithExpression_variable_not_defined, fVariable))); } if (variable == IEvaluationContext.UNDEFINED_VARIABLE) { return EvaluationResult.FALSE; } return evaluateAnd(new EvaluationContext(context, variable)); }
@Override public EvaluationResult evaluate(IEvaluationContext context) throws CoreException { Object variable= context.getVariable(fVariable); if (variable == null) { throw new CoreException(new ExpressionStatus( ExpressionStatus.VARIABLE_NOT_DEFINED, Messages.format(ExpressionMessages.WithExpression_variable_not_defined, fVariable))); } if (variable == IEvaluationContext.UNDEFINED_VARIABLE) { return EvaluationResult.FALSE; } return evaluateAnd(new EvaluationContext(context, variable)); }