Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPart


        IEditorReference[] references = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .getEditorReferences();

        for ( IEditorReference reference : references )
        {
            IWorkbenchPart workbenchPart = reference.getPart( true );

            if ( ( workbenchPart instanceof ObjectClassEditor ) && ( wrapper instanceof ObjectClassWrapper ) )
            {
                ObjectClassEditor editor = ( ObjectClassEditor ) workbenchPart;
                ObjectClassWrapper ocw = ( ObjectClassWrapper ) wrapper;
View Full Code Here


    }


    private IEntryEditor getEntryEditor( IWorkbenchPartReference partRef )
    {
        IWorkbenchPart part = partRef.getPart( false );
        if ( part != null && part instanceof IEntryEditor )
        {
            IEntryEditor entryEditor = ( IEntryEditor ) part;
            return entryEditor;
        }
View Full Code Here

    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

    /* (non-Javadoc)
     * @see org.eclipse.jface.action.Action#run()
     */
    public void run()
    {
        IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();

        if ( part instanceof SchemaView )
        {
            openTypeHierarchyFromTreeViewer( ( ( SchemaView ) part ).getViewer() );
        }
View Full Code Here

                if (editor!=null) {
                    return editor.getEditorSite().getActionBars().getStatusLineManager();
                }
            }
        }
        IWorkbenchPart activePart = activePage.getActivePart();
        if (activePart==null) {
            return null;
        }
        IWorkbenchPartSite site = activePart.getSite();
        if (site instanceof IEditorSite) {
            IEditorSite editorSite = (IEditorSite)site;
            return editorSite.getActionBars().getStatusLineManager();
        } else if (site instanceof IViewSite) {
            IViewSite viewSite = (IViewSite)site;
View Full Code Here

        return callTree != null;
    }

    private CallHierarchyViewPart getCallHierarchyPart(IWorkbenchPartReference partRef) {
        if (! partRef.getId().equals(CALL_HIERARCHY_REF.id)) return null;
        IWorkbenchPart part = partRef.getPart(true);
        if (!(part instanceof CallHierarchyViewPart)) return null;
        return (CallHierarchyViewPart) part;       
    }
View Full Code Here

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

    private void updateEditorSelection(IWorkbenchPartReference partRef) {
        IWorkbenchPart part = partRef.getPart(true);
        if (!(part instanceof IEditorPart)) return;
        updateEditorSelection(part.getSite().getPage().getEditorReferences());
    }
View Full Code Here

  protected IModule selectedModule;
 
 
  // Must first init selected server or module.  Or just override execute
  protected void initializeSelection(ExecutionEvent event) throws ExecutionException {
    IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
    ISelection selection = activePart.getSite().getSelectionProvider().getSelection();
    if (selection instanceof IStructuredSelection) {
      Object obj = ((IStructuredSelection) selection).getFirstElement();
      if (obj instanceof IServer) {
        this.selectedServer = (IServer) obj;
      }
View Full Code Here

{

    public boolean test(Object receiver, String property, Object[] args,
        Object expectedValue)
    {
        IWorkbenchPart part = (IWorkbenchPart) receiver;

        Object value;
        if ("partKind".equals(property))
        {
            if (part instanceof IEditorPart)
            {
                value = "editor";
            }
            else if (part instanceof IViewPart)
            {
                value = "view";
            }
            else
            {
                value = null;
            }
        }
        else if ("partId".equals(property))
        {
            value = part.getSite().getId();
        }
        else
        {
            value = null;
        }
View Full Code Here

{

    public boolean test(Object receiver, String property, Object[] args,
        Object expectedValue)
    {
        IWorkbenchPart part = (IWorkbenchPart) receiver;

        boolean result = false;

        if (part instanceof IEditorPart)
        {
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.