7.9. RFRS Considerations
To pass this test, create a list of the views defined by your application and demonstrate how they are used to navigate information, open editors, or display the properties of some object. In the case of the examples presented earlier in this chapter, show the Favorites view (see Figure 10-4 on page 393) and describe its use to the reviewers. In particular, double-clicking on a file in the Favorites view will open the file in an editor.
For this test, show how changes made in your view are saved immediately. If your view updates an existing editor, make sure that the editor is immediately marked as dirty and shows the modification indicator (*). Further, show that the Save menu does not need to be invoked for the view to save its changes.
To pass this test, show that your view reflects the input state of the perspective (if appropriate). If your view is meant to show some attribute of the selected editor, make sure that when it is opened it displays the appropriate information. For the Favorites view, this requirement probably does not apply. The Favorites view could be extended to update its own selection to reflect the currently active editor.
For this requirement, if your view implements any of the items on the global action list, show that those commands can also be invoked from the window menus and toolbars. For the Favorites view, show that the Cut, Copy, Paste, and Delete (Remove) commands can be invoked from the platform Edit menu.
Persist the state of each view between sessions. If a view is self-starting in the sense that its input is not derived from selection in other parts, the state of the view should be persisted between sessions. Within the workbench, the state of the Navigator view, including the input and expansion state, is saved between sessions.
Show that your view persists its state between sessions. For the Favorites view, shut down and restart the workbench and show that the Favorites items appearing in the list are the same ones that were there when the workbench was shut down.
Register all context menus in the view with the platform. In the platform, the menu and toolbar for a view are automatically extended by the platform. By contrast, the context menu extension is supported in collaboration between the view and the platform. To achieve this collaboration, a view must register each context menu it contains with the platform.
Show that the context menu of your view is extensible by the platform. If the platform defines commands that are appropriate for the objects contained in your view, those commands should appear in the view's context menu. For the Favorites view, show that common Eclipse commands such as "Replace With" and "Compare With" appear when you right-click on a Favorites item (see Figure 7-9).
Figure 7-9. Favorites view showing platform contributions to the context menu.
As with the previous best practice, show that any commands contributed to your view's context menu are appropriate to the type of the selected object. Commands that don't apply should be filtered out. For the Favorites view, show that the platform commands contributed to the context menu are context-sensitive based on the type of object selected (see Figure 7-10).
Figure 7-10. Favorites view showing that context menu items are filtered based on their type (projects show items other than files).