JBoss.orgCommunity Documentation
This chapter will describe how the Scribble tooling can be used within the Eclipse IDE.
Before being able to create a protocol, we need to first create an Eclipse project, if one does not already exist. This is achieved by selecting the New → Project … menu item from the context menu associated with the Project Explorer, which appears on the left hand side of the Eclipse tool.
This will result in a dialog box being displayed showing the different types of project that can be created. If the project is not required for any other purpose, then expand the General top level node and choose the Project child node. Press the Next
button and then enter the project name before pressing the Finish
button.
Once a project has been created (or selected if already exists), then we need to create a hierarchy of folders representing the module path within which the protocol will be defined.
A folder is created by selecting New → Folder menu item from the context menu associated with either the project, or a parent folder. This will show a dialog window in which the new folder’s name can be specified.
Once the appropriate folder hierarchy has been created, then the next step is to create the protocol file. This can be achieved by selecting the New → Other … menu item from the context menu associated with the containing folder. This will present a dialog window with the list of items that can be created. Expand the top level Scribble node and select the Protocol child node. When the Next
button is pressed it will offer the ability to enter the name of the protocol. Finally press the Finish
button to create the file.
When the protocol file is created, it will also launch the editor for the file. For further information, on how to edit the protocol, see the next section.
To edit a Scribble protocol file (with extension .scr) simply locate the file within the Project Explorer, by expanding the relevant project and folders, and then double click on the file to launch the Scribble editor.
The editor will appear in the main area. It is essentially a standard text editor, although will provide some guidance (e.g. keyword highlighting).
When a change has been made to the file, an astrisk will appear against the filename to indicate that it is in a dirty state. To save the file, use Ctrl-S, Alt-F followed by S, or the disc icon in the top left part of the toolbar.
When a protocol is edited, and saved, it will automatically trigger the validation of the protocol.
An issues that are found with the protocol will be displayed in the Markers view (window) in the bottom region of the Eclipse window. Double clicking on any of the errors in this area will navigate to the protocol file (and specific text in that file).
Projecting a Global Protocol will create a set of Local Protocols, one per role within the Global Protocol. To perform this task, select the Scribble → Project menu item from the context menu associated with the Scribble protocol file in the Project Explorer.
This will cause the local protocol files to be created in the same folder as the global protocol. This is because they are associated with the same module. However the filename will be appended with the role, indicating that it is a local protocol associated with that role.