Code editors in general with JavaFX

Yesterday I did a short demo on how one can build code editors with JavaFX while the talk was at Xtextcon most information apply to any code editor you may want to develop with the runtime components developed as part of e(fx)clipse.

I’ve uploaded the slides to slideshare

The important point is that all this is plain Java! No OSGi involved so eg the Java-Sample I showed looks like this:

public class SampleJavaCode extends Application {
  private final static String[] LEGAL_CONTENT_TYPES = new String[] { 
    IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_CHARACTER };

  private int count = 0;

  public void start(Stage primaryStage) throws Exception {
    BorderPane container = new BorderPane();
    Document document = new Document();

    JavaSourceConfiguration configuration = new JavaSourceConfiguration();

    SourceViewer viewer = new SourceViewer();

    FastPartitioner partitioner = new FastPartitioner(new FastJavaPartitionScanner(), LEGAL_CONTENT_TYPES);
    document.setDocumentPartitioner(configuration.getConfiguredDocumentPartitioning(viewer), partitioner);


    Scene s = new Scene(container);

  public static void main(String[] args) {

and looks like this:



All sources for the stuff I presented are available in the e(fx)clipse git repository – watch out for projects starting with “org.eclipse.fx.xtext”.

This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Code editors in general with JavaFX

  1. Daniel Zimmermann says:

    Do you have an already build version of Compensator lying around somewhere? Or more generally spoken: Do you (via Eclipse foundation or your company) plan to release one? Will it contain a bundled JRE (preferably, no?)?

  2. Pingback: JavaFX links of the week, May 25 // JavaFX News, Demos and Insight // FX Experience

Leave a Reply to Tom Schindl Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.