Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPage.findEditor()


            IEditorInput editorInput = sourceEditor.getEditorInput();
            if (editorInput instanceof FileEditorInput && ((FileEditorInput) editorInput)
                .getFile().getProject()
                .equals(event.getResource())) {
              IWorkbenchPage page = pages[i];
              IEditorPart editorPart = page.findEditor(editorInput);
              page.closeEditor(editorPart, true);
            }
          }
        }
      });
View Full Code Here


    NonExistingPHPFileEditorInput nonExistingEditorInput = NonExistingPHPFileEditorInput
        .findEditorInput(path);
    if (nonExistingEditorInput != null) {
      IWorkbenchPage activePage = PHPUiPlugin.getActivePage();
      if (activePage != null) {
        IEditorPart editor = activePage
            .findEditor(nonExistingEditorInput);
        if (editor instanceof PHPStructuredEditor) {
          return (ISourceModule) ((PHPStructuredEditor) editor)
              .getModelElement();
        }
View Full Code Here

          public void run() {
            IWorkbenchPage activePage = DLTKUIPlugin
                .getActivePage();
            if (activePage != null) {
              if (editorInput != null) {
                editor[0] = activePage.findEditor(editorInput);
              } else {
                editor[0] = activePage.getActiveEditor(); // workaround
                // for
                // external
                // files
View Full Code Here

  public IEditorPart openEditorForFile(IFile file) throws PartInitException {
    final IWorkbenchPage page = getWorkbenchWindow().getActivePage();
    final IEditorInput input = new FileEditorInput(file);
    // try to find an open editor with this input
    IEditorPart part = page.findEditor(input);
    if (part != null) {
      // found one, activate it
      page.activate(part);
    } else {
      // no editor found, open a new one
View Full Code Here

  public void openAndAddMarkerForFile(IFile file, EclipseCollabSharedObject.SharedMarker marker) throws PartInitException, CoreException {
    final IWorkbenchPage page = getWorkbenchWindow().getActivePage();
    final IEditorInput input = new FileEditorInput(file);
    // try to find an open editor with this input
    IEditorPart part = page.findEditor(input);
    if (part != null) {
      // found one, activate it
      page.activate(part);
    } else {
      // no editor found, open a new one
View Full Code Here

    IWorkbenchPage page = window.getActivePage();

    IEditorPart editor = null;
    if (marker.getResource() instanceof IFile) {
      FileEditorInput fileInput = new FileEditorInput((IFile) marker.getResource());
      editor = page.findEditor(fileInput);

      if (editor == null) {
        try {
          editor = IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),
              (IFile) marker.getResource());
View Full Code Here

    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    IWorkbenchPage page = window.getActivePage();

    return page.findEditor(new FileEditorInput((IFile) marker.getResource()));
  }

  /**
   * Returns the XML element corresponding to the location of the given
   * marker. Precondition: The marked element to be returned is a bean element
View Full Code Here

      IProject project = reviewModel.getProjectManager().getProject();
      IFile targetFile = project.getFile(reviewIssue.getTargetFile());
      IWorkbench workbench = ReviewPlugin.getInstance().getWorkbench();
      final IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
      IFileEditorInput fileEditorInput = new FileEditorInput(targetFile);
      IEditorPart editorPart = page.findEditor(fileEditorInput);
      if (editorPart != null && editorPart instanceof ITextEditor) {
        ITextEditor textEditor = (ITextEditor) editorPart;
        IDocument document = textEditor.getDocumentProvider().getDocument(fileEditorInput);
        int start = -1;
        int end = -1;
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.