Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPartReference


        {
            IWorkbenchPart part = ( IWorkbenchPart ) editor;
            IEditorPart activeEditor = part.getSite().getPage().getActiveEditor();
            if ( part == activeEditor )
            {
                IWorkbenchPartReference reference = part.getSite().getPage().getReference( part );
                return reference;
            }
        }
        return null;
    }
View Full Code Here


            return;
        }

        // get all the view and editor parts
        final List<IWorkbenchPart> parts = Lists.newArrayList();
        IWorkbenchPartReference refs[] = page.getViewReferences();
        for (int i = 0; i < refs.length; i++) {
            final IWorkbenchPart part = refs[i].getPart(false);
            if (part != null) {
                parts.add(part);
            }
View Full Code Here

        if (part == MultiEditor.this && innerEditors != null) {
          PartService partService = ((WorkbenchPage) getSite()
              .getPage()).getPartService();
          for (int i = 0; i < innerEditors.length; i++) {
            IEditorPart editor = innerEditors[i];
            IWorkbenchPartReference innerRef = ((PartSite) editor
                .getSite()).getPartReference();
            partService.firePartClosed(innerRef);
          }
        }
      }

      public void partDeactivated(IWorkbenchPartReference partRef) {
      }

      public void partOpened(IWorkbenchPartReference partRef) {
        IWorkbenchPart part = partRef.getPart(false);
        if (part == MultiEditor.this && innerEditors != null) {
          PartService partService = ((WorkbenchPage) getSite()
              .getPage()).getPartService();
          for (int i = 0; i < innerEditors.length; i++) {
            IEditorPart editor = innerEditors[i];
            IWorkbenchPartReference innerRef = ((PartSite) editor
                .getSite()).getPartReference();
            partService.firePartOpened(innerRef);
          }
        }
      }
View Full Code Here

  public void setActivePart(IWorkbenchPartReference ref) {
    if (ref == activePartReference) {
      return;
    }

    IWorkbenchPartReference oldPart = activePartReference;

    // A part can't be activated until it is added
    // Assert.isTrue(ref == null || parts.contains(ref));

    if (ref != null) {
View Full Code Here

     *
     * @param buf
     */
    public void describeLayout(StringBuffer buf) {

        IWorkbenchPartReference part = getPartReference();

        if (part != null) {
            buf.append(part.getPartName());
            return;
        }
    }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.eclipse.ui.Saveable#show(org.eclipse.ui.IWorkbenchPage)
   */
  public boolean show(IWorkbenchPage page) {
    IWorkbenchPartReference reference = page.getReference(part);
    if (reference != null) {
      page.activate(part);
      return true;
    }
    if (part instanceof IViewPart) {
View Full Code Here

        PartPane selPart = null;
        int topIndex = 0;
        WorkbenchPage page = getPage();

        if (page != null) {
            IWorkbenchPartReference sortedPartsArray[] = page.getSortedParts();
            List sortedParts = Arrays.asList(sortedPartsArray);
            for (int i = 0; i < parts.length; i++) {
                if (parts[i] instanceof PartPane) {
                    IWorkbenchPartReference part = ((PartPane) parts[i])
                            .getPartReference();
                    int index = sortedParts.indexOf(part);
                    if (index >= topIndex) {
                        topIndex = index;
                        selPart = (PartPane) parts[i];
View Full Code Here

    public IWorkbenchPartReference getActivePartReference() {
        return activePart;
    }

    public void setActivePart(IWorkbenchPartReference ref) {
        IWorkbenchPartReference oldRef = activePart;
       
        // Filter out redundant activation events
        if (oldRef == ref) {
            return;
        }
View Full Code Here

        }

        IWorkbenchPage page = getActivePage();
        if (page != null) {
            if (page instanceof WorkbenchPage) {
                IWorkbenchPartReference partRef = page.getActivePartReference();

                if (partRef != null) {
                    ((WorkbenchPage) page).toggleZoom(partRef);
                }
            }
View Full Code Here

        if (part instanceof MultiEditor) {
            part = ((MultiEditor) part).getActiveEditor();
        }
        // Activate part.
        //if (window.getActivePage() == this) {
        IWorkbenchPartReference ref = getReference(part);
        internalBringToTop(ref);
        setActivePart(part);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchPartReference

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.