/** * {@inheritDoc} */ @Override public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); }
@Override public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); } @Override
/** * {@inheritDoc} */ @Override public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); }
/** * {@inheritDoc} */ public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); }
@Override public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); } @Override
@Override public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); } @Override
@Override public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); }
public void setAllowPluginActivation(boolean value) { fParent.setAllowPluginActivation(value); } public void addVariable(String name, Object value) {
/** * Constructs a new instance of <code>ExpressionAuthority</code>. */ protected ExpressionAuthority() { context = new EvaluationContext(null, this); context.setAllowPluginActivation(true); context.addVariable("org.eclipse.core.runtime.Platform", Platform.class); //$NON-NLS-1$ // this is not as useful as it appears // context.addVariable("java.lang.System", System.class); //$NON-NLS-1$ }
/** * @return an Evaluation context with default variable = selection */ private IEvaluationContext createContext() { IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection(); Object o = ss.getFirstElement(); List<IEditorInput> list = new ArrayList<>(0); if(o instanceof IEditorPart) { list.add(((IEditorPart)o).getEditorInput()); } else { list.addAll(ss.toList()); } IEvaluationContext context = DebugUIPlugin.createEvaluationContext(list); context.setAllowPluginActivation(true); context.addVariable("selection", list); //$NON-NLS-1$ return context; }
list.add(resource); IEvaluationContext context = DebugUIPlugin.createEvaluationContext(list); context.setAllowPluginActivation(true); context.addVariable("selection", list); //$NON-NLS-1$ HashSet<String> contributedTypeIds = new HashSet<>();
/** * Determine if this content extension is enabled for the given selection. * The content extension is enabled for the selection if and only if it is * enabled for each element in the selection. * * @param aStructuredSelection * The selection from the viewer * @return True if and only if the extension is enabled for each element in * the selection. */ public boolean isEnabledFor(IStructuredSelection aStructuredSelection) { if (enablement == null) { return false; } IEvaluationContext context = null; Iterator elements = aStructuredSelection.iterator(); while (elements.hasNext()) { context = new EvaluationContext(null, elements.next()); context.setAllowPluginActivation(true); try { if (enablement.evaluate(context) == EvaluationResult.FALSE) { return false; } } catch (CoreException e) { NavigatorPlugin.log(IStatus.ERROR, 0, e.getMessage(), e); return false; } } return true; }
/** * @param anObject * The selection from the CommonViewer * @return True if this dscriptor can determine a valid editor to activate * from the selection. */ public boolean isEnabledFor(Object anObject) { if (selectionEnablement == null) { return false; } IEvaluationContext context = new EvaluationContext(null, anObject); context.setAllowPluginActivation(true); try { if (selectionEnablement.evaluate(context) != EvaluationResult.TRUE) { return false; } } catch (CoreException e) { NavigatorPlugin.log(IStatus.ERROR, 0, e.getMessage(), e); return false; } return true; } }
IEvaluationContext context = null; context = new EvaluationContext(null, Collections.EMPTY_LIST); context.setAllowPluginActivation(true); try { if (enablement.evaluate(context) != EvaluationResult.TRUE) { while (elements.hasNext()) { context = new EvaluationContext(null, elements.next()); context.setAllowPluginActivation(true); try { if (enablement.evaluate(context) != EvaluationResult.TRUE) {
context.setAllowPluginActivation(true); context.addVariable("selection", selection); //$NON-NLS-1$ List<LaunchShortcutExtension> allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts();
IEvaluationContext context = new EvaluationContext(null, object); context.setAllowPluginActivation(true); context.addVariable("selection", object); //$NON-NLS-1$ context.addVariable("org.eclipse.core.runtime.Platform", Platform.class); //$NON-NLS-1$