Context Sensitive Help

Table of Contents

Overview

In this section we will show how to set up the context sensitive help system. The Actifsource context sensitive help is integrated into the Eclipse Platform help system.

As a very simple example, let us define a help system for the following meta-model. This example allows to show help information about the Class A, B and BaseAB, and the respective instances A1 and B1.

First, we create the help file “ClassDocument.html” which contains all the help information and which defines the link targets for the context sensitive help.

image348 image348

image349 image349

Table of Contents

The table of contents (toc) contains a collection of topics for display inside the Eclipse help system. The topics here unlike in the context sensitive help are not bound to a context. For the detailed information on the supported features (Topics, Link and Anchor), see the Eclipse documentation

Now we create a HelpSystem resource in Actifsource: “ExampleHelpSystem”. Let us add a table of contents which has its contents statically defined as xml file: “StaticTableOfContents”. It has two properties:

  • primary: If true: The table of contents is displayed as a book within the Eclipse help.
  • file: The location of the toc xml file.

image350 image350

For editing the toc xml file, you can use the Eclipse specific editor, or edit it directly in an xml editor.

The toc xml file consist of a root xml element “toc” having an attribute “label” and containing nested “topic” elements. A “topic” element has the two xml attributes:

  • label: The label to display for the topic.
  • href: The location of the html File. The link providing anchors.

Now we create a toc file (TableOfContentsFile.xml) with the following topics and nested topics.

image351 image351

image352 image352

To open the Eclipse help system choose Help -> Help Contents. Select the ‘Actifsource Help Sample’ and expand the topics and you will see the following.

image353 image353

Help Context

Context sensitive help is a mechanism for linking a Resource to a specific help topic. For the detailed information on the supported features (Context, Topics and Commands), see the Eclipse documentation.

image354 image354

The information, which defines the different contexts and how they are linked to a topic, is stored in a help context xml file. When triggering the context sensitive help, the defined contexts are matched against the currently selected resource in the following order (most specific to least specific):

  • Matching of the instance by its GUID (instance match)
  • Matching of a resource by the GUID of its class (direct class match), and it super-classes (indirect class match).

You can edit the help context xml file directly or you using the Eclipse specific editor. A context xml entry has the two attributes:

  • id: The GUID of the Resource to associate the help.
  • merge: If true, also the topics of less specific contexts than this context are shown. If false, the topics of less specific context matches are omitted.

A topic entry in the xml file has the attributes:

  • label: The label displayed for the topic.
  • href: The location of the html file. The link providing anchors.

Now we create a help context file (HelpContextfile.xml) with the following contexts and topics.

image355 image355

image356 image356

The content sensitive help can be opened by selecting a Resource via any Actifsource editor and pressing ‘F1’.

All related topics started from the selected Resource (A1) via his types (from specific to generic type) are merged together. If only a single context matches the currently selected resource (setting the “merge” flag to false), then the html content is immediately shown inside the Eclipse help view.

image357 image357