Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorReference


        }


        // Otherwise, create a new one. This may cause the new editor to
        // become the visible (i.e top) editor.
        IEditorReference ref = null;
        ref = getEditorManager().openEditor(editorID, input, true, editorState);
        if (ref != null) {
            editor = ref.getEditor(true);
        }

        if (editor != null) {
            setEditorAreaVisible(true);
            if (activate) {
View Full Code Here


            EditorDescriptor editorDescriptor, boolean activate, IMemento editorState) throws PartInitException {

      IEditorPart editor = null;
        // Create a new one. This may cause the new editor to
        // become the visible (i.e top) editor.
        IEditorReference ref = null;
        ref = getEditorManager().openEditorFromDescriptor(editorDescriptor, input, editorState);
    if (ref != null) {
            editor = ref.getEditor(true);
        }

        if (editor != null) {
            setEditorAreaVisible(true);
            if (activate) {
View Full Code Here

  /**
   * Creates and populates an editor site for the given editor.
   */
  protected EditorSite createEditorSite(String editorId, IEditorInput input, IEditorPart editor) {
    EditorDescriptor descriptor = (EditorDescriptor) idToDescriptor.get(editorId);
    IEditorReference ref = new EditorReference(getEditorManager(), input, descriptor);
    EditorSite site = new EditorInViewSite(viewSite, ref, editor, page, descriptor);
    IEditorActionBarContributor contributor = descriptor.createActionBarContributor();
    site.setActionBars(createEditorActionBars(descriptor, contributor, site));
    return site;
  }
View Full Code Here

  /**
   * Creates and populates an editor site for the given editor.
   */
  protected EditorSite createEditorSite(String editorId, IEditorPart editor) {
    EditorDescriptor descriptor = (EditorDescriptor) idToDescriptor.get(editorId);
    IEditorReference ref = new EditorReference();
    EditorSite site = new CompositeEditorSite(mainEditorSite, ref, editor, page, descriptor);
    IEditorActionBarContributor contributor = descriptor.createActionBarContributor();
    site.setActionBars(createEditorActionBars(descriptor, contributor, site));
    return site;
  }
View Full Code Here

   * Try to install tab expander for all opened editors
   */
  public static void installForAll() {
    IEditorReference[] editors = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
    for (int i = 0; i < editors.length; i++) {
      IEditorReference editor = editors[i];
      install(editor.getEditor(false));
    }
  }
View Full Code Here

   * Try to uninstall tab expander from all opened editors
   */
  public static void uninstallFromAll() {
    IEditorReference[] editors = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
    for (int i = 0; i < editors.length; i++) {
      IEditorReference editor = editors[i];
      uninstall(editor.getEditor(false));
    }
  }
View Full Code Here

                // install the content assist processor on all opened parts
                IWorkbenchWindow[] workbenchWindows = PlatformUI.getWorkbench().getWorkbenchWindows();
                for (int i = 0; i < workbenchWindows.length; i++) {
                    IWorkbenchPage[] pages = workbenchWindows[i].getPages();
                    for (int j = 0; j < pages.length; j++) {
                        IEditorReference refs[] = pages[j].getEditorReferences();
                        for (int k = 0; k < refs.length; k++) {
                            IWorkbenchPart part = refs[k].getPart(true);
                            if (part != null) {
                                installContentAssistProcessor(part);
                            }
View Full Code Here

   * @param editorID
   *            the ID of the editor to look for (or null for the default)
   * @return the editor reference (or null if there isn't one)
   */
  public final static IEditorReference findEditor(IFile file, String editorID) {
    IEditorReference editorReference = null;
    for (IWorkbenchWindow workbenchWindow : PlatformUI.getWorkbench().getWorkbenchWindows()) {
      for (IWorkbenchPage workbenchPage : workbenchWindow.getPages()) {
        try {
          String id = null;
          if (editorID == null) {
View Full Code Here

          IWorkbenchPage workbenchPage = activeWorkbenchWindow.getActivePage();
          if (workbenchPage != null && EOModelerPerspectiveFactory.EOMODELER_PERSPECTIVE_ID.equals(workbenchPage.getPerspective().getId())) {
            IEditorReference[] editorReferences = workbenchPage.getEditorReferences();
            int eomodelerEditorCount = 0;
            for (int editorReferenceNum = 0; editorReferenceNum < editorReferences.length; editorReferenceNum++) {
              IEditorReference editorReference = editorReferences[editorReferenceNum];
              if (EOModelEditor.EOMODEL_EDITOR_ID.equals(editorReference.getId())) {
                eomodelerEditorCount++;
              }
            }

            if (eomodelerEditorCount == 0) {
View Full Code Here

    ArrayList suggestions= createSuggestionsFromOpenDocument(viewer, offset, prefix);
    IDocument currentDocument= viewer.getDocument();

    IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IEditorReference editorReferences[]= window.getActivePage().getEditorReferences();

    for (int i= 0; i < editorReferences.length; i++) {
      IEditorPart editor= editorReferences[i].getEditor(false); // don't create!
      if (editor instanceof ITextEditor) {
        ITextEditor textEditor= (ITextEditor) editor;
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorReference

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.