Difference between revisions of "Extending the Rodin Event-B Explorer (How to extend Rodin Tutorial)"

From Event-B
Jump to navigationJump to search
imported>Tommy
m (New page: {{Navigation|Previous= Extending_the_Rodin_Structured_Editor_(How_to_extend_Rodin_Tutorial) | Up= How to extend Rodin Tutorial (Index) | Next= }} === In this part...)
 
imported>Pascal
(No difference)

Revision as of 14:48, 23 August 2010

In this part

We will continue our work on the UI integration of our plug-in and extend the Event-B Explorer view. This view provides a view of the structure of Event-B projects, represented as a tree. As we introduced a new element "Bound", we want it to appear in this view as any other machine element such as variables or invariants. The Event-B Explorer uses the Common Navigator Framework (extension point org.eclipse.ui.navigator), thus we will not use a Rodin extension point but directly eclipse extension points.

What we want to get : We want our bound element to appear in the Event-B Explorer view as a direct child (as there will be only one bound element per machine), as described in the picture below:

Extend Rodin Tuto 1 9 Bound in EventB Explorer.png

First we will create Bound element contents to fill the navigator view with, and then we will bind those contents to the navigator view.

Step 1

Add a dependency to the package org.eclipse.ui.navigator.
Add the extension point org.eclipse.ui.navigator.navigatorContent.

Step2

Add a new navigatorContent extension using the newly added extension point org.eclipse.ui.navigator.navigatorContent. In a first time, we will add 2 clause expressions to the navigatorContent extension to explain in which context this content shall be displayed and what to display (item A). In a second time, we will give contents to this extension (item B). The two clauses expressions we will use from navigatorContent extension are :

- triggerPoints. The triggerPoints expression defines the nodes to be used when resolving the Common Navigator content provider's getElements() or getChildren(). This is also used to select the extension for providing labels, images, descriptions and for sorting.
- possibleChildren. The possibleChildren expression defines the node to be used when resolving the Common Navigator content provider's getParent(). It is also used to help determine the parent when handling drop operations.

(A) First, add a clause triggerPoints to the navigatorContent extension, and add