Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorPart


    }

    page.setEditorAreaVisible(true);

    // see if we already have an editor
    IEditorPart editor = page.findEditor(input);
    if (editor != null) {
      page.activate(editor);
      return;
    }
View Full Code Here


        }
        IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
        if (activePage==null) {
            return null;
        }
        IEditorPart activeEditor = activePage.getActiveEditor();
        if (activeEditor!=null) {
            return activeEditor.getEditorSite().getActionBars().getStatusLineManager();
        }
        IViewReference[] viewRefs = activePage.getViewReferences();
        if (viewRefs!=null) {
            for (int i = 0; i < viewRefs.length; i++) {
                IViewReference aViewRef = viewRefs[i];
                IViewPart view = aViewRef.getView(false);
                if (view!=null) {
                    return view.getViewSite().getActionBars().getStatusLineManager();
                }
            }
        }
        IEditorReference[] editorRefs = activePage.getEditorReferences();
        if (editorRefs!=null) {
            for (int i = 0; i < editorRefs.length; i++) {
                IEditorReference anEditorRef = editorRefs[i];
                IEditorPart editor = anEditorRef.getEditor(false);
                if (editor!=null) {
                    return editor.getEditorSite().getActionBars().getStatusLineManager();
                }
            }
        }
        IWorkbenchPart activePart = activePage.getActivePart();
        if (activePart==null) {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void restoreLocation()
    {
        IEditorPart editorPart = getEditorPart();
        if ( editorPart != null && editorPart instanceof SchemaBrowser )
        {
            SchemaBrowser schemaBrowser = ( SchemaBrowser ) editorPart;
            Object input = getInput();
            if ( input != null && input instanceof SchemaBrowserInput )
View Full Code Here

                    try
                    {
                        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                        IWorkbenchPage page = window.getActivePage();
                        IEditorPart editor = page.openEditor( input, editorId );
                        IDocumentProvider documentProvider = ( ( LdifEditor ) editor ).getDocumentProvider();
                        if ( documentProvider != null && input != null )
                        {
                            IDocument document = documentProvider.getDocument( input );
                            if ( document != null )
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void restoreLocation()
    {
        IEditorPart editorPart = getEditorPart();
        if ( editorPart != null && editorPart instanceof SearchResultEditor )
        {
            SearchResultEditor searchResultEditor = ( SearchResultEditor ) editorPart;
            searchResultEditor.setInput( ( SearchResultEditorInput ) getInput() );
        }
View Full Code Here

    return null;
  }

  public static IResource getActiveResource()
  {
    IEditorPart editor = getActiveEditor();

    if( editor == null )
    {
      return null;
    }

    IAdaptable adaptable = editor.getEditorInput();
    IResource resource = (IResource) adaptable.getAdapter(IResource.class);

    return resource;
  }
View Full Code Here

    }

    IWorkbenchPage activePage= getWorkbenchWindow().getActivePage();
    if (activePage != null)
    {
      IEditorPart activeEditor = activePage.getActiveEditor();

      return activeEditor;
    }

    return null;
View Full Code Here

    }

    private void updateBundleBlueprintAndIncludeResource(IFile blueprintFile, IFile bndFile) throws Exception {

        BndEditModel editModel;
        IEditorPart editor = ResourceUtil.findEditor(workbench.getActiveWorkbenchWindow().getActivePage(), bndFile);
        IDocument doc = null;
        if (editor instanceof BndEditor) {
            editModel = ((BndEditor) editor).getEditModel();
        } else {
            editModel = new BndEditModel();
View Full Code Here

  private static final String FILE_COLON = "file:"; //$NON-NLS-1$
  private static final String FILE_SLASH = FILE_COLON + "/"; //$NON-NLS-1$
  private static final String FILE_SLASH_SLASH = FILE_SLASH + "/"; //$NON-NLS-1$
 
  public static IEditorPart getActiveEditor() {
    IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    return getTextEditor(editor);
  }
View Full Code Here

 
  /**
   * Tries to install key listener on editor's widget
   */
  public static void install(IWorkbenchPart part) {
    IEditorPart editor;
    if (isEnabled() && part instanceof IEditorPart) {
      editor = EclipseEmmetHelper.getTextEditor((IEditorPart) part);
      if (editor instanceof ITextEditor)
        install((ITextEditor) editor);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorPart

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.