How to open a file in external editor programmatically in eclipse plugin development?

Eclipse plugin development:How to open a file in external editor programmatically in eclipse plugin development

  • I am opening a .xlsx file in eclipse .It opens internally in MS excel which again contain my excel plugin.Which do not work properly when eclipse open excel internally. So how can i set ,eclipse always open .xlsx file externally.

  • Answer:

    You can define an editor for xlsx in your plugin using the org.eclipse.ui.editors extension point: <extension point="org.eclipse.ui.editors"> <editor extensions="xlsx" id="myeditor.id" icon="icon path" launcher="myeditor.Launcher" name="XLSX editor"> </editor> </extension> This is using the launcher attribute to specify that a class to launch an external editor is to be used. The Launcher class would be something like: public class Launcher implements IEditorLauncher { public void open(IPath file) { File file = file.toFile(); java.awt.Desktop.getDesktop().open(file); } }

archit jain at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.