My intention is to code a NASTRAN text editor (plain text editor, eclipse pure E4 RCP application). NASTRAN is an engineering structural analysis application. Simplifying, NASTRAN uses text cards of 8-characters-width per field and up to 10 fields per card (line). See figure with the work done so far
The main feature of this Editor is to show plain text (fixed pitch font) with colored columns background, so it can be easy to distinguish different fields in each row.
I have used a StyledText
control which provides methods to change background:
styledText.setBackgroundImage(backgroundImage);
How can I use IDocument interface with StyledText
so It can provide me support for:
text manipulation
positions
partitions
line information
etc...
Other text controls (TextViewer, SourceViewer) provide setDocument(IDocument) method to load and manipulate text data
--org.eclipse.jface.text.TextViewer
|
--org.eclipse.jface.text.source.SourceViewer
But StyledText
extends SWT Canvas and does not provide methods to set the imput documents
--org.eclipse.swt.custom.StyledText
Alternative approach could be how can I change background in a SourceViewer control so I can have columns of different colors.
Thanks in advance