Examples of ActionDescriptor


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

            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

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

      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

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

      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

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

    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

Examples of org.springframework.hateoas.action.ActionDescriptor

    return new HttpEntity<PersonResource>(resource);
  }

  @RequestMapping(value = "/customer", method = RequestMethod.GET)
  public HttpEntity<ActionDescriptor> searchPersonForm() {
    ActionDescriptor form = ControllerActionBuilder.createActionFor(methodOn(PersonController.class).showPerson(1L),
        "searchPerson");
    return new HttpEntity<ActionDescriptor>(form);
  }
View Full Code Here

Examples of org.springframework.hateoas.action.ActionDescriptor

  @RequestMapping(value = "/customer/{personId}/edit")
  public HttpEntity<ActionDescriptor> editPersonForm(@RequestParam Long personId) {

    Person person = personAccess.getPerson(personId);

    ActionDescriptor descriptor = ControllerActionBuilder.createActionFor(
        methodOn(PersonController.class).editPerson(person.getId(), person.getFirstname(), person.getLastname()),
        "changePerson");

    return new HttpEntity<ActionDescriptor>(descriptor);
  }
View Full Code Here

Examples of org.springframework.hateoas.action.ActionDescriptor

    return new HttpEntity<Model>(model);
  }

  @RequestMapping(value = { "/account" }, method = RequestMethod.GET)
  public HttpEntity<ActionDescriptor> bankAccountForm() {
    ActionDescriptor form = ControllerActionBuilder.createActionFor(methodOn(BankingController.class).bankAccount(null),
        "bankAccountForm");
    return new HttpEntity<ActionDescriptor>(form);
  }
View Full Code Here

Examples of org.springframework.hateoas.action.ActionDescriptor

  }

  @RequestMapping("/account/{accountNumber}/transfer")
  public HttpEntity<ActionDescriptor> moneyTransferForm(@PathVariable String accountNumber) {

    ActionDescriptor form = createActionFor(methodOn(BankingController.class).moneyTransfer(accountNumber, null, null),
        "moneyTransferForm");
    return new HttpEntity<ActionDescriptor>(form);
  }
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.