Package org.eclipse.ui.actions

Examples of org.eclipse.ui.actions.OpenWithMenu


            return;
        }

        // Create a menu.
        final IMenuManager submenu = new MenuManager(ActionMessages.OpenWithMenu_label);
        submenu.add(new OpenWithMenu(fSite.getPage(), (IFile) resource));

        // Add the submenu.
        menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
    }
View Full Code Here


        } else if (element instanceof IFile) {
            file = (IFile) element;
        }
        if (file != null) {
            final IMenuManager submenu = new MenuManager("Open Wit&h");
            submenu.add(new OpenWithMenu(getPage(), file));

            menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN_WITH, submenu);
        }
    }
View Full Code Here

    menu.add(mOpenFileAction);

    if (selection.size() == 1 && (selection.getFirstElement() instanceof IFile)) {

      MenuManager submenu = new MenuManager("Open With");
      submenu.add(new OpenWithMenu(mPage, (IFile) selection.getFirstElement()));

      menu.add(submenu);
    }
  }
View Full Code Here

                        openAction);

                // Create menu
                IMenuManager submenu = new MenuManager(SearchMessages.
                        getString(RESOURCE_PREFIX + "openWith.label"));
                submenu.add(new OpenWithMenu(workbenchPage, (IAdaptable) o));

                // Add the submenu.
                menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
            }
        }
View Full Code Here

    menu.add(mOpenFileAction);

    if (selection.size() == 1 && selection.getFirstElement() instanceof IFile) {

      MenuManager submenu = new MenuManager("Open With");
      submenu.add(new OpenWithMenu(mPage, (IFile) selection.getFirstElement()));

      menu.add(submenu);
    }
  }
View Full Code Here

    for (int i = 0; i < list.size(); i++) {
      Object object = list.get(i);
      if (object != null) {
        if (object instanceof IResource) {
          IResource resource = (IResource) object;
          OpenWithMenu action = new OpenWithMenu(getViewSite().getPage(), resource);
          menu.add(action);
          // AK: I can
          // OpenEditorActionGroup group = new
          // OpenEditorActionGroup(this);
          // group.fillContextMenu(menu);
        } else if (object instanceof ICompilationUnit) {
          ICompilationUnit unit = (ICompilationUnit) object;
          OpenWithMenu action = new OpenWithMenu(getViewSite().getPage(), unit);
          menu.add(action);
        }
      }
    }
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
View Full Code Here

      return;
    }

    // Add 'Open With...' sub-menu
    MenuManager subMenu = new MenuManager(IDEWorkbenchMessages.OpenResourceDialog_openWithMenu_label);
    OpenWithMenu openWithMenu = new OpenWithMenu(activePage, selectedAdaptable) {
      @SuppressWarnings("synthetic-access")
      protected void openEditor(IEditorDescriptor editorDescriptor, boolean openUsingDescriptor) {
        computeResult();
        setResult(Collections.EMPTY_LIST);
        close();
View Full Code Here

    IAdaptable selectedAdaptable = getSelectedAdaptable();
    if (selectedAdaptable == null) {
      return;
    }

    OpenWithMenu openWithMenu = new OpenWithMenu(activePage, selectedAdaptable) {
      @SuppressWarnings("synthetic-access")
      protected void openEditor(IEditorDescriptor editorDescriptor, boolean openUsingDescriptor) {
        computeResult();
        setResult(Collections.EMPTY_LIST);
        close();
        super.openEditor(editorDescriptor, openUsingDescriptor);
      }
    };

    Menu menu = new Menu(openComposite.getParent());
    Control c = openComposite;
    Point p = c.getLocation();
    p.y = p.y + c.getSize().y;
    p = c.getParent().toDisplay(p);

    menu.setLocation(p);
    openWithMenu.fill(menu, -1);
    menu.setVisible(true);
  }
View Full Code Here

    if (!(resource instanceof IFile))
      return;

    // Create a menu.
    IMenuManager submenu = new MenuManager(PHPUIMessages.OpenWithMenu_label);
    submenu.add(new OpenWithMenu(fSite.getPage(), (IFile) resource));

    // Add the submenu.
    menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
  }
View Full Code Here

        if (!(o instanceof IAdaptable))
            return;

        // Create menu
        IMenuManager submenu = new MenuManager(SearchMessages.OpenWithMenu_label);
        submenu.add(new OpenWithMenu(fPage, (IAdaptable) o));

        // Add the submenu.
        menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.actions.OpenWithMenu

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.