title: eclipse plugin how to open file in IDE by code
body: <p>I am working on eclipse plugin in which i have to open a file from project explorer. 
  Suppose i have a project ABC in project explorer. after right click on project i got a option to run my plugin tool. after processing i got some result like Check file xyz.java.</p>
  
  <p>Now i want to open this file in IDE by code </p>
  
  <p>i am using this </p>
  
  <pre><code>File absolute = new File("/Decider.java");  
  File file = new File("/Decider.java");
  IFileStore fileOnLocalDisk = EFS.getLocalFileSystem().getStore(absolute.toURI() );
  
  FileStoreEditorInput editorInput = new FileStoreEditorInput(fileOnLocalDisk);
  
  IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  IWorkbenchPage page = window.getActivePage();
  
   try {  
      page.openEditor(editorInput, "org.eclipse.ui.DefaultTextEditor");         
  
      page.openEditor(editorInput, "MyEditor.editor");          
  
          IFileStore fileStore = EFS.getLocalFileSystem().getStore(absolute.toURI() );
          IDE.openEditorOnFileStore( page, fileStore );
  
        } catch (PartInitException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
      try {
          System.out.println(file.getCanonicalPath());
      } catch (IOException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
      }
  
  
      IPath path = new Path(" /DirectoryReader.java");
      IFile sampleFile =  ResourcesPlugin.getWorkspace().getRoot().getFile(path);
  
      IEditorInput editorInput1 = new FileEditorInput(sampleFile);
      IWorkbenchWindow window1=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage page1 = window1.getActivePage();
      try {
          page1.openEditor(editorInput1, "org.eclipse.ui.DefaultTextEdtior");
      } catch (PartInitException e1) {
  
          e1.printStackTrace();
      } 
  </code></pre>
  
  <p>here it's create a new file named decider in c drive which means it's getting a wrong path.</p>
  
  <p>but when i use path code in some independent java file as a normal <strong>JAVA</strong> project it's getting the correct path.</p>