Difference between pages "Rodin Developer Support" and "Rodin Editor User Guide"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Jrloria
 
imported>Tommy
 
Line 1: Line 1:
The Developer Support provides resources for developing plug-ins for the Rodin Platform.
+
== Introduction ==
  
 +
The Rodin Editor plug-in provides a structured editor to model in Event-B withing Rodin. This editor uses a textual representation, and edition is done through an overlay text editor and action depending on the caret position in the text.<br>
 +
For more details about the principles of this editor,  see [[Rodin_Editor|the Rodin Editor Plug-in page]].
 +
''<span style="color:#FF4500">IMPORTANT :  we identified a source of concurrency issue in the current version (0.5.0) of the plug-in.</span>''<br>
 +
<span style="color:#FF4500">'''To avoid any trouble, please do not generate files while having some Rodin Editor open, and edit only one model per project at once.'''</span>
  
== Rodin Developer FAQ ==
+
== Installation ==
  
see [[Developer FAQ]].
+
=== Setup ===
 +
Install the Rodin Editor plug-in:
 +
# In the menu choose Help -> Install New Software...
 +
# In the Work with dropdown list, choose the location URL: Rodin - http://rodin-b-sharp.sourceforge.net/updates
 +
# Select the Rodin Editor feature then click the check box
 +
# Click Next, after some time, the Install Details page appears
 +
# Click Next and accept the license
 +
# Click Finish
 +
# A Security Warning window may appear: click OK
 +
# Restart Rodin as suggested.
 +
Now you are ready to use the new Rodin Editor plug-in.
  
== Architecture of the Rodin Platform ==
+
=== Release Notes ===
 +
See [[Rodin_Editor_Release_History | Rodin Editor Release Notes]]
  
=== Rodin Platform Core ===
 
  
* [[Database]]
+
== Editing ==
  
