Package org.eclipse.ui

Examples of org.eclipse.ui.IViewReference



            // perform initialization with already existing selection (if any)
            ISelection selection = selectionService.getSelection(partId);
            if(selection != null) {
                IViewReference viewReference = workbenchWindow.getActivePage()
                    .findViewReference(partId);
                if(viewReference != null) {
                    selectionChanged(viewReference.getView(false), selection);
                }
            }
        }
    }
View Full Code Here


            return activeEditor.getEditorSite().getActionBars().getStatusLineManager();
        }
        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();
                }
            }
        }
View Full Code Here

    static public void hideView(final String viewId, final String secondaryId) {
        final IWorkbench workbench = PlatformUI.getWorkbench();

        final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
        IViewPart view;
        final IViewReference viewr = window.getActivePage().findViewReference(viewId,
                secondaryId);
        if (viewr != null) {
            view = viewr.getView(false);
            if (view != null) {
                window.getActivePage().hideView(view);
            }
        }
View Full Code Here

    // Only deref the part if it is being referenced in -this- perspective
        Perspective persp = page.getActivePerspective();
        PerspectiveHelper pres = (persp != null) ? persp.getPresentation() : null;
      if (pres != null && newPart instanceof ViewPane) {
        ViewPane vp = (ViewPane) newPart;
        IViewReference vRef = vp.getViewReference();
        LayoutPart fpp = pres.findPart(vRef.getId(), vRef.getSecondaryId());
       
        if (fpp != null) {
              // Remove the part from old container.
              derefPart(newPart);
        }
View Full Code Here

          Perspective persp = wp.getActivePerspective();

            // If we're making a fast view then use the new mechanism directly
            boolean useNewMinMax = Perspective.useNewMinMax(persp);
            if (useNewMinMax) {
              IViewReference ref = persp.getViewReference(viewId, null);
              if (ref == null)
                return;

              persp.getFastViewManager().addViewReference(FastViewBar.FASTVIEWBAR_ID, -1, ref, true);
            wp.activate(ref.getPart(true));
           
            return;
            }
           
            IViewReference ref = wp.findViewReference(viewId);
           
            if (ref == null) {
                IViewPart part = wp.showView(viewId, null, IWorkbenchPage.VIEW_CREATE);
                ref = (IViewReference)wp.getReference(part);
            }
           
            if (!wp.isFastView(ref)) {
                wp.addFastView(ref);
            }
            wp.activate(ref.getPart(true));
        } else {
            activePage.showView(viewId);
        }
   
  }
View Full Code Here

   */
  private boolean isStandaloneStack() {
    Perspective persp = wbw.getActiveWorkbenchPage().getActivePerspective();
    List fvs = persp.getFastViewManager().getFastViews(id);
    for (Iterator iterator = fvs.iterator(); iterator.hasNext();) {
      IViewReference ref = (IViewReference) iterator.next();
      if (persp.isStandaloneView(ref))
        return true;
    }
   
    return false;
View Full Code Here

          ViewPane pane = (ViewPane) toDrag;
          if (!persp.isMoveable(pane.getViewReference()))
            return;
        }
       
        IViewReference oldFastView = null;
        if (persp != null) {
            oldFastView = persp.getActiveFastView();

            if (page != null) {
                page.hideFastView();
View Full Code Here

            int insertIndex = tbm.getControl().indexOf(curItem);
            Iterator iter = panes.iterator();
            while (iter.hasNext()) {
                ViewPane pane = (ViewPane) iter.next();
                IViewReference ref = pane.getViewReference();
            adoptRef(ref);
                fvm.addViewReference(id, insertIndex++, ref, !iter.hasNext());
            }
        }
View Full Code Here

            if (!desc.getAllowMultiple()) {
                throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id));
            }
        }
        String key = getKey(id, secondaryId);
        IViewReference ref = (IViewReference) counter.get(key);
        if (ref == null) {
            IMemento memento = (IMemento) mementoTable.get(key);
            ref = new ViewReference(this, id, secondaryId, memento);
            mementoTable.remove(key);
            counter.put(key, ref);
View Full Code Here

     * @param viewRef
     * @return the current reference count for the given view
     */
    public int getReferenceCount(IViewReference viewRef) {
        String key = getKey(viewRef);
        IViewReference ref = (IViewReference) counter.get(key);
        return ref==null ? 0 : counter.getRef(key);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IViewReference

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.