Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorReference


  public List editors() throws WidgetNotFoundException {
    List editors = SWTBotView.findEditors();

    List result = new ArrayList(editors.size());
    for (Iterator iterator = editors.iterator(); iterator.hasNext();) {
      IEditorReference editorReference = (IEditorReference) iterator.next();
      result.add(new SWTBotEclipseEditor(editorReference));
    }
    return result;
  }
View Full Code Here


     */
    private Map<IPath, List<IEditorReference>> removeEditorsNotMatchingCurrentName(String currentName,
            List<IEditorReference> editorReferences) {
        Map<IPath, List<IEditorReference>> ret = new HashMap<IPath, List<IEditorReference>>();
        for (Iterator<IEditorReference> it = editorReferences.iterator(); it.hasNext();) {
            IEditorReference iEditorReference = it.next();
            try {
                IEditorInput otherInput = iEditorReference.getEditorInput();

                //Always get the 'original' name and not the currently set name, because
                //if we previously had an __init__.py editor which we renamed to package/__init__.py
                //and we open a new __init__.py, we want it renamed to new_package/__init__.py
                IPath pathFromOtherInput = getPathFromInput(otherInput);
View Full Code Here

        IWorkbenchPage[] pages = activeWorkbenchWindow.getPages();
        for (int i = 0; i < pages.length; i++) {
            IEditorReference[] editorReferences = pages[i].getEditorReferences();

            for (int j = 0; j < editorReferences.length; j++) {
                IEditorReference iEditorReference = editorReferences[j];
                if (!PyEdit.EDITOR_ID.equals(iEditorReference.getId())) {
                    continue; //Only PyDev editors...
                }
                try {
                    IEditorInput editorInput = iEditorReference.getEditorInput();
                    if (editorInput == null) {
                        continue;
                    }
                    IFile file = (IFile) editorInput.getAdapter(IFile.class);
                    if (file != null) {
View Full Code Here

          + titleSubstring);
    }

    public boolean matches(Object item) {
      if (item instanceof IEditorReference) {
        IEditorReference editor = (IEditorReference) item;
        String id = editor.getId();
        String title = editor.getTitle();
        return id.equals("org.eclipse.compare.CompareEditor")
            && title.contains(titleSubstring);
      }

      return false;
View Full Code Here

    }
    IEditorReference[] editors = PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage()
        .getEditorReferences();
    for (int i = 0; i < editors.length; i++) {
      IEditorReference editorReference = editors[i];
      IEditorPart editor = editorReference.getEditor(false);
      if (editor instanceof PHPStructuredEditor) {
        PHPStructuredEditor phpEditor = (PHPStructuredEditor) editor;
        boolean isDirty = phpEditor.isDirty();
        if (phpEditor.getTextViewer() instanceof PHPStructuredTextViewer) {
          PHPStructuredTextViewer textViewer = (PHPStructuredTextViewer) phpEditor
View Full Code Here

    IWorkbenchPage page = getPage();
    if (page != null) {
      IEditorReference[] refArray = page.getEditorReferences();
      if (refArray != null && refArray.length > 1) {
        IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1];
        IEditorReference activeEditor = (IEditorReference) page.getReference(page.getActiveEditor());
        for (int i = 0; i < refArray.length; i++) {
          if (refArray[i] != activeEditor)
            continue;
          System.arraycopy(refArray, 0, otherEditors, 0, i);
          System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i);
View Full Code Here

      /* Restore Window */
      OwlUI.restoreWindow(page);

      /* First try if the Search is already visible */
      IEditorReference editorRef = EditorUtils.findEditor(page.getEditorReferences(), fSearchmark);
      if (editorRef != null) {
        IEditorPart editor = editorRef.getEditor(false);
        if (editor instanceof FeedView)
          page.activate(editor);
      }

      /* Otherwise Open */
 
View Full Code Here

        IWorkbenchPage page = fWindow.getActivePage();
        if (page != null) {
          IEditorReference[] refArray = page.getEditorReferences();
          if (refArray != null && refArray.length > 1) {
            IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1];
            IEditorReference activeEditor = (IEditorReference) page.getReference(page.getActiveEditor());
            for (int i = 0; i < refArray.length; i++) {
              if (refArray[i] != activeEditor)
                continue;
              System.arraycopy(refArray, 0, otherEditors, 0, i);
              System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i);
View Full Code Here

      Object element = selection.getFirstElement();

      /* Find the Editor showing given Selection */
      IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      IEditorReference[] editorReferences = activePage.getEditorReferences();
      IEditorReference reference = EditorUtils.findEditor(editorReferences, element);
      if (reference != null)
        activePage.bringToTop(reference.getPart(true));
    }
  }
View Full Code Here

   *
   * @return the active editor, if any
   * @throws WidgetNotFoundException if there is no active view
   */
  public SWTBotEditor activeEditor() {
    IEditorReference editor = workbenchContentsFinder.findActiveEditor();
    if (editor == null)
      throw new WidgetNotFoundException("There is no active editor"); //$NON-NLS-1$
    return new SWTBotEditor(editor, this);
  }
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.