JAMS Developer Guide
Customizing the Source Editor

When using the JAMS Source Editor, it is possible to load a user created configuration file which allows you to create your own language syntax coloration rules. This can be especially useful if you’ve added a custom execution method, and would also like to support fully colorized syntax in the Source Editor.

Custom colorization rules can be applied by using an XML document which specifies which words or characters belong to which color group.  A sample XML document can be found below.

<?xml version="1.0" encoding="utf-8" ?>
 <ArrayOfConfigLanguage>
   <ConfigLanguage name="TestLang">
     <formats>
       <format name="Text" Font="Courier New, 10pt" FontColor="Black" />
       <format name="SelectedText" Font="Courier New, 10pt" BackColor="Highlight" FontColor="HighlightText" />
       <format name="Whitespace" Font="Courier New, 10pt" FontColor="Black" />
       <format name="KeyWord" Font="Courier New, 10pt" FontColor="Blue" />
     </formats>
     <extensions>
       <extension>foo</extension>
     </extensions>
     <lexems>
       <lexem BeginBlock="Test" Type="KeyWord" />
     </lexems>
     <splits>
       <split>+=</split>
     </splits>
   </ConfigLanguage>
 </ArrayOfConfigLanguage>

In this simple example configuration, notice the format name “KeyWord” has been specified, and the FontColor property has been set to Blue. Whenever a lexem is defined with the Type “KeyWord”, it will appear in the editor as Blue.

Save the above file in a location which can be accessed by your JAMS client.  Now, edit the User.Config file located in the JAMS CLient installation directory and add or edit the line like:

<add key="SourceEditConfig" value="C:\Path\To\Your\File.xml" />

To test the new configuration file, navigate to the Definitions tab, choose the Jobs shortcut, and Add a new job.  Proceed to the Source editor screen. To test the new configuration settings, choose the Open File option and load a .foo file.
 

Notice the word “Test” appears in blue.  Using this process, you can define additional lexems in the configuration file, as well as additional languages.  Also, it is possible to override existing language definitions using this process.  Just change the “name” property of the ConfigLanguage tag, and update the extension tag as well.

Some additional resources to help you in defining new language configurations can be found here:

http://help.syncfusion.com/ug/windows%20forms/edit/default.htm#!documents/1overview.htm
http://help.syncfusion.com/ug/windows%20forms/edit/default.htm#!documents/411creatingacustomlanguageconfigurationfile.htm

See Also

 

 


Copyright © Fortra, LLC and its group of companies.
All trademarks and registered trademarks are the property of their respective owners.