Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPartReference


        // For each of these pages...
        IWorkbenchPage page = null;
        //ISelection selection = null;
        for(int i=0 ; i<pages.length ; i++) {
          page = pages[i];
          IWorkbenchPartReference activePart =
            page.getActivePartReference();
          if(activePart instanceof IViewReference) {
            IViewReference viewPart =(IViewReference)activePart;
            sourceViewId = viewPart.getId();
          }
View Full Code Here


    // Now, process the parts...
    for (int i = 0; i < parts.length; i++) {
      if (parts[i] instanceof PresentablePart) {
        PresentablePart part = (PresentablePart) parts[i];
        IWorkbenchPartReference ref = part.getPane()
            .getPartReference();
        if (ref instanceof IViewReference)
          orderedViews.add(ref);
      }
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.internal.CycleBaseHandler#addItems(org.eclipse.swt.widgets.Table, org.eclipse.ui.internal.WorkbenchPage)
   */
  protected void addItems(Table table, WorkbenchPage page) {
    // TODO Auto-generated method stub
    IWorkbenchPartReference refs[] = page.getSortedParts();
    boolean includeEditor = true;

    for (int i = refs.length - 1; i >= 0; i--) {
      if (refs[i] instanceof IEditorReference) {
        if (includeEditor) {
View Full Code Here

    public IWorkbenchPart getActivePart() {
        return partService.getActivePart();
    }
   
    private void updateActivePart() {
        IWorkbenchPartReference activeRef = null;
        IWorkbenchPart activePart = null;
       
        if (activePage != null) {
            activePart = activePage.getActivePart();
            activeRef = activePage.getActivePartReference();
View Full Code Here

        // Hook listener on the new page.
        if (newPage != null) {     
            IWorkbenchPartReference[] refs = ((WorkbenchPage)newPage).getOpenParts();
           
            for (int i = 0; i < refs.length; i++) {
                IWorkbenchPartReference reference = refs[i];
               
                partService.firePartOpened(reference);
               
                IWorkbenchPart part = reference.getPart(false);
                if (part != null && newPage.isPartVisible(part)) {
                    partService.firePartVisible(reference);
                }
            }           
View Full Code Here

            WorkbenchPage page = (WorkbenchPage)tempPage;
           
        IWorkbenchPartReference[] refs = page.getOpenParts();
       
        for (int i = 0; i < refs.length; i++) {
          IWorkbenchPartReference reference = refs[i];
               
                if (page.isPartVisible(reference)) {
                    partService.firePartHidden(reference);
                }
               
View Full Code Here

   
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IPartService service = window.getPartService();
    service.addPartListener(this);

    IWorkbenchPartReference aref = service.getActivePartReference();
    if(aref != null) {
      IWorkbenchPart apart = aref.getPart(false);
      if (apart instanceof EditorPart) {
        installUpdateListener(apart);
      }
    }       
  }
View Full Code Here

    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IPartService service = window.getPartService();
    service.addPartListener(this);

    IWorkbenchPartReference aref = service.getActivePartReference();
    if (aref != null) {
      IWorkbenchPart apart = aref.getPart(false);
      installSelectionListener(apart);
    }

    updateImage(null, CardTemplate.BLACK_BORDER);
View Full Code Here

  public void partVisible(IWorkbenchPartReference partRef) {
    attachToPartIfNecessary(partRef);
  }

  protected void findAndAttachToPackageExplorerInPage(IWorkbenchPage page) {
    IWorkbenchPartReference packageExplorerPartRef = page.findViewReference(JavaUI.ID_PACKAGES);
    attachToPartIfNecessary(packageExplorerPartRef);

    IWorkbenchPartReference wopackageExplorerPartRef = page.findViewReference(PerspectiveFactory.ID_WO_PACKAGES);
    attachToPartIfNecessary(wopackageExplorerPartRef);
  }
View Full Code Here

   */
  protected ArrayList filterResults(List toFilter) {
    ArrayList matches = new ArrayList();

    for (Iterator iterator = toFilter.iterator(); iterator.hasNext();) {
      IWorkbenchPartReference workbenchPart = (IWorkbenchPartReference) iterator.next();
      if (workbenchPart.getPartName().equals(text))
        matches.add(workbenchPart);
    }
    return matches;
  }
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.