diff options
| author | pguilet | 2018-01-26 15:00:31 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2018-01-30 09:52:20 +0000 |
| commit | 627b435006fc5793783233f2f1a419dc5c86599d (patch) | |
| tree | 62a5a481d55b1170d3a5e3b0b57d93b32e197aee | |
| parent | 38b64d8ada8aac566847ce67c2818e0af471832e (diff) | |
| download | org.eclipse.sirius-627b435006fc5793783233f2f1a419dc5c86599d.tar.gz org.eclipse.sirius-627b435006fc5793783233f2f1a419dc5c86599d.tar.xz org.eclipse.sirius-627b435006fc5793783233f2f1a419dc5c86599d.zip | |
[471900] Add documentation about quick service navigation
Bug: 471900
Change-Id: Ie84591cb6b2619f579b7f1059cf77567f9000871
Signed-off-by: pguilet <pierre.guilet@obeo.fr>
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
5 files changed, 32 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index b0a3d737b7..f7587abb5a 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -136,6 +136,10 @@ <li><span class="label label-success">Added</span> An action is added in main toolbar to reload the VSM of installed plug-ins that may have changed. Refer to the <a href="specifier/general/Specifying_Viewpoints.html#reloadVSM">specifier documentation</a> for details. </li> + <li><span class="label label-success">Added</span> In the VSM editor, when the cursor is inside an interpreted expression at a location which corresponds to a Java service invocation, hitting + <strong>F3</strong> will navigate to the service implementation in a Java editor. See + <a href="specifier/general/Writing_Queries.html#service_navigation">the documentation</a> for more details. + </li> </ul> <h3 id="DeveloperVisibleChanges">Developer-Visible Changes</h3> <h4 id="Changesinorg.eclipse.sirius.common">Changes in diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index c73183a98f..aa58900e21 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -13,7 +13,7 @@ h3. User-Visible Changes h3. Specifier-Visible Changes * <span class="label label-success">Added</span> An action is added in main toolbar to reload the VSM of installed plug-ins that may have changed. Refer to the "specifier documentation":specifier/general/Specifying_Viewpoints.html#reloadVSM for details. - +* <span class="label label-success">Added</span> In the VSM editor, when the cursor is inside an interpreted expression at a location which corresponds to a Java service invocation, hitting *F3* will navigate to the service implementation in a Java editor. See "the documentation":specifier/general/Writing_Queries.html#service_navigation for more details. h3. Developer-Visible Changes diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html index d2fd0d3b0d..1578f6deac 100644 --- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html +++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html @@ -37,6 +37,9 @@ <a href="#service_methods">Writing Java Services</a> </li> <li> + <a href="#service_navigation">Accessing Java service implementations from interpreted expression</a> + </li> + <li> <a href="#standard_services">Standard Services</a> <ol style="list-style: disc;"> <li> @@ -351,6 +354,18 @@ <code>void</code>. You can return any value instead, for example target argument (the service method’s first parameter). </li> </ul> + <h2 id="service_navigation">Accessing Java service implementations from interpreted expression</h2> + <p>If you want to see the service implementation(s) used in an interpreted expression in the Java editor, you just have to put your cursor on the service and press the + <strong>F3</strong> keyboard key. Three scenarios can occur after hitting F3: + </p> + <ul> + <li>Nothing happens if your service does not exist in any services class defined in the VSM or if the expression is not complete (missing parenthesis and parameters).</li> + <li>If only one implementation matches your service, it is open directly in Java editor.</li> + <li>If many implementations match your service call, a wizard is opened and allows you to choose the Java class containing the service implementation you wish to see:</li> + </ul> + <p> + <img border="0" src="images/serviceNavigation.png"/> + </p> <h2 id="standard_services">Standard Services</h2> <p>Sirius provides some standard services that can be used from any VSM simply by adding the appropriate reference (as a <em>Java Extension</em>) to the implementation class’s fully qualified name. When using such a service class, make sure your diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.textile b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.textile index d5e8a11a8d..560cb7b301 100644 --- a/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.textile +++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.textile @@ -147,12 +147,24 @@ public class EObjectServices { Once a service has been defined and its class is registered in your VSM, you can invoke it in the expressions of languages which support it like this: <code>[aFamily.getFamiliesContainingParents()/]</code>. (using Acceleo syntax) The invocation looks as if the service was a normal feature of the @Family@ type. When the service is invoked, the model element on which it is invoked is used as the first argument to the Java method. If arguments are passed in the expression, they are mapped to the second, third, etc. parameters of the Java method, assuming the types are compatible. The result of evaluating a service invocation is the result of the Java method. + + _Warning:_ Java service methods should be stateless. There is no guarantee that two successive invocations of the same service method on two model elements (or even on the same one) will use the same instance of the service class. _Warning:_ There are currently some limitations on the use of Java services from Acceleo: * primitive types can not be used as arguments or return types for service methods invoked from Acceleo 3 expressions. The workaround is to use the corresponding wrapper type (e.g. @Integer@ instead of @int@). * service methods invoked from Acceleo 3 expressions can not return @void@. You can return any value instead, for example target argument (the service method's first parameter). +h2(#service_navigation). Accessing Java service implementations from interpreted expression + +If you want to see the service implementation(s) used in an interpreted expression in the Java editor, you just have to put your cursor on the service and press the *F3* keyboard key. Three scenarios can occur after hitting F3: +* Nothing happens if your service does not exist in any services class defined in the VSM or if the expression is not complete (missing parenthesis and parameters). +* If only one implementation matches your service, it is open directly in Java editor. +* If many implementations match your service call, a wizard is opened and allows you to choose the Java class containing the service implementation you wish to see: +!images/serviceNavigation.png! + + + h2(#standard_services). Standard Services Sirius provides some standard services that can be used from any VSM simply by adding the appropriate reference (as a _Java Extension_) to the implementation class's fully qualified name. When using such a service class, make sure your _Viewpoint Specification Project_ has a dependency towards the Sirius plug-in which provides said class. diff --git a/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/serviceNavigation.png b/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/serviceNavigation.png Binary files differnew file mode 100644 index 0000000000..dc11d93a33 --- /dev/null +++ b/plugins/org.eclipse.sirius.doc/doc/specifier/general/images/serviceNavigation.png |
