Formatting Object Model Reference > Creating a Development Environment with Eclipse > Adding FOM Code Completion
  
Adding FOM Code Completion
JSDT code completion libraries are provided as JavaScript files that create prototype objects of the FOM objects. The following files are provided:
Application.js describes all the Application level objects in the FOM
Content.js describes all the Content level objects in the FOM
Formatting.js describes all the Formatting level objects in the FOM
Aliases.js creates shortcut aliases for formatting, template, and application
Create a new project in Eclipse and add these files to it. It will be easier to subsequently find the files when updates are provided. You can also view and edit the contents.
To make the code completion available to your JavaScript projects, create a User Library. Follow the steps listed below:
1. In Eclipse, select Window > Preferences to open the Preferences dialog.
2. In the dialog, browse to JavaScript > Include Path > User Libraries.
3. Click the New button to add a new User Library. Give the new library a name, e.g. FOM.
4. Click the Add .js file button to add files to the library.
5. Select the files in your code completion library and add them.
6. You should now see the files listed in the library:
7. Click OK to exit.
Once you have created the library, add it to the JavaScript projects you create in Eclipse. The plug-in will then be aware of the code completion and will use it to help you with your code.
To do this, follow these steps when creating a new project:
1. Create a new project using the File > New > JavaScript Project menu item.
2. Give the project a name and click Next to open the JavaScript Settings dialog. Select Add JavaScript Library.
3. Select the User Library option.
4. Select your new FOM code completion library and click Finish to complete the action.
When you have created your project, your FOM library will be listed as one of the JavaScript resources for your project.
If you wish to add the library to an existing project, open the Project Properties dialog by using the right mouse button on the project root. Add the library in the JavaScript > Libraries area as described above.
Once the library is associated with the project, you’ll have access to the code completion functionality in the JSDT plug-in.
When using a block assigned to a variable, a list of allowed properties will appear for selection when you enter the . character:
If you select a method associated with an object, the documentation for that method will display: