I'm facing a problem and want to ask for a solution.
I'm working on an eclipse plugin project, in which an editor for a type of resource file is required. The resource file has similar structure like csv file. My idea is to provide user the option to edit this type of file both in plain text format and also in an SWT table. Plain text is required for examining data and table provides more flexibility to editing such as sorting by column.
I have been able to create a
MultiPageEditorPart, with one page of
org.eclipse.ui.editors.text.TextEditor, and another page with a
org.eclipse.swt.widgets.Table and several other widgets like search bar. The content of the resource file can be shown in the
TextEditor, can also be edited and saved. On the other hand, the content can be loaded in the table too, sorting and searching all work good.
The problem is: when I edit a cell in the table, I want the change also reflected in the
TextEditor, and vice versa. Since the resource file can be very large, I want the saving action happen only on the
TextEditor, i.e. I don't want any modification in the table directly stored to resource file, but to mark the file dirty. But I can't figure out how. How can I for example get the content of
EditorInput, check it line by line, and modify it outside
Or, are there more efficient ways to do this? Can anyone give any hints?