Package org.eclipse.ui.contexts

Examples of org.eclipse.ui.contexts.IContextActivation


      return;
    }

    Iterator c = fLocalActivations.keySet().iterator();
    while (c.hasNext()) {
      IContextActivation activation = (IContextActivation) c.next();
      super.doActivateContext(activation);
    }
    fActive = true;
  }
View Full Code Here


   * @see org.eclipse.ui.contexts.IContextService#activateContext(java.lang.String,
   *      org.eclipse.core.expressions.Expression)
   */
  public final IContextActivation activateContext(final String contextId,
      final Expression expression) {
    final IContextActivation activation = new ContextActivation(contextId,
        expression, this);
    contextAuthority.activateContext(activation);
    return activation;
  }
View Full Code Here

   * @see org.eclipse.ui.contexts.IContextService#deactivateContexts(java.util.Collection)
   */
  public final void deactivateContexts(final Collection activations) {
    final Iterator activationItr = activations.iterator();
    while (activationItr.hasNext()) {
      final IContextActivation activation = (IContextActivation) activationItr
          .next();
      deactivateContext(activation);
    }
  }
View Full Code Here

   *      org.eclipse.core.expressions.Expression, boolean)
   */
  public IContextActivation activateContext(String contextId,
      Expression expression, boolean global) {
    if (global) {
      IContextActivation activation = fParentService.activateContext(
          contextId, expression, global);
      fParentActivations.add(activation);
      return activation;
    }
    AndExpression andExpression = null;
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.ui.contexts.IContextService#deactivateContext(org.eclipse.ui.contexts.IContextActivation)
   */
  public void deactivateContext(IContextActivation activation) {
    IContextActivation parentActivation = null;
    if (fLocalActivations.containsKey(activation)) {
      parentActivation = (IContextActivation) fLocalActivations
          .remove(activation);
    } else {
      parentActivation = activation;
View Full Code Here

   * @param expression
   *            the expression to use
   * @return the activated context
   */
  protected IContextActivation doActivateContext(IContextActivation activation) {
    IContextActivation parentActivation = fParentService.activateContext(
        activation.getContextId(), activation.getExpression());
    fParentActivations.add(parentActivation);
    fLocalActivations.put(activation, parentActivation);
    return activation;
  }
View Full Code Here

       */
      oldActivations = (Collection) registeredWindows.get(null);
      if (oldActivations != null) {
        final Iterator oldActivationItr = oldActivations.iterator();
        while (oldActivationItr.hasNext()) {
          final IContextActivation activation = (IContextActivation) oldActivationItr
              .next();
          deactivateContext(activation);
        }
      }
    }

    /*
     * If the new active shell is recognized as a dialog by default, then
     * create some submissions, remember them, and submit them for
     * processing.
     */
    if ((newShell != null) && (!newShell.isDisposed())) {
      final Collection newActivations;

      if ((newShell.getParent() != null)
          && (registeredWindows.get(newShell) == null)) {
        // This is a dialog by default.
        newActivations = new ArrayList();
        final Expression expression = new ActiveShellExpression(
            newShell);
        final IContextActivation dialogWindowActivation = new ContextActivation(
            IContextService.CONTEXT_ID_DIALOG_AND_WINDOW,
            expression, contextService);
        activateContext(dialogWindowActivation);
        newActivations.add(dialogWindowActivation);
        final IContextActivation dialogActivation = new ContextActivation(
            IContextService.CONTEXT_ID_DIALOG, expression,
            contextService);
        activateContext(dialogActivation);
        newActivations.add(dialogActivation);
        registeredWindows.put(null, newActivations);
View Full Code Here

   *         <code>false</code> otherwise.
   */
  private final boolean containsActive(final Collection activations) {
    final Iterator activationItr = activations.iterator();
    while (activationItr.hasNext()) {
      final IContextActivation activation = (IContextActivation) activationItr
          .next();
      if (evaluate(activation)) {
        return true;
      }
    }
View Full Code Here

        if (contextActivations.isEmpty()) {
          contextActivationsByContextId.remove(contextId);
          updateContext(contextId, false);

        } else if (contextActivations.size() == 1) {
          final IContextActivation remainingActivation = (IContextActivation) contextActivations
              .iterator().next();
          contextActivationsByContextId.put(contextId,
              remainingActivation);
          updateContext(contextId, evaluate(remainingActivation));
View Full Code Here

      }

      // Look for the right type of context id.
      final Iterator activationItr = activations.iterator();
      while (activationItr.hasNext()) {
        final IContextActivation activation = (IContextActivation) activationItr
            .next();
        final String contextId = activation.getContextId();
        if (contextId == IContextService.CONTEXT_ID_DIALOG) {
          return IContextService.TYPE_DIALOG;
        } else if (contextId == IContextService.CONTEXT_ID_WINDOW) {
          return IContextService.TYPE_WINDOW;
        }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.contexts.IContextActivation

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.