Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorInput


   * @return
   */
  public IEditorPart getEmptyEditor(EditorDescriptor descr) {
        ErrorEditorPart part = new ErrorEditorPart();
       
        IEditorInput input;
        try {
            input = getEditorInput();
        } catch (PartInitException e1) {
            input = new NullEditorInput();
        }
View Full Code Here


      }
     
      private void updateNavigationHistory(IWorkbenchPartReference partRef, boolean partClosed) {
                if (partRef != null && partRef.getPart(false) instanceof IEditorPart) {
                    IEditorPart editor = (IEditorPart) partRef.getPart(false);
                    IEditorInput input = editor.getEditorInput();
                    String id = editor.getSite().getId();
                    Iterator e = editors.iterator();
                    NavigationHistoryEditorInfo info = null;
                    NavigationHistoryEditorInfo currentInfo = null;
                    NavigationHistoryEntry current = getEntry(activeEntry);
                    if (current != null) {
            currentInfo = current.editorInfo;
          }
                    while (e.hasNext()) {
                        info = (NavigationHistoryEditorInfo) e.next();
                        if (id.equals(info.editorID)
                                && input.equals(info.editorInput)) {
                            if (partClosed && info != currentInfo) {
                info.handlePartClosed();
              }
                            break;
                        }
View Full Code Here

    }

    public NavigationHistoryEntry createEntry(IWorkbenchPage page,
            IEditorPart part, INavigationLocation location) {
        String editorID = part.getSite().getId();
        IEditorInput editorInput = part.getEditorInput();
        NavigationHistoryEditorInfo info = null;
        for (Iterator iter = editors.iterator(); iter.hasNext();) {
            info = (NavigationHistoryEditorInfo) iter.next();
            if (editorID.equals(info.editorID)
                    && editorInput.equals(info.editorInput)) {
                info.refCount++;
                break;
            } else {
                info = null;
            }
View Full Code Here

    public void switchToTemplateOrJavaFile() {

        IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        IEditorPart editor = activePage.getActiveEditor();
        if (editor != null) {
            IEditorInput input = editor.getEditorInput();
            if (input != null) {
                IFile currentFile = (input instanceof IFileEditorInput) ? ((IFileEditorInput) input).getFile() : null;
                switchToTemplateOrJavaFile(currentFile);
            }
        }
View Full Code Here

    ICompilationUnit cu = null;
    try {
      IEditorPart editor = AbstractCrystalPlugin.getDefault()
          .getWorkbench().getActiveWorkbenchWindow().getActivePage()
          .getActiveEditor();
      IEditorInput input = editor.getEditorInput();
      if (input instanceof IPathEditorInput) {
        IPath path = ((IPathEditorInput) input).getPath();
        IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
        cu = JavaCore.createCompilationUnitFrom(f);
      }
View Full Code Here

            // Handle cross window drops by opening a new editor
            if (pane instanceof EditorPane) {
              if (pane.getWorkbenchWindow() != stack.getWorkbenchWindow()) {
                EditorPane editor = (EditorPane) pane;
                try {
            IEditorInput input = editor.getEditorReference().getEditorInput();
           
            // Close the old editor and capture the actual closed state incase of a 'cancel'
            boolean editorClosed = editor.getPage().closeEditor(editor.getEditorReference(), true);
           
            // Only open open the new editor if the old one closed
View Full Code Here

        IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        Object selectedObject = structuredSelection.getFirstElement();
        return getProjectFromResource(selectedObject);
      } else if (selection instanceof ITextSelection) {
        IEditorPart activeEditor = DesignerPlugin.getActiveEditor();
        IEditorInput editorInput = activeEditor.getEditorInput();
        if (editorInput instanceof IFileEditorInput) {
          IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
          return getProjectFromResource(fileEditorInput.getFile());
        }
      }
View Full Code Here

                }
            }
            IEditorPart part = page.getActiveEditor();
            if (part != null)
            {
                IEditorInput input = part.getEditorInput();
                return (IJavaElement) input.getAdapter(IJavaElement.class);
            }
        }
        return null;
    }
View Full Code Here

  }

  @Override
  protected PageRec doCreatePage(IWorkbenchPart part) {
    EditorPart source = (EditorPart) part;
    IEditorInput editorInput = source.getEditorInput();
    if (editorInput instanceof FileEditorInput) {
      FileEditorInput fileInput = (FileEditorInput) editorInput;
      IResource r = fileInput.getFile();

      TestViewPage testPage = new TestViewPage(r);
View Full Code Here

                null);

        icu2.createPackageDeclaration(pkg.getElementName(), null);

        IFile input = (IFile) icu2.getResource();
        final IEditorInput editorInput = new FileEditorInput(input);
        final IEditorDescriptor desc = PlatformUI.getWorkbench()
            .getEditorRegistry().getDefaultEditor(input.getName());

        PlatformUI.getWorkbench().getDisplay()
            .asyncExec(new Runnable() {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorInput

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.