Examples of MultiStatus


Examples of org.eclipse.core.runtime.MultiStatus

   *            The activation; must not be <code>null</code>.
   */
  final void activateHandler(final IHandlerActivation activation) {
    // First we update the handlerActivationsByCommandId map.
    final String commandId = activation.getCommandId();
    MultiStatus conflicts = new MultiStatus("org.eclipse.ui.workbench", 0//$NON-NLS-1$
        "A handler conflict occurred.  This may disable some commands.", //$NON-NLS-1$
        null);
    final Object value = handlerActivationsByCommandId.get(commandId);
    if (value instanceof SortedSet) {
      final SortedSet handlerActivations = (SortedSet) value;
      if (!handlerActivations.contains(activation)) {
        handlerActivations.add(activation);
        updateCommand(commandId, resolveConflicts(commandId,
            handlerActivations, conflicts));
      }
    } else if (value instanceof IHandlerActivation) {
      if (value != activation) {
        final SortedSet handlerActivations = new TreeSet(
            new EvaluationResultCacheComparator());
        handlerActivations.add(value);
        handlerActivations.add(activation);
        handlerActivationsByCommandId
            .put(commandId, handlerActivations);
        updateCommand(commandId, resolveConflicts(commandId,
            handlerActivations, conflicts));
      }
    } else {
      handlerActivationsByCommandId.put(commandId, activation);
      updateCommand(commandId, (evaluate(activation) ? activation : null));
    }
   
    if (conflicts.getSeverity()!=IStatus.OK) {
      WorkbenchPlugin.log(conflicts);
    }

    // Next we update the source priority bucket sort of activations.
    final int sourcePriority = activation.getSourcePriority();
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

   *            The activation; must not be <code>null</code>.
   */
  final void deactivateHandler(final IHandlerActivation activation) {
    // First we update the handlerActivationsByCommandId map.
    final String commandId = activation.getCommandId();
    MultiStatus conflicts = new MultiStatus("org.eclipse.ui.workbench", 0//$NON-NLS-1$
        "A handler conflict occurred.  This may disable some commands.", //$NON-NLS-1$
        null);
    final Object value = handlerActivationsByCommandId.get(commandId);
    if (value instanceof SortedSet) {
      final SortedSet handlerActivations = (SortedSet) value;
      if (handlerActivations.contains(activation)) {
        handlerActivations.remove(activation);
        if (handlerActivations.isEmpty()) {
          handlerActivationsByCommandId.remove(commandId);
          updateCommand(commandId, null);

        } else if (handlerActivations.size() == 1) {
          final IHandlerActivation remainingActivation = (IHandlerActivation) handlerActivations
              .iterator().next();
          handlerActivationsByCommandId.put(commandId,
              remainingActivation);
          updateCommand(
              commandId,
              (evaluate(remainingActivation) ? remainingActivation
                  : null));

        } else {
          updateCommand(commandId, resolveConflicts(commandId,
              handlerActivations, conflicts));
        }
      }
    } else if (value instanceof IHandlerActivation) {
      if (value == activation) {
        handlerActivationsByCommandId.remove(commandId);
        updateCommand(commandId, null);
      }
    }
    if (conflicts.getSeverity()!=IStatus.OK) {
      WorkbenchPlugin.log(conflicts);
    }

    // Next we update the source priority bucket sort of activations.
    final int sourcePriority = activation.getSourcePriority();
View Full Code Here

Examples of org.eclipse.core.runtime.MultiStatus

          }
        }
      }
    }

    MultiStatus conflicts = new MultiStatus("org.eclipse.ui.workbench", 0//$NON-NLS-1$
        "A handler conflict occurred.  This may disable some commands.", //$NON-NLS-1$
        null);
   
    /*
     * For every command identifier with a changed activation, we resolve
     * conflicts and trigger an update.
     */
    final Iterator changedCommandIdItr = changedCommandIds.iterator();
    while (changedCommandIdItr.hasNext()) {
      final String commandId = (String) changedCommandIdItr.next();
      final Object value = handlerActivationsByCommandId.get(commandId);
      if (value instanceof IHandlerActivation) {
        final IHandlerActivation activation = (IHandlerActivation) value;
        updateCommand(commandId, (evaluate(activation) ? activation
            : null));
      } else if (value instanceof SortedSet) {
        final IHandlerActivation activation = resolveConflicts(
            commandId, (SortedSet) value, conflicts);
        updateCommand(commandId, activation);
      } else {
        updateCommand(commandId, null);
      }
    }
    if (conflicts.getSeverity()!=IStatus.OK) {
      WorkbenchPlugin.log(conflicts);
    }

    // If tracing performance, then print the results.
    if (DEBUG_PERFORMANCE) {
View Full Code Here

Examples of org.exoplatform.applications.ooplugin.client.Multistatus

      {
         showMessageBox("Can't open version list. ErrorCode: " + status);
         return false;
      }

      Multistatus multistatus = davReport.getMultistatus();
      responses = multistatus.getResponses();

      Collections.sort(responses, new VersionComparer());

      XListBox xListBox =
               (XListBox) UnoRuntime.queryInterface(XListBox.class, xControlContainer.getControl(LST_VERSIONS));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.