Package org.eclipse.ui

Examples of org.eclipse.ui.IActionDelegate


            if (provider.isEnabled()) {
              shareMenu.add(new Action(provider.getName()) {
                @Override
                public void run() {
                  if (SendLinkAction.ID.equals(provider.getId())) {
                    IActionDelegate action = new SendLinkAction();
                    action.selectionChanged(null, selection);
                    action.run(null);
                  } else {
                    IBookMark bookmark = getBookMark(selection);
                    if (bookmark != null) {
                      String shareLink = provider.toShareUrl(bookmark);
                      new OpenInBrowserAction(new StructuredSelection(shareLink)).run();
View Full Code Here


          if (provider.isEnabled()) {
            shareMenu.add(new Action(provider.getName()) {
              @Override
              public void run() {
                if (SendLinkAction.ID.equals(provider.getId())) {
                  IActionDelegate action = new SendLinkAction();
                  action.selectionChanged(null, selection);
                  action.run(null);
                } else {
                  Object obj = selection.getFirstElement();
                  if (StringUtils.isSet((String) obj) && !URIUtils.ABOUT_BLANK.equals(obj)) {
                    String shareLink = provider.toShareUrl((String) obj, null);
                    new OpenInBrowserAction(new StructuredSelection(shareLink)).run();
View Full Code Here

          /* Copy Link */
          manager.add(new Action("Copy Link") {
            @Override
            public void run() {
              IActionDelegate action = new CopyLinkAction();
              action.selectionChanged(null, selection);
              action.run(null);
            }

            @Override
            public boolean isEnabled() {
              return !selection.isEmpty();
            }
          });

          /* Send Link */
          manager.add(new Action("Send Link") {
            @Override
            public void run() {
              IActionDelegate action = new SendLinkAction();
              action.selectionChanged(null, selection);
              action.run(null);
            }

            @Override
            public boolean isEnabled() {
              return !selection.isEmpty();
            }
          });
        }

        /* Update */
        {
          manager.add(new Separator("reload"));

          /* Update */
          manager.add(new Action("Update") {
            @Override
            public void run() {
              IActionDelegate action = new ReloadTypesAction();
              action.selectionChanged(null, selection);
              action.run(null);
            }

            @Override
            public ImageDescriptor getImageDescriptor() {
              return OwlUI.getImageDescriptor("icons/elcl16/reload.gif");
View Full Code Here

          /* Update */
          manager.add(new Action(Messages.ApplicationActionBarAdvisor_UPDATE) {
            @Override
            public void run() {
              IActionDelegate action = new ReloadTypesAction();
              action.selectionChanged(null, selection);
              action.run(null);
            }

            @Override
            public ImageDescriptor getImageDescriptor() {
              return OwlUI.getImageDescriptor("icons/elcl16/reload.gif"); //$NON-NLS-1$
View Full Code Here

          @Override
          public void run() {

            /* Special Case "Send E-Mail" action */
            if (SendLinkAction.ID.equals(provider.getId())) {
              IActionDelegate action = new SendLinkAction();
              action.selectionChanged(null, selection);
              action.run(null);
            }

            /* Other Action */
            else {
              Object obj = selection.getFirstElement();
View Full Code Here

          if (provider.isEnabled()) {
            shareMenu.add(new Action(provider.getName()) {
              @Override
              public void run() {
                if (SendLinkAction.ID.equals(provider.getId())) {
                  IActionDelegate action = new SendLinkAction();
                  action.selectionChanged(null, selection);
                  action.run(null);
                } else {
                  Object obj = selection.getFirstElement();
                  if (StringUtils.isSet((String) obj) && !URIUtils.ABOUT_BLANK.equals(obj)) {
                    String shareLink = provider.toShareUrl((String) obj, null);
                    new OpenInBrowserAction(new StructuredSelection(shareLink)).run();
View Full Code Here

    // TODO Auto-generated method stub

  }

  public final void dispose() {
    final IActionDelegate delegate = getDelegate();
    if (delegate instanceof IWorkbenchWindowActionDelegate) {
      final IWorkbenchWindowActionDelegate workbenchWindowDelegate = (IWorkbenchWindowActionDelegate) delegate;
      workbenchWindowDelegate.dispose();
    } else if (delegate instanceof IActionDelegate2) {
      final IActionDelegate2 delegate2 = (IActionDelegate2) delegate;
View Full Code Here

      activeEditor = null;
    } else {
      activePart = page.getActivePart();
      activeEditor = page.getActiveEditor();
    }
    final IActionDelegate delegate = getDelegate();
    final IAction action = getAction();

    // Check to see if the view delegate should be initialized.
    if ((viewId != null) && (page != null) && (viewDelegate != null)) {
      final IViewPart viewPart = page.findView(viewId);
View Full Code Here

  /**
   * Refresh the action enablement.
   */
  private final void refreshEnablement() {
    final IActionDelegate delegate = getDelegate();
    final IAction action = getAction();
    if ((delegate != null) && (action != null)) {
      delegate.selectionChanged(action, currentSelection);
    }
  }
View Full Code Here

    // modification. If the selection needs to be modified
    // the action contributors should do so.

    // If the delegate can be loaded, do so.
    // Otherwise, just update the enablement.
    final IActionDelegate delegate = getDelegate();
    if (delegate == null && isSafeToLoadDelegate()) {
      loadDelegate();
    }
    refreshEnablement();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IActionDelegate

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.