Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPart


    private IWorkbenchPartReference getActivePartRef( List<IEntryEditor> editors )
    {
        for ( IEntryEditor editor : editors )
        {
            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


    private boolean isOneOrMoreOpenSingleTabEntryEditors()
    {
        IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        for ( IEditorReference ref : activePage.getEditorReferences() )
        {
            IWorkbenchPart part = ref.getPart( false );
            if ( part != null && part instanceof IEntryEditor )
            {
                IEntryEditor editor = ( IEntryEditor ) part;
                if ( ( editor != null ) && ( editor.getEntryEditorInput() != null )
                    && ( editor.getEntryEditorInput().getExtension() != null )
View Full Code Here

        getSite().getPage().addPostSelectionListener(this);
        getSite().getPage().addPartListener(partAdapter);
        ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);

        // Current selection & part
        IWorkbenchPart activePart = getSite().getPage().getActivePart();
        ISelection activeSelection = getSite().getWorkbenchWindow().getSelectionService().getSelection();
        selectionChanged(activePart, activeSelection);
    }
View Full Code Here

    protected K getBootstrapTarget() {
        IWorkbenchPage page = getSite().getPage();
        if (page == null) {
            return null;
        }
        IWorkbenchPart part = page.getActivePart();
        if (part == null) {
            return null;
        }
        K target = getCurrent(part);
        return target;
View Full Code Here

     *
     * @param partRef
     * @return Target for the partRef
     */
    protected K getCurrent( IWorkbenchPartReference partRef ) {
        IWorkbenchPart part = partRef.getPart(false);
        if (part == null)
            return null;

        return getCurrent(part);
    }
View Full Code Here

        return null;
      }
     
      IWorkbenchPage page = window.getActivePage();
      if( page!=null ){
        IWorkbenchPart part = page.getActivePart();
        if( part instanceof MapPart ){
          return (MapPart) part;
        }
      }
     
View Full Code Here

    public void pageOpened( IWorkbenchPage page ) {
        page.addPartListener(this);
        IEditorReference[] editors = page.getEditorReferences();
        for( IEditorReference reference : editors ) {
            IWorkbenchPart workpart = reference.getPart(false);
            if( reference.getPart(false) instanceof MapPart ){
                MapPart part = (MapPart) reference.getPart(false);
                openMaps.add(part);
               
                if (page.isPartVisible(workpart)){
                    visibleMaps.add(part);
                }
            }
        }
        IViewReference[] views = page.getViewReferences();
        for( IViewReference reference : views ) {
            IWorkbenchPart workpart = reference.getPart(false);
            if( workpart instanceof MapPart ){
                MapPart part = (MapPart) reference.getPart(false);
                openMaps.add(part);
               
                if (page.isPartVisible(workpart)){
View Full Code Here

        }
    }

    public void partActivated( IWorkbenchPartReference partRef ) {
        // make this the active map(if it is a MapPart)
        IWorkbenchPart part = partRef.getPart(false);
        if( part instanceof MapPart){
            addActivePart((MapPart) part);
        }
    }
View Full Code Here

        }
    }

    public void partClosed( IWorkbenchPartReference partRef ) {
        // if active map then make previous map be the active map
        IWorkbenchPart part = partRef.getPart(false);
        removePart(part);
    }
View Full Code Here

        removePart(part);
    }

  public void partVisible( IWorkbenchPartReference partRef ) {
        // if no active map then make this the active map (if it is a MapPart)
        IWorkbenchPart part = partRef.getPart(false);
        if( part instanceof MapPart){
            visibleMaps.add((MapPart) part);
            if( activeParts.isEmpty() ){
                activeParts.add((MapPart) part);
            }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchPart

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.