e(fx)clipse 1.0 – New Features – StyledText control to build a code editor (framework)


e(fx)clipse 1.0.0 is just around the corner and scheduled to be released on August 15th, while we are polishing the final bits, the Eclipse IP-Team checks our IP-Log, … .

I’d like to introduce you the new and exiting features that we worked on in the last months since we released 0.9.0 in February.

Blog series

Other posts in this series are:

StyledText control to build a code editor (framework)

We’ve been experimenting with the new Text-API part of OpenJFX8 since its inception in the first weekly builds. In the 1.0 cycle we’ve moved the code from an external repository to e(fx)clipse and improved it adding support for:

  • Copy & Paste
  • Selection
  • Line numbers
  • use CSS for text-styles

The API is not yet complete and there are many many many features missing but you can already build really cool and fancy IDE like applications. The control still has some bugs but we decided to include the current version so that you can give it a spin and provide feedback or even contribute fixes, features, … .

This is a simple Java-Editor built with the StyledText-Control and the Eclipse-Text-Framework who does the paritioning, … of the sourcecode

java_default

and because all colors are not hard coded into the the UI nor set in preferences like in e.g. in Eclipse you can flip the theme and your editor will renderer in a dark theme like this (I used the same colors as IntelliJ IDEA in Dracula mode)

java_dark

The cool thing about the syntax highlighting is that you need to write (fairly) no code because we have a DSL defined via Xtext who allows you specify the highlighting rules to apply. Look for example at this groovy-file

groovy

and the specification of the highlighting
hsl

and the following CSS-Stylesheets for a bright and dark L&F
css-def

You notice that the token names simply match the CSS-Class-Selectors used!

Above I said there’s fairly no code you need to write because for complex rules like the variable interpolation in groovy strings we require you to write some JavaScript and we use Nashorn to load the rule definition which looks like this for variables inside strings.

groovy-js-inter


The text-editor framework that we started to build is not part of the release it is more of a research project that we started to build in this release cycle to exploit Eclipse4+JavaFX and other Eclipse technologies. All building blocks we used although are part of the release and you can build something similar yourself.

This entry was posted in e(fx)clipse and tagged . Bookmark the permalink.

13 Responses to e(fx)clipse 1.0 – New Features – StyledText control to build a code editor (framework)

  1. Pingback: e(fx)clipse 1.0 – New Features – Generate JavaFX Properties accessors | Tomsondev Blog

  2. Pingback: e(fx)clipse 1.0 – New Features – LayoutPanes can be controlled by CSS | Tomsondev Blog

  3. Pingback: e(fx)clipse 1.0 – New Features – CSS Gradient Editor | Tomsondev Blog

  4. Pingback: e(fx)clipse 1.0 – New Features – Drag and Drop for e4/JavaFX applications | Tomsondev Blog

  5. Pingback: e(fx)clipse 1.0 – New Features – The clever CSS-Editor who got more clever | Tomsondev Blog

  6. shumy says:

    These could be the first footsteps for a new breed of IDE’s. A generic IDE build with Xtext for any kind of language. Flexible and extendable. Starting with empty projects without any kind of nature, and basic text processing features. Adding for example the Xtend nature. In the future it could be Xtend for the base of all DSL and Sirius for all DSM.

    • Tom Schindl says:

      it could be but:

      1. this is a research project
      2. our first main focus are the editor, we currently don’t use projects, … but simply rely on the classpath
  7. Pingback: e(fx)clipse 1.0 – New Features – Integration of JavaFX source and property JavaDoc | Tomsondev Blog

  8. Pingback: e(fx)clipse 1.0 – New Features – Consume none OSGi-Artifacts from a maven repository | Tomsondev Blog

  9. Pingback: e(fx)clipse 1.0 released | Tomsondev Blog

  10. miho says:

    Hi,

    really impressive work! How can I use your StyledText control in a standard JavaFX application? Or do I need the Eclipse framework?

    Thanks!

Leave a comment

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