When using the JAMS Source Editor, it is possible to load a user created configuration file, which allows for the creation of custom language syntax coloration rules. This can be especially useful if a custom execution method has been added, and supporting fully colorized syntax in the Source Editor is required.
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 the JAMS client. Now, edit the User.config file in the JAMSClient installation directory and add or edit a line like:
<add key="SourceEditConfig" value="C:\Path\To\Your\File.xml" />
To test the new configuration file, navigate to the Definitions shortcut, choose the Jobs tab, 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.