General Interface is an open source project hosted by the Dojo Foundation

Creating and Loading the Catalog File

Now that you've created a properties file for the Container and Widget prototypes, you'll create catalog.xml to define the path to them. After creating the catalog file, you'll use the API jsx3.ide.loadTemplateCatalog to create a JavaScript file that loads the catalog file.

After the catalog file is created and loaded, General Interface reads it and loads the appropriate properties file into the Properties Editor palette when a Container or Widget object is selected in the user interface.

To create the catalog file:

  1. Choose File > New > XML Document and copy and paste this code into the empty document:
    <?xml version="1.0" encoding="UTF-8"?>
    <data jsxid="jsxroot">
      <record jsxid="my.example.Container" jsxtext="properties/Container.xml"/>
      <record jsxid="my.example.Widget" jsxtext="properties/Widget.xml"/>
    </data>
    Note that the path to the properties file is relative to the project directory.
  2. Save the properties file:
    1. Choose File > Save and navigate to the properties folder.
    2. Type catalog.xml in the file name field and click Save.

To load the catalog file:

  1. Choose *File > New > JavaScript File t*o create a new JavaScript file.
  2. Copy and paste this code into the blank JavaScript file:
    //this is the package declaration
    if (jsx3.ide)
     jsx3.ide.loadTemplateCatalog("prop","properties/catalog.xml",my.example.ADDIN);


    The loadTemplateCatalog() method loads a template catalog for the Properties Editor palette, Events Editor palette, or XSL Parameters palette. For more information, see the jsx3.ide.loadTemplateCatalog() method in the General Interface API Reference.

  3. Save the JavaScript file:
    1. Choose File > Save and navigate to the js folder.
    2. Open the my folder.
    3. Type package.js in the file name field and click Save.

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.