Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPartReference


            return getActiveReference(parts.size() - 1, editorsOnly);
        }
       
        private IWorkbenchPartReference getActiveReference(int start, boolean editorsOnly) {
            // First look for parts that aren't obscured by the current zoom state
            IWorkbenchPartReference nonObscured = getActiveReference(start, editorsOnly, true);
           
            if (nonObscured != null) {
                return nonObscured;
            }
           
View Full Code Here


        /*
         * Retuns the index of the part within the activation list. The higher
         * the index, the more recently it was used.
         */
        int indexOf(IWorkbenchPart part) {
          IWorkbenchPartReference ref = getReference(part);
          if (ref == null) {
            return -1;
          }
            return parts.indexOf(ref);
        }
View Full Code Here

         * Returns the editors in activation order (oldest first).
         */
        private IEditorReference[] getEditors() {
            ArrayList editors = new ArrayList(parts.size());
            for (Iterator i = parts.iterator(); i.hasNext();) {
                IWorkbenchPartReference part = (IWorkbenchPartReference) i
                        .next();
                if (part instanceof IEditorReference) {
                    editors.add(part);
                }
            }
View Full Code Here

         */
        private IWorkbenchPartReference[] getParts() {
            IWorkbenchPartReference[] views = getViewReferences();
            ArrayList resultList = new ArrayList(parts.size());
            for (Iterator iterator = parts.iterator(); iterator.hasNext();) {
                IWorkbenchPartReference ref = (IWorkbenchPartReference) iterator
                        .next();
                if (ref instanceof IViewReference) {
                    //Filter views from other perspectives
                    for (int i = 0; i < views.length; i++) {
                        if (views[i] == ref) {
View Full Code Here

        String label = null; // debugging only
        if (UIStats.isDebugging(UIStats.ACTIVATE_PART)) {
            label = newPart != null ? newPart.getTitle() : "none"; //$NON-NLS-1$
        }
        try {
            IWorkbenchPartReference partref = getReference(newPart);
            IWorkbenchPartReference realPartRef = null;
      if (newPart != null) {
        IWorkbenchPartSite site = newPart.getSite();
        if (site instanceof PartSite) {
          realPartRef = ((PartSite) site).getPane()
              .getPartReference();
View Full Code Here

  IWorkbenchPartReference[] getOpenParts() {
    IWorkbenchPartReference[] refs = getAllParts();
    List result = new ArrayList();
   
    for (int i = 0; i < refs.length; i++) {
      IWorkbenchPartReference reference = refs[i];
     
      IWorkbenchPart part = reference.getPart(false);
      if (part != null) {
        result.add(reference);
      }
    }
   
View Full Code Here

        {
            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

    this.viewLabel = partName;
  }

  public boolean doMatch(Object item) {
    if (item instanceof IWorkbenchPartReference) {
      IWorkbenchPartReference part = (IWorkbenchPartReference) item;
      return part.getPartName().equals(viewLabel);
    }
    return false;
  }
View Full Code Here

    this.nameMatcher = nameMatcher;
  }

  public boolean doMatch(Object item) {
    if (item instanceof IWorkbenchPartReference) {
      IWorkbenchPartReference part = (IWorkbenchPartReference) item;
      return nameMatcher.matches(part.getPartName());
    }
    return false;
  }
View Full Code Here

  }

  @Override
  public boolean doMatch(Object item) {
    if (item instanceof IWorkbenchPartReference) {
      IWorkbenchPartReference part = (IWorkbenchPartReference) item;
      return idMatcher.matches(part.getId());
    }
    return false;
  }
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.