Annotation Editor

A lot of the Java classes that will be created to add behavior to the application require Annotations to provide meta-data about the implementation (see Java Annotations chapter in the Developer Guides).

The annotation editor plugin provides a convenient way to edit the annotations on these classes. It is available on any class that has an existing annotation, under the Package Explorer panel in Eclipse. Right click on the file in the Package Explorer, and there will be a menu item "Edit Annotation".

Package Explorer tab, showing the options menu that is displayed through right click.

Choosing this menu item will cause a new dialog window to appear, and the file to open into an editor if it is not already open. The dialog that appears will allow maintenance of the file's current annotation contents.

Edit Annotation dialog.

The appearance of the dialog is dependent upon the particular annotation, but the standard dialog will present a layout of two columns, a label and an input for each annotation property. The bottom of the dialog will always present the Finish and Cancel buttons. The Cancel button is always available, and will throw away any changes made, leaving the file with the annotation unchanged.

The Finish button will only be enabled when the annotation has no errors. The annotation is validated after any change, and errors will be displayed near the top of the dialog and the Finish button disabled.

Edit Annotation dialog showing the Finish button inactive.

When the property value is itself a list of values or another annotation, there will be a button instead of an input text box. Clicking the button will bring up another dialog to edit its information. In the case of lists, there is a standard dialog where elements can be added, deleted, or reordered.

Edit List dialog for editing an array.

To add a new element, click the '+' button. This will popup a new dialog for the annotation being added (or sometimes a choice of the new annotation's type might need to be chosen first). Clicking the '-' button will delete the highlighted element. The 'up' and 'down' buttons can be used to move the highlighted element up or down within the list. To modify an existing element, double click its row in the list dialog, and a new dialog will open to edit its values.

Finally, there is a special list dialog for lists of strings. Instead of editing the elements in the list in a new dialog, a single input field near the bottom of the dialog is used to edit the highlighted entry.

Edit List dialog for editing lists of strings.

When the finish button is finally pressed, the annotation (and only the annotation) in the file will change to contain the new values entered into the annotation dialogs. The changed file's annotation may be slightly reformatted. The changed file will also remain unsaved, pending user review of the annotation's changes.