Package org.eclipse.wst.sse.ui.internal.extension

Examples of org.eclipse.wst.sse.ui.internal.extension.ActionDescriptor


  /**
   * This factory method returns a new ActionDescriptor for the
   * configuration element. It should be implemented by subclasses.
   */
  protected ActionDescriptor createActionDescriptor(IConfigurationElement element) {
    ActionDescriptor ad = null;
    try {
      ad = new ActionDescriptor(element);
      // these cases like "class not found" are handled
      // at lower level, so no action if formed. In that
      // case, we also don't want to form an action descriptor.
      if ((ad != null) && (ad.getAction() == null)) {
        ad = null;
      }
    }
    catch (Exception e) {
      Logger.traceException(EXTENDED_EDITOR, e);
View Full Code Here


      return true; // just cache the element - don't go into it
    }
    else if (tag.equals(TAG_ACTION)) {
      if (readingCache == null)
        readingCache = new ArrayList();
      ActionDescriptor ad = createActionDescriptor(element);
      if (ad != null)
        readingCache.add(ad);
      return true; // just cache the action - don't go into
    }
    else {
View Full Code Here

              System.out.println(getClass().getName() + "#contributeToMenu() added: " + menuElement.getAttribute(ATT_ID)); //$NON-NLS-1$
          }
        }
        else if (obj instanceof ActionDescriptor) {
          try {
            ActionDescriptor ad = (ActionDescriptor) obj;
            IMenuManager mm = contributeMenuAction(ad, menu, true, false);
            if (mm != null) {
              map.put(ad.getContributionItem(), mm);
              mm.addMenuListener(this);
              menus.add(mm);
              if (debugMenu)
                System.out.println(getClass().getName() + "#contributeToMenu() added: " + ad.getId()); //$NON-NLS-1$
            }
          }
          catch (Exception e) {
            Logger.logException("contributing to menu", e); //$NON-NLS-1$
          }
View Full Code Here

            contributeMenu(menuElement, menu, true);
          }
        }
        else if (obj instanceof ActionDescriptor) {
          try {
            ActionDescriptor ad = (ActionDescriptor) obj;
            IAction a = ad.getAction();
            if (a instanceof IExtendedEditorAction) {
              // uncaught exceptions could cause the menu to not
              // be shown
              try {
                if (((ad.getPopupMenuPath() != null) || (ad.getPopupMenuGroup() != null)) && (a instanceof IExtendedEditorActionProxyForDelayLoading)) {
                    ((IExtendedEditorActionProxyForDelayLoading)a).realize();
                }

                IExtendedEditorAction eea = (IExtendedEditorAction) a;
                eea.setActiveExtendedEditor(activeExtendedEditor);
                eea.update();
                if (eea.isVisible()) {
                  IMenuManager parent = contributeMenuAction(ad, menu, true, true);
                  if (debugPopup && parent != null)
                    System.out.println(getClass().getName() + "#contributeToPopupMenu() added: " + ad.getId()); //$NON-NLS-1$
                }
              }
              catch (Exception e) {
                Logger.logException(e);
              }

            }
            else {
              IMenuManager parent = contributeMenuAction(ad, menu, true, true);
              if (debugPopup && parent != null)
                System.out.println(getClass().getName() + "#contributeToPopupMenu() added: " + ad.getId()); //$NON-NLS-1$
            }
          }
          catch (Exception e) {
            Logger.logException("contributing to popup", e); //$NON-NLS-1$
          }
View Full Code Here

      long time0 = System.currentTimeMillis();
      for (int i = 0; i < cache.size(); i++) {
        Object obj = cache.get(i);
        if (obj instanceof ActionDescriptor) {
          try {
            ActionDescriptor ad = (ActionDescriptor) obj;
            IAction a = ad.getAction();
            if (a instanceof IExtendedEditorAction) {
              if (((ad.getToolbarPath() != null) || (ad.getToolbarGroup() != null)) && (a instanceof IExtendedEditorActionProxyForDelayLoading)) {
                  ((IExtendedEditorActionProxyForDelayLoading)a).realize();
              }
              IExtendedEditorAction eea = (IExtendedEditorAction) a;
              eea.setActiveExtendedEditor(activeExtendedEditor);
              eea.update();
              if (eea.isVisible()) {
                boolean contributed = contributeToolbarAction(ad, manager, true);
                if (debugToolbar && contributed)
                  System.out.println(getClass().getName() + "#contributeToToolBar() added: " + ad.getId()); //$NON-NLS-1$
              }
              else {
                if (debugToolbar)
                  System.out.println(getClass().getName() + "#contributeToToolBar(): [skipped] " + ad.getId()); //$NON-NLS-1$
              }
            }
            else {
              boolean contributed = contributeToolbarAction(ad, manager, true);
              if (debugToolbar && contributed)
                System.out.println(getClass().getName() + "#contributeToToolBar() added: " + ad.getId()); //$NON-NLS-1$
            }
          }
          catch (Exception e) {
            Logger.logException("contributing to toolbar", e); //$NON-NLS-1$
          }
View Full Code Here

      activeExtendedEditor = computeExtendedEditor(editor);
      IKeyBindingService svc = (editor != null) ? editor.getEditorSite().getKeyBindingService() : null;
      for (int i = 0; i < cache.size(); i++) {
        Object obj = cache.get(i);
        if (obj instanceof ActionDescriptor) {
          ActionDescriptor ad = (ActionDescriptor) obj;
          try {
            IAction action = ad.getAction();
            if (action instanceof IExtendedEditorAction) {
              ((IExtendedEditorAction) action).setActiveExtendedEditor(activeExtendedEditor);
              ((IExtendedEditorAction) action).update();
              // update visibility right now so that the menu
              // will show/hide properly
              if (!((IExtendedEditorAction) action).isVisible() && ad.getContributionItem() != null)
                ad.getContributionItem().setVisible(false);
              if (svc != null && action.getActionDefinitionId() != null) {
                svc.registerAction(action);
              }
            }
          }
View Full Code Here

    public void updateToolbarActions() {
      for (int i = 0; i < cache.size(); i++) {
        Object obj = cache.get(i);
        if (obj instanceof ActionDescriptor) {
          try {
            ActionDescriptor ad = (ActionDescriptor) obj;
            if (ad.getToolbarPath() != null) {
              IAction action = ad.getAction();
              if (action instanceof IUpdate) {
                ((IUpdate) action).update();
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.extension.ActionDescriptor

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.