Rodin Keyboard User Guide: Difference between revisions
imported>Pascal |
imported>Laurent →Extending the Keyboard: Updated example and text |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOCright}} | |||
{ | |||
== Introduction == | == Introduction == | ||
Line 10: | Line 7: | ||
== Getting Started == | == Getting Started == | ||
=== Overview === | === Overview === | ||
The Rodin Keyboard plug-in creates a view (namely " | The Rodin Keyboard plug-in creates a view (namely "Rodin Keyboard") under Event-B category. | ||
You can open " | You can open "Rodin Keyboard" view now: | ||
# Go to Window/Show View/Other. | # Go to Window/Show View/Other. | ||
# Choose the " | # Choose the "Rodin Keyboard" view from the Event-B category. | ||
The view contains a text area which takes an ASCII input and translate it into the mathematical language (defined by extensions). | The view contains a text area which takes an ASCII input and translate it into the mathematical language (defined by extensions). | ||
Line 22: | Line 19: | ||
Below are the special combos (set of ASCII characters) and their translations into the Event-B mathematical language. | Below are the special combos (set of ASCII characters) and their translations into the Event-B mathematical language. | ||
{| | {| border="1" cellspacing="0" | ||
! ASCII !! LaTeX !! Math !! Meaning !! Unicode | ! ASCII !! LaTeX !! Math !! Meaning !! Unicode | ||
|- | |- | ||
Line 148: | Line 144: | ||
|align="center" | <code>><</code> || align="center" | \dprod || align="center" | <math>\dprod</math> || Direct product || U+2297 | |align="center" | <code>><</code> || align="center" | \dprod || align="center" | <math>\dprod</math> || Direct product || U+2297 | ||
|- | |- | ||
|align="center" | <code>< | |align="center" | <code>|</code><code>|</code> || align="center" | \pprod || align="center" | <math>\pprod</math> || Parallel product || U+2225 | ||
|- | |- | ||
|align="center" | <code>~</code> || align="center" | \conv || align="center" | ~ || Tilde operator || U+223C | |align="center" | <code>~</code> || align="center" | \conv || align="center" | ~ || Tilde operator || U+223C | ||
|- | |- | ||
|align="center" | <code | |align="center" | <code><|</code> || align="center" | \domres || align="center" | <math>\domres</math> || Domain restriction || U+25C1 | ||
|- | |- | ||
|align="center" | <code | |align="center" | <code><<|</code> || align="center" | \domsub || align="center" | <math>\domsub</math> || Domain subtraction || U+2A64 | ||
|- | |- | ||
|align="center" | <code>|></code> || align="center" | \ranres || align="center" | <math>\ranres</math> || Range restriction || U+25B7 | |align="center" | <code>|></code> || align="center" | \ranres || align="center" | <math>\ranres</math> || Range restriction || U+25B7 | ||
Line 168: | Line 164: | ||
|align="center" | <code>UNION</code> || align="center" | \Union || align="center" | <math>\Union</math> || N-ary union || U+22C3 | |align="center" | <code>UNION</code> || align="center" | \Union || align="center" | <math>\Union</math> || N-ary union || U+22C3 | ||
|- | |- | ||
|align="center" | <code | |align="center" | <code>|</code> || align="center" | \mid || align="center" | <math>\mid</math> || Such that || U+2223 | ||
|- | |- | ||
|colspan="5" | | |colspan="5" | | ||
Line 194: | Line 190: | ||
|align="center" | <code>::</code> || align="center" | \bcmin || align="center" | <math>\bcmin</math> || Becomes an element of || U+003A U+2208 | |align="center" | <code>::</code> || align="center" | \bcmin || align="center" | <math>\bcmin</math> || Becomes an element of || U+003A U+2208 | ||
|- | |- | ||
|align="center" | <code | |align="center" | <code>:|</code> || align="center" | \bcmsuch || align="center" | <math>\bcmsuch</math> || Becomes such that || U+003A U+2223 | ||
|} | |} | ||
== Concepts == | == Concepts == | ||
=== | === Rodin Keyboard View === | ||
The view contains a text area where ASCII input can be typed in. The text will be translated into the mathematical language (which is extensible) when there is a modification of the text. The translation is done for the whole text spanned over multiple lines. | The view contains a text area where ASCII input can be typed in. The text will be translated into the mathematical language (which is extensible) when there is a modification of the text. The translation is done for the whole text spanned over multiple lines. | ||
Line 209: | Line 205: | ||
== Tasks == | == Tasks == | ||
=== Entering a Mathematical Formula === | === Entering a Mathematical Formula === | ||
A formula in the mathematical language of Event-B can be typed in the text area of the | A formula in the mathematical language of Event-B can be typed in the text area of the Rodin Keyboard view. The view will translate the formula from ASCII into the mathematical language as specified [[#Special_Combos | here]]. The formula can be copied as normal (Unicode) text. | ||
=== Changing the Font === | === Changing the Font === | ||
Line 217: | Line 213: | ||
=== Extending the Keyboard === | === Extending the Keyboard === | ||
There is an extension point to extend the keyboard namely <tt>org.rodinp.keyboard.symbols</tt>. An example of this extension point is shown below. | There is an extension point to extend the keyboard namely <tt>org.rodinp.keyboard.symbols</tt>. An example of using this extension point is shown below. | ||
<extension point="org. | <extension | ||
point="org.rodinp.keyboard.symbols"> | |||
<symbol | |||
combo="not" | |||
id="neg" | |||
name="%negName" | |||
translation="¬" /> | |||
<symbolProvider | |||
class="my.package.name.MyClassProvidingSymbols" /> | |||
</extension> | </extension> | ||
The | The first extension contributes a symbol with all the details for translating an ASCII combination into a symbol. The second extension contributes a class. This class will be instantiated by the Rodin Keyboard plug-in to fetch additional symbol definitions. This allows for contributing new symbols dynamically. | ||
== Reference == | == Reference == | ||
Line 235: | Line 233: | ||
=== Preferences === | === Preferences === | ||
The Preferences page is used to change the font of the text area in the | The Preferences page is used to change the font of the text area in the Rodin Keyboard view. You can access it from the "General/Appearance/Colors and Fonts" page. | ||
A sample of this preferences page is shown below. | A sample of this preferences page is shown below. | ||
Line 251: | Line 249: | ||
== Samples == | == Samples == | ||
=== Expression === | === Expression === | ||
{{TODO}} | |||
=== Jumping === | === Jumping === | ||
{{TODO}} | |||
[[Category:User documentation]] | [[Category:User documentation]] | ||
[[Category:Work in progress]] | [[Category:Work in progress]] |
Latest revision as of 12:58, 21 July 2010
Introduction
This short help page provides necessary information on the Rodin Keyboard plug-in and also on how to extend the plug-in.
Getting Started
Overview
The Rodin Keyboard plug-in creates a view (namely "Rodin Keyboard") under Event-B category.
You can open "Rodin Keyboard" view now:
- Go to Window/Show View/Other.
- Choose the "Rodin Keyboard" view from the Event-B category.
The view contains a text area which takes an ASCII input and translate it into the mathematical language (defined by extensions).
Special Combos
Below are the special combos (set of ASCII characters) and their translations into the Event-B mathematical language.
Concepts
Rodin Keyboard View
The view contains a text area where ASCII input can be typed in. The text will be translated into the mathematical language (which is extensible) when there is a modification of the text. The translation is done for the whole text spanned over multiple lines.
Below is an example of the view which is attached to the bottom area of the workbench.
Tasks
Entering a Mathematical Formula
A formula in the mathematical language of Event-B can be typed in the text area of the Rodin Keyboard view. The view will translate the formula from ASCII into the mathematical language as specified here. The formula can be copied as normal (Unicode) text.
Changing the Font
In order to display the Unicode characters for the mathematical language, there is a special font associated with the text area. This font can be changed in the Preferences page associated with the Colors and Fonts. It can be opened from the category "General/Appearance/Colors And Fonts". Any font can be chosen, but mathematical language formulas can be displayed correctly only if the chosen font contains the Unicode characters for the mathematical language. From the Preferences page, you can choose the font, the style and the size for the text area.
More information about the Preferences page can be found here.
Extending the Keyboard
There is an extension point to extend the keyboard namely org.rodinp.keyboard.symbols. An example of using this extension point is shown below.
<extension point="org.rodinp.keyboard.symbols"> <symbol combo="not" id="neg" name="%negName" translation="¬" /> <symbolProvider class="my.package.name.MyClassProvidingSymbols" /> </extension>
The first extension contributes a symbol with all the details for translating an ASCII combination into a symbol. The second extension contributes a class. This class will be instantiated by the Rodin Keyboard plug-in to fetch additional symbol definitions. This allows for contributing new symbols dynamically.
Reference
Release Notes
See the Keyboard Release History.
Preferences
The Preferences page is used to change the font of the text area in the Rodin Keyboard view. You can access it from the "General/Appearance/Colors and Fonts" page.
A sample of this preferences page is shown below.
The button "Change Font" is used to choose a new font. A pop-up dialog will be open and you can choose from the set of system fonts. The button "Reset" is used to set the font to the default Brave Sans Mono font.
There are four other buttons at the bottom of the page:
- Restore Default: Restore the default fonts. It does not affect the Keyboard view.
- Apply: Apply the current chosen font for the Keyboard view.
- OK: Store the preference values to the preference store and close the page. It also applies the current chosen font for the Keyboard view.
- Cancel: Close the page immediately without saving the preference values. Obviously, this does not affect the Keyboard view.
Samples
Expression
TODO
Jumping
TODO