Eclipse editor: customise the way the data is displayed
I am working on a plug-in that associates an editor with a custom file extension. This file contains a list of comma separated values that I would like to format into tables to display in the editor when the开发者_StackOverflow社区 user double clicks on one of these files.
I already have a class to manage the extraction of the values in the columns that I want from the comma separated data.
Earlier, I had a view with tables that I would populate but I had to hard code the filename as it is not possible to associate a view with a file type. Now I would like to give the user the option to use their own file instead of the one I hard coded. Since I would like to stick to the Eclipse UI guidelines (views are not associated with file types), I am thinking of formatting the data and displaying it in a read-only editor.
Is it possible to format what shows up in the editor when the user double clicks on a file?
I think what you are looking for is a form editor. See org.eclipse.ui.forms.editor.FormEditor
. With this, you can display the contents of any file inside of a custom graphical editor. For example, this kind of editor is used to edit plugin.xml and MANIFEST.MF files.
精彩评论