Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorReference


            if (activate) {
                page.activate(editor);
            }
            return editor;
        }
        IEditorReference reusedEditorRef = fReusedEditor;
        if (reusedEditorRef != null) {
            boolean isOpen = reusedEditorRef.getEditor(false) != null;
            boolean canBeReused = isOpen && !reusedEditorRef.isDirty() && !reusedEditorRef.isPinned();
            if (canBeReused) {
                boolean showsSameInputType = reusedEditorRef.getId().equals(editorId);
                if (!showsSameInputType) {
                    page.closeEditors(new IEditorReference[] { reusedEditorRef }, false);
                    fReusedEditor = null;
                } else {
                    editor = reusedEditorRef.getEditor(true);
                    if (editor instanceof IReusableEditor) {
                        ((IReusableEditor) editor).setInput(input);
                        page.bringToTop(editor);
                        if (activate) {
                            page.activate(editor);
                        }
                        return editor;
                    }
                }
            }
        }
        editor = page.openEditor(input, editorId, activate);
        if (editor instanceof IReusableEditor) {
            IEditorReference reference = (IEditorReference) page.getReference(editor);
            fReusedEditor = reference;
        } else {
            fReusedEditor = null;
        }
        return editor;
View Full Code Here


        if (activePage == null) {
            if (statusLineManager != null)
                statusLineManager.setErrorMessage("Active page is null.");
            return;
        }
        IEditorReference editorsArray[] = activePage.getEditorReferences();

        final List<IFile> files = new ArrayList<IFile>();
        for (int i = 0; i < editorsArray.length; i++) {
            IEditorPart realEditor = editorsArray[i].getEditor(true);
            if (realEditor != null) {
View Full Code Here

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

        for ( int i = 0; i < editorReferences.length; i++ )
        {
            IEditorReference reference = editorReferences[i];
            IWorkbenchPart workbenchPart = reference.getPart( true );

            if ( (
                    ( ( workbenchPart instanceof ObjectClassFormEditor ) && ( wrapper instanceof ObjectClassWrapper ) )
                    || ( ( workbenchPart instanceof AttributeTypeFormEditor ) && ( wrapper instanceof AttributeTypeWrapper ) )
                    || ( ( workbenchPart instanceof SchemaFormEditor ) && ( wrapper instanceof SchemaWrapper ) )
                )
                && ( reference.getPartName().equals( wrapper.getDisplayName() ) ) )
            {
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop( workbenchPart );
                return;
            }
        }
View Full Code Here

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

        for ( int i = 0; i < editorReferences.length; i++ )
        {
            IEditorReference reference = editorReferences[i];
            IWorkbenchPart workbenchPart = reference.getPart( true );

            if ( (
                    ( ( workbenchPart instanceof ObjectClassFormEditor ) && ( wrapper instanceof ObjectClassWrapper ) )
                    || ( ( workbenchPart instanceof AttributeTypeFormEditor ) && ( wrapper instanceof AttributeTypeWrapper ) )
                    || ( ( workbenchPart instanceof SchemaFormEditor ) && ( wrapper instanceof SchemaWrapper ) )
                )
                && ( reference.getPartName().equals( wrapper.getDisplayName() ) ) )
            {
                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop( workbenchPart );
                return;
            }
        }
View Full Code Here

public class StsConfigBot extends StsBot {

  private final WorkbenchContentsFinder workbenchContentsFinder = new WorkbenchContentsFinder();

  public StsBotConfigEditor activeConfigEditor() {
    IEditorReference editor = workbenchContentsFinder.findActiveEditor();
    if (!(editor.getEditor(false) instanceof SpringConfigEditor)) {
      throw new WidgetNotFoundException("There is no active editor");
    }
    return new StsBotConfigEditor(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.