* [[Builder]]
+
This is a small exercice to get used to the principles of the new structured editor. It is based on the 'Celebrity' project of the tutorial. You can download the resulting project [http://sourceforge.net/projects/rodin-b-sharp/files/Doc_%20Tutorial/1.1/Celebrity.zip/download <tt>here</tt>].<br>
 +
We will here build the context ''Celebrity_C0''.
  
* [[Rodin Index Design]]
+
=== Create a context, add elements to it ===
 +
Let's create a Rodin project, and add a context component called ''Celebrity_C0'' to it.<br>
 +
-- By opening this context with the Rodin Editor (right click > Open with > Rodin Editor) you shall obtain the following:<br>
 +
[[Image:RodinEditor_UserGuide_step1.png]]
  
* [[Indexing System]]
+
This editor allows to do things based on the position of the caret.<br>
 +
-- Place the caret at one location on the line of the context label, and before the label, as on the figure below:
  
* [[Undo Redo]]
+
[[Image:RodinEditor_UserGuide_step2.png]]
  
* [[File Root Separation]]
+
-- Then right click, and add a 'Constant' child using the menus :
  
=== Event-B User Interface ===
+
[[Image:RodinEditor_UserGuide_step3.png|600px]]
  
The Event-B User Interface of the Roding Platform has two major components that are concerned with either [[Modelling User Interface|modelling]] in Event-B or [[Proving User Interface|proving]] properties of models.
+
-- Save the file. <br>
 +
After saving the file, the error markers are recalculated, and you have an error that appears on the newly created constant 'cst1'.<br>
 +
You shall see this :
  
* [[Modelling User Interface]]
+
[[Image:RodinEditor_UserGuide_step4.png|600px]]
  
* [[Proving User Interface]]
+
Note that you can visualize the error message by going over the error marker with the mouse.
  
Apart from these are more minor components.
+
-- Enter the edition mode by clicking inside the label 'cst1'.  
  
* [[Proof Purger Design|Proof Purger]] allows to delete unused proofs.
+
[[Image:RodinEditor_UserGuide_step5.png]]
  
* [[Proof Skeleton Design]] is a view that displays skeletons of existing proofs
+
The overlay editor then appears (cst1 is in black, and the background is gray[see above]) and you can modify the label of the constant.<br>
 +
-- Modify the label to be 'k'and exit the overlay edition by pressing 'Enter'. ''Note that because 'Enter' is used to enter or exit the overlay mode under the caret, in order to insert carriage return in text, you have to press CTRL+ENTER.<br>''
 +
You can then save the file. <br>
 +
You then see something like the following.
  
* [[Auto-Completion Design]] proposes a list of names to the user editing a model
+
[[Image:RodinEditor_UserGuide_step6.png]]
  
=== Event-B Component Library ===
+
Then we want to add another constant. As we have 'k' already, we will use 'add sibling' command to add another constant after k.<br>
 +
-- Place the caret before k as on the following picture :
  
Event-B models and all proof-related information are stored in the Rodin database. The syntax of the mathematical notation, that is, expressions, predicates, and assignments, are maintained in an [[Abstract Syntax Tree|abstract syntax tree]]. Abstract syntax trees are manipulated by means of a class library that can be used independently of Eclipse. They are saved in the database in human-readable form as Unicode character strings. Event-B constructs, such as contexts and machines, are not represented as abstract syntax trees. They are stored and retrieved directly from the database (by contrast, mathematical formulas need additional parsing). Well-formedness of Event-B constructs is verified by a [[Static Checker|static checker]]. The static checker has two main purposes: (1) it generates error messages for ill-formed constructs, and (2) it filters well-formed parts of components to be subjected to proof obligation generation. The [[Proof Obligation Generator|proof obligation generator]] uses those parts of constructs that are well-formed and generates proof obligations from them. Finally, the [[Proof Manager|proof manager]] attempts to prove proof obligations and maintains existing proofs associated with proof obligations. The proof manager works automatically and interactively. When new proof obligations have been generated it attempts to discharge them automatically. If it does not succeed, it permits interactive proof (by means of the [[Proving User Interface|proving user interface]]).
+
[[Image:RodinEditor_UserGuide_step7.png]]
  
* [[Abstract Syntax Tree]]
+
-- Right-click. The following context menu appears :
  
* [[Static Checker]]
+
[[Image:RodinEditor_UserGuide_step8.png|200px]]
  
* [[Proof Obligation Generator]]
+
-- Click on "Add Sibling" you see then that a new constant was created, named 'cst1'.
  
* [[Proof Manager]]
+
[[Image:RodinEditor_UserGuide_step9.png]]
  
* [[Proof Simplification]]
+
You can then enter the overlay edition mode to change this value to 'c'.<br>
 +
After saving the file, you obtain the following context :
  
== Extending Rodin ==
+
[[Image:RodinEditor_UserGuide_step10.png]]
  
* [[Developer Documentation]]
+
''' CONGRATULATIONS! You learned how to use the Rodin Editor.'''
 +
You learned that :
 +
# To create an element:
 +
## or you place the caret before the label of its parent, and create a child using 'create child' in the contextual menu,
 +
## or you place the caret next to a sibling element and you create a sibling using 'create sibling' in the contextual menu.
 +
# To edit the attributes of an element:
 +
## you enter the overlay edition with left click or with "ENTER" and modify the textual contents,
 +
## you press 'ENTER' to quit overlay edition.
  
* [[Plug-in Tutorial]]
+
=== Move and delete elements ===
  
* [[Extending the Rodin Database]]
+
=== Using keyboard shorcuts ===
 +
Here is the list of the currently key bindings which are set by default and specific to the Rodin Editor.
  
* [[Extending the project explorer]]
+
{{SimpleHeader}}
 +
|-
 +
! scope=col | KEY SEQUENCE || ACTION
 +
|-
 +
| BACKSPACE (ENTER) || Enter the edition mode using the overlay editor if the caret is on an editable place.
 +
|-
 +
| DEL || Suppress the element after the caret position
 +
|-
 +
| CTRL+T || Add a sibling of the element pointed by the caret position. The sibling is placed just after this latter one.
 +
|-
 +
| CTRL+SHIFT+N || Opens a popup to select the element type of the child to add to the element pointed by the caret position. Note that if there is only one child type, the child will be directly created.
 +
|-
 +
| CTRL+BACKSPACE || Insert a new carriage return while editing with the overlay editor.
 +
|-
 +
| ALT+ARROW_UP || Move up the selected elements.
 +
|-
 +
| ALT+ARROW_DOWN || Move down the selected elements.
 +
|-
 +
| SHIFT+ARROW_UP || Select elements up.
 +
|-
 +
| SHIFT+ARROW_DOWN || Select elements down.
 +
|-
 +
| ALT+ESC || Quit the current overlay edition (if any) and forget the modifications made, frees the current selection.
 +
|-
 +
| TAB || Go to the next editable place (i.e. to the next editable element attribute)
 +
|-
 +
| SHIFT+TAB || Go to the previous editable place (i.e. to the next editable element attribute)
 +
|}
  
* [[Extending the Structure Editor]]
+
=== Customize this list ===
 +
If you don't like these shortcuts, you can modify them by setting your own key preferences.
 +
