Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.Expression


      return;
    }

    List<IAction> debugActions = getActions(menuService);
    for (IAction action : debugActions) {
      additions.addContributionItem(new ActionContributionItem(action), new Expression() {
        public EvaluationResult evaluate(IEvaluationContext context) {
          return EvaluationResult.TRUE;
        }

        public void collectExpressionInfo(ExpressionInfo info) {
View Full Code Here


  /**
   * Initialize the slave services for this site.
   */
  private void initializeDefaultServices() {
    final Expression defaultExpression = new ActivePartExpression(
        multiPageEditor);

    final IHandlerService parentService = (IHandlerService) serviceLocator
        .getService(IHandlerService.class);
    final IHandlerService slave = new NestableHandlerService(parentService,
View Full Code Here

   * @see org.eclipse.ui.internal.AbstractEvaluationHandler#getEnabledWhenExpression()
   */
  protected Expression getEnabledWhenExpression() {
    // TODO Auto-generated method stub
    if (enabledWhen == null) {
      enabledWhen = new Expression() {
        public EvaluationResult evaluate(IEvaluationContext context)
            throws CoreException {
          IWorkbenchPart part = InternalHandlerUtil
              .getActivePart(context);
          if (part != null) {
View Full Code Here

  /**
   * Initialize the slave services for this site.
   */
  private void initializeDefaultServices() {
    final IWorkbenchPart parentPart = parentSite.getPart();
    final Expression defaultExpression = new ActivePartExpression(
        parentPart);

    final IHandlerService parentService = (IHandlerService) parentSite
        .getService(IHandlerService.class);
    final IHandlerService slave = new NestableHandlerService(parentService,
View Full Code Here

          "Handlers need a class", commandId)) { //$NON-NLS-1$
        continue;
      }

      // Get the activeWhen and enabledWhen expressions.
      final Expression activeWhenExpression = readWhenElement(
          configurationElement, TAG_ACTIVE_WHEN, commandId,
          warningsToLog);
      if (activeWhenExpression == ERROR_EXPRESSION) {
        continue;
      }
      final Expression enabledWhenExpression = readWhenElement(
          configurationElement, TAG_ENABLED_WHEN, commandId,
          warningsToLog);
      if (enabledWhenExpression == ERROR_EXPRESSION) {
        continue;
      }
View Full Code Here

      buffer.write("\thandler="); //$NON-NLS-1$
      buffer.write(handler==null?"":handler.toString()); //$NON-NLS-1$
      buffer.write(',');
      buffer.newLine();
      buffer.write("\texpression="); //$NON-NLS-1$
      Expression exp = getExpression();
      buffer.write(exp==null?"":exp.toString()); //$NON-NLS-1$
      buffer.write(",sourcePriority="); //$NON-NLS-1$
      buffer.write(Integer.toString(getSourcePriority()));
      buffer.write(')');
      buffer.flush();
    } catch (IOException e) {
View Full Code Here

          activationsByExpression = new HashMap(
              ACTIVATIONS_BY_SOURCE_SIZE);
          activationsByExpressionBySourcePriority[i] = activationsByExpression;
        }

        final Expression expression = activation.getExpression();
        Collection activations = (Collection) activationsByExpression
            .get(expression);
        if (activations == null) {
          activations = new HashSet();
          activationsByExpression.put(expression, activations);
View Full Code Here

        final Map activationsByExpression = activationsByExpressionBySourcePriority[i];
        if (activationsByExpression == null) {
          continue;
        }

        final Expression expression = activation.getExpression();
        final Collection activations = (Collection) activationsByExpression
            .get(expression);
        activations.remove(activation);
        if (activations.isEmpty()) {
          activationsByExpression.remove(expression);
View Full Code Here

   * @throws CoreException
   * @since 3.3
   */
  private boolean eval(IEvaluationContext context,
      IHandlerActivation activation) throws CoreException {
    Expression expression = activation.getExpression();
    if (expression == null) {
      return true;
    }
    return expression.evaluate(context) == EvaluationResult.TRUE;
  }
View Full Code Here

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression childExpression = childActivation.getExpression();
    final AndExpression expression;
    if (childExpression instanceof AndExpression) {
      expression = (AndExpression) childExpression;
    } else {
      expression = new AndExpression();
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.