JFace Text Editor
This is the text editor component that is used inside Eclipse.
Simple example on WinXp?
Source:
import dwt.std; import dwtx.jface.text.Document; import dwtx.jface.text.source.CompositeRuler; import dwtx.jface.text.source.LineNumberRulerColumn; import dwtx.jface.text.source.AnnotationRulerColumn; import dwtx.jface.text.source.SourceViewer; import dwtx.jface.window.ApplicationWindow; version(JIVE) import jive.stacktrace; const char[] startText = `void main() { ApplicationWindow w = new SourceViewerTest(); w.setBlockOnOpen( true ); w.open(); Display.getCurrent.dispose(); } `; class SourceViewerTest : ApplicationWindow { this() { super( null ); } protected Control createContents( Composite parent ) { getShell.setText( "SourceViewerTest" ); getShell.setSize( 350, 400 ); Display disp = getShell.getDisplay(); Composite container = new Composite( parent, DWT.NONE ); container.setLayout( new FillLayout() ); CompositeRuler ruler = new CompositeRuler(); LineNumberRulerColumn lineCol = new LineNumberRulerColumn(); lineCol.setBackground( disp.getSystemColor( DWT.COLOR_GRAY ) ); lineCol.setForeground( disp.getSystemColor( DWT.COLOR_BLUE ) ); ruler.addDecorator( 0, lineCol ); Document doc = new Document( startText ); SourceViewer sv = new SourceViewer( container, ruler, DWT.BORDER | DWT.H_SCROLL | DWT.V_SCROLL ); sv.setDocument( doc ); return container; } } void main() { ApplicationWindow w = new SourceViewerTest(); w.setBlockOnOpen( true ); w.open(); Display.getCurrent.dispose(); }