To do so, go to Window > Preferences and then General > Key. A table appears were you can find and edit the shortcuts.
  
* [[Extending the Pretty Print Page]]
+
== Tips & Tricks ==
 
+
A command currently (i.e. in Rodin 2.2) disable the possibility to use the ESC instead of ALT+ESC sequence. This is quite cumbersome, and can be tuned!
* [[Extending the Proof Manager]]
+
To do so, open the preference table for key shortcuts (described above) and after ensuring you disabled the filters of uncategorized commands (using the Filters... dialog)
 
+
search for the command named "Restore Styles". This is the command to release the highlights in the proving views. You can then swith the sequence of this command to ALT+ESC and change the value of the "Abort edition and free selected items" command to ESC. After applying these settings, the shortcuts will be modified as wished above.
* [[Extending the Index Manager]]
 
 
 
* [[Extending the Static Checker]]
 
 
 
* [[Index Query]]
 
 
 
== Useful Hints ==
 
 
 
=== Version Control ===
 
 
 
All sources of the core Rodin platform (and of some plug-ins) are managed under version control in SourceForge. The repository currently used is Subversion and can be accessed using URL [https://rodin-b-sharp.svn.sourceforge.net/svnroot/rodin-b-sharp  https://rodin-b-sharp.svn.sourceforge.net/svnroot/rodin-b-sharp].
 
 
 
=== Building against a version of Rodin ===
 
 
 
To develop extensions to the Rodin platform your code build needs access to a consistent (version-wise) set of Rodin platform plug-ins. (Don't just check out the latest versions from 'Head' because it may be under development and in an inconsistent state). An easy way to set up your workspace is to import the Rodin platform source code from SVN into your workspace using the 'Releng' plug-in. See [http://wiki.event-b.org/index.php/FAQ#Installing_the_sources_from_Subversion_in_Eclipse Installing the sources from Subversion in Eclipse] for further instructions.
 
 
 
Alternatively, you can set your plugin development target platform to any Rodin installation you have installed (Eclipse-Preferences-Plug-in Development-Target Platform). This is useful as a final test that everything will work once installed into Rodin but because it uses a 'built' platform, you don't get access to the Rodin source code (e.g. for de-bugging).
 
 
 
=== Testing ===
 
 
 
=== Debugging ===
 
 
 
=== Publishing ===
 
 
 
A Plug-in developed for the Rodin Platform will normally consist of a collection of eclipse 'plugin' projects and a single eclipse 'feature' project. The feature project contains branding information such as logo's icons and licensing details. It is also used to identify your Plug-in so that users can install it. To build your Plug-in use an eclipse 'site' project. This will build the jar files for your plugin projects and a jar for your feature. See eclipse documentation for more details.
 
 
 
Now you need to make your Plug-in available for users to install via the Main Rodin Update site (which comes built-in to the Rodin platform).  
 
 
 
First upload your jar files onto the Sourceforge uploads area and then create a new release in the FRS (Admin-file releases). Note that you should include a zip of the complete source projects to comply with Sourceforge rules. You must not repeat files that have not changed. Sourceforge does not allow you to upload multiple copies of the same jar file. The Feature jar will take care of unchanged plugin jars and use the existing links. Only new jars should be included in a particular release.
 
See here for details:- http://alexandria.wiki.sourceforge.net/File+Release+System+-+Offering+Files+for+Download
 
 
 
Finally, the update site must be updated to redirect the update requests to the files on the FRS.
 
(Currently this is done by Colin Snook on request - see Rodin developers page for contact details).
 
 
 
[[Details for Maintaining Main Rodin Update Site]]
 
 
 
 
 
[[Category:Developer documentation]]
 
[[Category:Rodin Platform]]
 

Revision as of 13:25, 13 July 2011

Introduction

The Rodin Editor plug-in provides a structured editor to model in Event-B withing Rodin. This editor uses a textual representation, and edition is done through an overlay text editor and action depending on the caret position in the text.
For more details about the principles of this editor, see the Rodin Editor Plug-in page. IMPORTANT : we identified a source of concurrency issue in the current version (0.5.0) of the plug-in.
To avoid any trouble, please do not generate files while having some Rodin Editor open, and edit only one model per project at once.

Installation

Setup

Install the Rodin Editor plug-in:

  1. In the menu choose Help -> Install New Software...
  2. In the Work with dropdown list, choose the location URL: Rodin - http://rodin-b-sharp.sourceforge.net/updates
  3. Select the Rodin Editor feature then click the check box
  4. Click Next, after some time, the Install Details page appears
  5. Click Next and accept the license
  6. Click Finish
  7. A Security Warning window may appear: click OK
  8. Restart Rodin as suggested.

Now you are ready to use the new Rodin Editor plug-in.

Release Notes

See Rodin Editor Release Notes


Editing

This is a small exercice to get used to the principles of the new structured editor. It is based on the 'Celebrity' project of the tutorial. You can download the resulting project here.
We will here build the context Celebrity_C0.

Create a context, add elements to it

Let's create a Rodin project, and add a context component called Celebrity_C0 to it.
-- By opening this context with the Rodin Editor (right click > Open with > Rodin Editor) you shall obtain the following:
RodinEditor UserGuide step1.png

This editor allows to do things based on the position of the caret.
-- Place the caret at one location on the line of the context label, and before the label, as on the figure below:

RodinEditor UserGuide step2.png

-- Then right click, and add a 'Constant' child using the menus :

RodinEditor UserGuide step3.png

-- Save the file.
After saving the file, the error markers are recalculated, and you have an error that appears on the newly created constant 'cst1'.
You shall see this :

RodinEditor UserGuide step4.png

Note that you can visualize the error message by going over the error marker with the mouse.

-- Enter the edition mode by clicking inside the label 'cst1'.

RodinEditor UserGuide step5.png

The overlay editor then appears (cst1 is in black, and the background is gray[see above]) and you can modify the label of the constant.
-- Modify the label to be 'k'and exit the overlay edition by pressing 'Enter'. Note that because 'Enter' is used to enter or exit the overlay mode under the caret, in order to insert carriage return in text, you have to press CTRL+ENTER.
You can then save the file.
You then see something like the following.

RodinEditor UserGuide step6.png

Then we want to add another constant. As we have 'k' already, we will use 'add sibling' command to add another constant after k.
-- Place the caret before k as on the following picture :

RodinEditor UserGuide step7.png

-- Right-click. The following context menu appears :

RodinEditor UserGuide step8.png

-- Click on "Add Sibling" you see then that a new constant was created, named 'cst1'.

RodinEditor UserGuide step9.png

You can then enter the overlay edition mode to change this value to 'c'.
After saving the file, you obtain the following context :

RodinEditor UserGuide step10.png

CONGRATULATIONS! You learned how to use the Rodin Editor. You learned that :

  1. To create an element:
    1. or you place the caret before the label of its parent, and create a child using 'create child' in the contextual menu,
    2. or you place the caret next to a sibling element and you create a sibling using 'create sibling' in the contextual menu.
  2. To edit the attributes of an element:
    1. you enter the overlay edition with left click or with "ENTER" and modify the textual contents,
    2. you press 'ENTER' to quit overlay edition.

Move and delete elements

Using keyboard shorcuts

Here is the list of the currently key bindings which are set by default and specific to the Rodin Editor.


KEY SEQUENCE ACTION
BACKSPACE (ENTER) Enter the edition mode using the overlay editor if the caret is on an editable place.
DEL Suppress the element after the caret position
CTRL+T Add a sibling of the element pointed by the caret position. The sibling is placed just after this latter one.
CTRL+SHIFT+N Opens a popup to select the element type of the child to add to the element pointed by the caret position. Note that if there is only one child type, the child will be directly created.
CTRL+BACKSPACE Insert a new carriage return while editing with the overlay editor.
ALT+ARROW_UP Move up the selected elements.
ALT+ARROW_DOWN Move down the selected elements.
SHIFT+ARROW_UP Select elements up.
SHIFT+ARROW_DOWN Select elements down.
ALT+ESC Quit the current overlay edition (if any) and forget the modifications made, frees the current selection.
TAB Go to the next editable place (i.e. to the next editable element attribute)
SHIFT+TAB Go to the previous editable place (i.e. to the next editable element attribute)

Customize this list

If you don't like these shortcuts, you can modify them by setting your own key preferences. To do so, go to Window > Preferences and then General > Key. A table appears were you can find and edit the shortcuts.

Tips & Tricks

A command currently (i.e. in Rodin 2.2) disable the possibility to use the ESC instead of ALT+ESC sequence. This is quite cumbersome, and can be tuned! To do so, open the preference table for key shortcuts (described above) and after ensuring you disabled the filters of uncategorized commands (using the Filters... dialog) search for the command named "Restore Styles". This is the command to release the highlights in the proving views. You can then swith the sequence of this command to ALT+ESC and change the value of the "Abort edition and free selected items" command to ESC. After applying these settings, the shortcuts will be modified as wished above.