Package org.eclipse.ui

Examples of org.eclipse.ui.IViewPart


     * sets the given selection in the view defined by viewID
     * @param viewID
     * @param selection
     */
    public static void setSelectionInView(String viewID, ISelection selection) {
      IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(viewID);
      if (view != null) {           
        view.getSite().getSelectionProvider().setSelection(selection);
      }
    }
View Full Code Here


    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewReference[] viewReferences = page.getViewReferences();
      for (IViewReference viewRef : viewReferences) {
        if (viewRef.getId().equals(BookMarkExplorer.VIEW_ID)) {
          IViewPart view = viewRef.getView(true);
          if (view instanceof BookMarkExplorer)
            return (BookMarkExplorer) view;
        }
      }
    }
View Full Code Here

   * none.
   */
  public static IFolder getBookMarkExplorerSelection() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewPart viewPart = page.findView(BookMarkExplorer.VIEW_ID);
      if (viewPart != null) {
        IStructuredSelection selection = (IStructuredSelection) viewPart.getSite().getSelectionProvider().getSelection();
        if (!selection.isEmpty()) {
          Object selectedEntity = selection.iterator().next();
          if (selectedEntity instanceof IFolder)
            return (IFolder) selectedEntity;
          else if (selectedEntity instanceof IMark)
View Full Code Here

   * Switch between showing and hiding the Bookmarks View.
   */
  public static void toggleBookmarks() {
    IWorkbenchPage page = OwlUI.getPage();
    if (page != null) {
      IViewPart explorerView = page.findView(BookMarkExplorer.VIEW_ID);

      /* Hide Bookmarks */
      if (explorerView != null)
        page.hideView(explorerView);

View Full Code Here

        manager.add(new Action("Bookmarks", IAction.AS_CHECK_BOX) {
          @Override
          public void run() {
            IWorkbenchPage page = OwlUI.getPage();
            if (page != null) {
              IViewPart explorerView = page.findView(BookMarkExplorer.VIEW_ID);

              /* Hide Bookmarks */
              if (explorerView != null)
                page.hideView(explorerView);

View Full Code Here

    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewReference[] viewReferences = page.getViewReferences();
      for (IViewReference viewRef : viewReferences) {
        if (viewRef.getId().equals(BookMarkExplorer.VIEW_ID)) {
          IViewPart view = viewRef.getView(true);
          if (view instanceof BookMarkExplorer)
            return (BookMarkExplorer) view;
        }
      }
    }
View Full Code Here

   * none.
   */
  public static IFolder getBookMarkExplorerSelection() {
    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewPart viewPart = page.findView(BookMarkExplorer.VIEW_ID);
      if (viewPart != null) {
        IStructuredSelection selection = (IStructuredSelection) viewPart.getSite().getSelectionProvider().getSelection();
        if (!selection.isEmpty()) {
          Object selectedEntity = selection.iterator().next();
          if (selectedEntity instanceof IFolder)
            return (IFolder) selectedEntity;
          else if (selectedEntity instanceof IMark)
View Full Code Here

    IWorkbenchPage page = getPage();
    if (page != null) {
      IViewReference[] viewReferences = page.getViewReferences();
      for (IViewReference viewRef : viewReferences) {
        if (viewRef.getId().equals(BookMarkExplorer.VIEW_ID)) {
          IViewPart view = viewRef.getView(true);
          if (view instanceof BookMarkExplorer)
            return (BookMarkExplorer) view;
        }
      }
    }
View Full Code Here

                linkWithView = newState;
                if(linkWithView){
                    ISelectionService selectionService = workbenchWindow
                        .getSelectionService();
                    try {
                        IViewPart part = workbenchWindow.getActivePage()
                            .showView(
                                "de.loskutov.bco.views.BytecodeOutlineView");
                        ISelection selection = selectionService
                            .getSelection("de.loskutov.bco.views.BytecodeOutlineView");
                        selectionChanged(part, selection);
View Full Code Here

        }
        IViewReference[] viewRefs = activePage.getViewReferences();
        if (viewRefs!=null) {
            for (int i = 0; i < viewRefs.length; i++) {
                IViewReference aViewRef = viewRefs[i];
                IViewPart view = aViewRef.getView(false);
                if (view!=null) {
                    return view.getViewSite().getActionBars().getStatusLineManager();
                }
            }
        }
        IEditorReference[] editorRefs = activePage.getEditorReferences();
        if (editorRefs!=null) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IViewPart

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.