Open .java-file in Standard-Eclipse Java-Editor programmatically from main-method -


how can open java-file programmaticaly in standard java-editor of eclipse. dont want use plugin, method. i'm searching this:

    string absolutepath = "c:\\dummfile.java";     // getting editor workbench or     editor javaeditor = workbench.getjavaeditor();     javaeditor.setinput(absolutepath);     // show , set focus     javaeditor.openeditor(); 

i've tried this can't convert file ifile.

thanks!

to convert file ifile :

iworkspace workspace= resourcesplugin.getworkspace();     ipath location= path.fromosstring(file.getabsolutepath());  ifile ifile= workspace.getroot().getfileforlocation(location); 

from this thread , this


Comments