ZHAW-Logo OAPA-Logo TAT-Logo
zurück  
Diplomarbeit 2003 (DA03): Arbeits-Archiv
 
DA Frp 03/1 - Java-Swing component for JavaScript editor
Studierende: Daniel Hora, horadan

Betreuer: Peter T. Früh, frup

The result of this work is a reliable and performant Java-Swing text component, which can highlight JavaScript code. For that the functions syntax examination, syntax highlighting, auto indenting, highlighting of brackets and highlighting of text section in between brackets were realized.

The text component was build, by extending the available model of a Java-Swing text component with the mentioned functions. The new model can be used with every Styled Text Area. Thus a component was created which can be used like a usual Java-Swing text component.

So that the text component can also show other program syntaxes without changing the basic logic, functions which are dependent of the JavaScript syntax, were implemented in a separate package.

The syntax check is done with the scripting engine Rhino from the Mozilla cooperation. The generated announcements about possible syntax mistakes can be presented with a syntax listener to the user.

Passages with comments, strings, keywords and brackets are found with own created parsers and are shown with different font styles.

With a configuration file the component can be configured individually. There the different font styles and keywords can be set. The user can set any number of groups with keywords that are displayed in their configured way. Every function of the component can be activated or deactivated with the configuration file.

The component was integrated into a test UI and was tested successfully.

zurück