title: Open Editor in an Eclipse PDE View programmatically
body: <p>I am creating an eclipse plugin with a view, called DataView. I want the Java Hex Editor to open in my DataView that I created. I followed <a href="https://www.vogella.com/tutorials/EclipseEditors/article.html" rel="nofollow noreferrer">this</a> vogella post, which stated that getViewSite().getPage(), would force the editor to open in the DataView. However, when I test the code, the DataView opens separately from the editor. Note: I am using Java 8 by company requirements.</p>
  <p><strong>Is there anyway to fix this?</strong> I have attached my code and my current output below:</p>
  <pre class="lang-java prettyprint-override"><code>@Override
      public void createPartControl(Composite parent) {
      
          Text text = new Text(parent, SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL);
          Font font = new Font(text.getDisplay(), new FontData(&quot;Courier&quot;, 12 , SWT.NONE));
          text.setFont(font);
           
          File file = FileData.getDataFile();
          URI fileURI = file.toURI();
          
          //String workspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
  
          IFileStore fileStore = EFS.getLocalFileSystem().getStore(fileURI);
          if (!fileStore.fetchInfo().isDirectory() &amp;&amp; fileStore.fetchInfo().exists()) {
              IWorkbenchPage page = getViewSite().getPage();
              try {
                  IDE.openEditor(page, fileURI, &quot;net.sourceforge.javahexeditor&quot;, true);
              } catch (PartInitException e) {
                  
              }
          }
      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/PlvQ9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PlvQ9.png" alt="enter image description here" /></a></p>