Package org.eclipse.ui.commands

Examples of org.eclipse.ui.commands.IElementUpdater


    Command cmd = getCommand(commandId);

    if (!cmd.isDefined() || !(cmd.getHandler() instanceof IElementUpdater)) {
      return;
    }
    final IElementUpdater updater = (IElementUpdater) cmd.getHandler();

    if (commandCallbacks == null) {
      return;
    }

    List callbackRefs = (List) commandCallbacks.get(commandId);
    if (callbackRefs == null) {
      return;
    }

    for (Iterator i = callbackRefs.iterator(); i.hasNext();) {
      final IElementReference callbackRef = (IElementReference) i.next();
      final Map parms = Collections.unmodifiableMap(callbackRef
          .getParameters());
      ISafeRunnable run = new ISafeRunnable() {
        public void handleException(Throwable exception) {
          WorkbenchPlugin.log("Failed to update callback: "  //$NON-NLS-1$
              + callbackRef.getCommandId(), exception);
        }

        public void run() throws Exception {
          updater.updateElement(callbackRef.getElement(), parms);
        }
      };
      if (filter == null) {
        SafeRunner.run(run);
      } else {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.commands.IElementUpdater

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.