Examples of IEditorReference


Examples of org.eclipse.ui.IEditorReference

            }
        }
        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();
                }
            }
        }
View Full Code Here

Examples of org.eclipse.ui.IEditorReference

   * 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

Examples of org.eclipse.ui.IEditorReference

   * 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

Examples of org.eclipse.ui.IEditorReference

      return;
    }
    final IFile selectedFile = (IFile)resource;
    final IEditorReference[] editorReferences = aPage.getEditorReferences();
    for (int i = 0; i < editorReferences.length; i++) {
      final IEditorReference reference = editorReferences[i];
      if (reference==null) {
        continue;
      }
      final IEditorInput editorInput;
      try {
        editorInput = reference.getEditorInput();
      } catch (PartInitException e) {
        //TODO proper logging
        e.printStackTrace();
        continue;
      }
      if (editorInput==null) {
        continue;
      }
      if (!(editorInput instanceof IFileEditorInput)) {
        continue;
      }
      final IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
      final IFile file = fileEditorInput.getFile();
      if (file==null) {
        continue;
      }
      if (file.equals(selectedFile)) {
        aPage.bringToTop(reference.getEditor(true));
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.IEditorReference

  /* (non-Javadoc)
   * @see org.eclipse.ui.internal.CycleBaseHandler#addItems(org.eclipse.swt.widgets.Table, org.eclipse.ui.internal.WorkbenchPage)
   */
  protected void addItems(Table table, WorkbenchPage page) {
    // TODO Auto-generated method stub
        IEditorReference refs[] = page.getSortedEditors();
        for (int i = refs.length - 1; i >= 0; i--) {
            TableItem item = null;
            item = new TableItem(table, SWT.NONE);
            if (refs[i].isDirty()) {
        item.setText("*" + refs[i].getTitle()); //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ui.IEditorReference

    IWorkbenchPage page = window.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);
View Full Code Here

Examples of org.eclipse.ui.IEditorReference

        /*
         * Returns the topmost editor on the stack, or null if none.
         */
        IEditorPart getTopEditor() {
            IEditorReference editor = (IEditorReference)getActiveReference(parts.size() - 1, true);
           
            if (editor == null) {
                return null;
            }
           
            return editor.getEditor(true);
        }
View Full Code Here

Examples of org.eclipse.ui.IEditorReference

   * @return the active editor, if any
   * @throws WidgetNotFoundException if there is no active editor.
   * @since 1.1
   */
  public SWTBotEclipseEditor activeEditor() throws WidgetNotFoundException {
    IEditorReference editor = UIThreadRunnable.syncExec(new Result<IEditorReference>() {
      public IEditorReference run() {
        try {
          IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
          return (IEditorReference) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getReference(
              activeEditor);
View Full Code Here

Examples of org.eclipse.ui.IEditorReference

   *
   * @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

Examples of org.eclipse.ui.IEditorReference

        IWorkbenchPage[] pages = getWorkbenchPages();
        for (int i = 0; i < pages.length; i++) {
          IWorkbenchPage page = pages[i];
          IEditorReference[] editorReferences = page.getEditorReferences();
          for (int j = 0; j < editorReferences.length; j++) {
            IEditorReference editorReference = editorReferences[j];
            result.add(editorReference);
          }
        }
        return result;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.