Dynamic User Assistance in Eclipse-Based Applications
Posted in Blogs and articles on Mar 13, 2009 at 14:53 IST (about 1 year ago). Subscribe to this post
Email
Showing comments 1 to 1 of total 1 on page 1 of 1
Post replyShowing comments 1 to 1 of total 1 on page 1 of 1
« Previous1Next »
krisRank: 14
Introduction
Development environments have become very complex. As a result, providing users with context relevant assistance is critical to helping them succeed with your tools and applications. This article will introduce you to Eclipse's powerful Dynamic Assistance framework and provide examples that illustrate how you can take full advantage of its capabilities.
For years, software developers have looked for better ways to provide users with more timely information to help them be successful. Why? If users have to regularly engage and hunt through a large Help system, they'll become frustrated. Opening the Help system is an overt action that the user must take to get information. Because it is an overt action, it interrupts the user's task.
From a usability perspective, it would be much more efficient for the user if context-relevant information were dynamically presented, immediately available, and easily visible while the user continues to work. If information could be presented in this fashion, users would be able to engage targeted information without significant disruption to their tasks. The challenge has been that mechanisms for presenting information in this fashion have been lacking. Fortunately, the latest versions of Eclipse include new (and evolving) mechanisms for providing dynamic context-sensitive help.
To help you understand and leverage these mechanisms, this article will begin by providing a few simple examples of the basic context-sensitive help found in Eclipse, discussing them from the user's perspective. Next, we'll look at a simple example of how you can take advantage of Eclipse's help framework directly, with no additional programming required. Finally, we'll use a small sample application (based on the sample EMF Library Editor) to describe how you can extend the basic capabilities provided by Eclipse, thereby significantly increasing the extent to which your can provide dynamic context-sensitive information. For this example, we implement the following methods from the IContextProvider class:
* getContextChangeMask - This method returns flags indicating which types of events should trigger a context help update.
* getContext - This method returns a help context for the given target. The number of times this method will be called depends on the context change mask. Static context providers will be called each time the owner of the target is activated. If change triggers are used, the method will be called each time the trigger occurs.
* getSearchExpression - This method returns a search expression that finds more information about the current target. It can be used to return results for the Dynamic Help section of the Help view. We will discuss this method towards the end of the article.
The User's Experience of Context-Sensitive Help
The basic intent of context sensitive help is to be able to present the user with a small amount of relevant information based on the objects that they are currently engaging within the product user interface (UI). Eclipse's basic context-sensitive help capabilities allow you to create information about wizard pages, views, and editors. By doing so, as the user moves from view to view or editor to editor, the information presented in the Help view changes.
To see this for yourself, follow these steps:
1. Open your Eclipse workbench.
2. Switch to the Java perspective.
3. Click Help > Dynamic Help (the Help view opens).
4. Select the Hierarchy view.
If the dynamic help view is your default context-sensitive help mechanism (Windows > Preferences > Help), the Help view should now look something like Figure 1.
If you select various views and editors in your workbench, you will notice that the two sections of the Help view change. The top section, About Hierarchy view, describes the Hierarchy view and provides a few targeted links where additional information is available. The next section, called Dynamic Help, provides a longer list of links. This set of links is the result of an automatic search query that is built and run by the Eclipse dynamic assistance framework. The basic query combines the view or editor name, and the current perspective, performs a search of the Help system, and returns the top items from the results list.
Figure 1. The Help View

In addition to providing context-sensitive help for views and editors, it can also be very useful for wizards. To see this for yourself, follow these steps:
1. Select File > New > Project. The New Project wizard appears.
2. Select the question mark icon in the lower left corner of the wizard. A Help view appears, attached to the wizard.
Figure 2 shows the New Project wizard with context-sensitive help opened.
Figure 2. The New Project Wizard

To see how the help content changes, select a project type from the list and then select Next. The help on the second page of the wizard will now include elements related to the type of project selected.
For example, Figure 3 shows the help found on page two of this wizard, assuming you selected an Eclipse Modeling Framework (EMF) project. The Dynamic Help section changes to show items which relate to EMF based projects.
Figure 3. New EMF Project

The Help view can be particularly powerful for new users, who often become confused by the wide array of views, perspectives, and wizards that are available.
Posted by kris on Friday, March 13, 2009, 2:53 pm
Pages: « Previous1Next »