Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.Expression


      IConfigurationElement[] kids = element.getChildren(TAG_ENABLEMENT);
      if (kids.length > 0) {
        enabler = new SelectionEnabler(element);
      }
    }
    final Expression enabledWhenExpression;
    if (enabler == null) {
      enabledWhenExpression = null;
    } else {
      enabledWhenExpression = new LegacySelectionEnablerWrapper(enabler,
          window);
View Full Code Here


      final String targetId = readRequired(element, ATT_TARGET_ID,
          warningsToLog, "Editor contributions need a target id", id); //$NON-NLS-1$
      if (targetId == null) {
        continue;
      }
      final Expression visibleWhenExpression = new LegacyEditorContributionExpression(
          targetId, window);

      // Read all of the child elements from the registry.
      readActionsAndMenus(element, id, warningsToLog,
          visibleWhenExpression, null);
View Full Code Here

      // TODO Read the filter elements.
      // TODO Read the enablement elements.

      // TODO Figure out an appropriate visibility expression.
      // Read the visibility element, if any.
      final Expression visibleWhenExpression = readVisibility(element,
          id, warningsToLog);

      // Read all of the child elements from the registry.
      readActionsAndMenus(element, id, warningsToLog,
          visibleWhenExpression, null);
View Full Code Here

      final String targetId = readRequired(element, ATT_TARGET_ID,
          warningsToLog, "View contributions need a target id", id); //$NON-NLS-1$
      if (targetId == null) {
        continue;
      }
      final Expression visibleWhenExpression = new LegacyViewContributionExpression(
          targetId, window);

      // Read all of the child elements from the registry.
      readActionsAndMenus(element, id, warningsToLog,
          visibleWhenExpression, targetId);
View Full Code Here

      if (targetId == null) {
        continue;
      }

      // Read the visibility element, if any.
      final Expression visibleWhenExpression = readVisibility(element,
          id, warningsToLog);
      final Expression menuVisibleWhenExpression = new LegacyViewerContributionExpression(
          targetId, window, visibleWhenExpression);

      // Read all of the child elements from the registry.
      readActionsAndMenus(element, id, warningsToLog,
          menuVisibleWhenExpression, targetId);
View Full Code Here

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression expression = childActivation.getExpression();
    final int depth = childActivation.getDepth() + 1;
    final IHandlerActivation localActivation = new HandlerActivation(
        commandId, handler, expression, depth, this);
    handlerAuthority.activateHandler(localActivation);
    return localActivation;
View Full Code Here

          actionIdByCommandId.put(commandId, actionID);
          // Register this as a handler with the given definition id.
          // the expression gives the setGlobalActionHandler() a
          // priority.
          final IHandler actionHandler = new ActionHandler(handler);
          Expression handlerExpression = EXPRESSION;
          //XXX add new API in next release to avoid down-casting (bug 137091)
          if (this instanceof EditorActionBars) {
            handlerExpression = ((EditorActionBars)this).getHandlerExpression();
          }
          final IHandlerActivation activation = service
View Full Code Here

            .getChildren(IWorkbenchRegistryConstants.TAG_VISIBLE_WHEN);
        if (visibleConfig.length > 0 && visibleConfig.length < 2) {
          IConfigurationElement[] visibleChild = visibleConfig[0]
              .getChildren();
          if (visibleChild.length > 0) {
            Expression visWhen = ExpressionConverter.getDefault()
                .perform(visibleChild[0]);
            visWhenMap.put(configElement, visWhen);
          }
        }
      } catch (InvalidRegistryObjectException e) {
View Full Code Here

   *
   * @see org.eclipse.ui.internal.AbstractEvaluationHandler#getEnabledWhenExpression()
   */
  protected Expression getEnabledWhenExpression() {
    if (enabledWhen == null) {
      enabledWhen = new Expression() {
        public EvaluationResult evaluate(IEvaluationContext context)
            throws CoreException {
          IWorkbenchPart part = InternalHandlerUtil
              .getActivePart(context);

View Full Code Here

  protected EvaluationResult evaluateAnd(IEvaluationContext scope) throws CoreException {
    if (fExpressions == null)
      return EvaluationResult.TRUE;
    EvaluationResult result= EvaluationResult.TRUE;
    for (Iterator iter= fExpressions.iterator(); iter.hasNext();) {
      Expression expression= (Expression)iter.next();
      result= result.and(expression.evaluate(scope));
      // keep iterating even if we have a not loaded found. It can be
      // that we find a false which will result in a better result.
      if (result == EvaluationResult.FALSE)
        return result;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.core.expressions.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.