java - how to open excel file in eclipse internal editor -
i need open excel file project explorer in eclipse internal editor. calling below function open file in editor.
public static void openfileintoeditor(string filepath) { file filetoopen = new file(filepath); if (filetoopen.exists() && filetoopen.isfile()) { try { ifilestore filestore = efs.getlocalfilesystem().getstore(filetoopen.touri()); iworkbenchpage page = guihandler.getpage(); try { ide.openinternaleditoronfilestore(page, filestore); //ide.openeditoronfilestore(page, filestore); } catch (partinitexception e) { system.out.println("erorr in openfileintoeditor : " + e.getmessage()); } } catch (exception e) { system.out.println("erorr in openfileintoeditor2 : " + e.getmessage()); } } else { } }
it works fine text file shows binary code when trying open excel file in internal editor. doing wrong or should need open excel file in internal eclipse editor java program.
there no internal editor excel files in standard eclipse. getting normal text editor trying edit binary file.
you try ide.openeditoronfilestore
, may open 'in-place system editor` within eclipse (you need have 'allow in-place system editors' option set in preferences on 'general > editors' page).
Comments
Post a Comment