Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Setting Preferences

Syntax color and template settings of the editor can be changed in the Preferences window in Eclipse.

To edit preferences, select Window > Preferences > Brew MP Contextual Editor.

Setting syntax color preferences

To edit syntax color preferences, select Syntax Coloring. Colors can be designated for categories selected from the element list, as shown in the image below.

To edit the syntax coloring for an element, do the following.

  1. Select the element from the Element list.

    Once an element is selected, the options are enabled.

  2. Select the Color bar to open the Color dialog, where you can select from an array of basic colors, or create a custom color. Click OK when you have made your changes.
  3. Check the boxes to enable Bold, Italic, Strikethrough, or Underline as desired.
  4. Changes to the element can be viewed in the Preview window. Once you have made your changes, click Apply.
  5. Note that any changes made can be reverted to default settings by clicking Restore Defaults.

The following table provides a description and examples for the categories in the syntax color preference window.
Category as listed Description Example values
CIF Helper Functions Helper functions used for specifying file info or string encoding info BytesOfFile, ImageRscData, EncStringRscData
CIF Primitive Fields Sub-fields present inside the CIF constructs name, type, id, data
CIF Primitives Main constructs used in CIF files ModRsc, Applet, SysRsc, Notifier
Keyword 'return' "return" keyword used in functions return
Long String Lua long string defined inside [(=)*[](=)"] [=[Sample long string]=]
Lua Keywords Standard Lua keywords function, end, true, nil, and, break
Numbers Integer values 1001, 0x11
Operators All operators of Lua or, and , not, >, =, +, -
Others All entries that don't fall into other categories val, _index, n
Standard Functions Standard functions in Lua print, setmetatable, coroutine.create, math.abs, string.byte
Strings All entries in double quotes "Test Data"
Multi-line comments Long comments in Lua. Given inside --[(=)*[](=)"] --[=[Sample long comment]=]
Single-line comment Line starting with – --Sample comment

Setting template preferences

To edit template preferences, select Templates. In the Templates window, templates can be edited, added or removed. The Templates window is shown in the following image.

Select a template from the list to view it in the Preview window.

To edit an existing template, do the following.

  1. Select the template from the list, and click Edit.

    The Edit Template dialog opens.

  2. Within the Edit Template dialog, you can change the name, description, pattern of the template, or insert a variable.

    Once you have made your changes, click OK.

  3. Once a template has been edited, the Revert to Default button is activated when that template is selected in the Templates window. Click Revert to Default to return the template to default value.

To add a new template, do the following.

  1. Click New.

    The New Template dialog opens.

  2. Enter the name, description, pattern, insert any desired variables to the template, and click OK.

To import a template, do the following.

  1. Click Import.

    The Importing Templates dialog opens.

  2. Within the Importing Templates dialog, browse to the location of any desired template, select the template, and click Open.

    The imported template will be listed in Templates window.

To export a template, do the following.

  1. Select a template from the list and click Export.

    The Export Templates dialog opens.

  2. Browse to the location you wish to export the template to, and click Save.

Any changes made to the templates can be reverted by clicking Restore Defaults in the Templates window.