|
Re: Drill Down on Double Click [message #1220085 is a reply to message #1220044] |
Mon, 09 December 2013 15:26 |
|
Le 09/12/2013 11:26, Kunal Prasad a écrit :
> Hi,
Hi.
>
> I have a container node on which I would like to configure double click
> description for following behavior:
>
> 1. Open another layer in the same diagram presentation.
By default, the user can change the layers activation through the tabbar.
But you can create a Java service [1][2] to activate/deactivate a layer
and use it from a double clic description. You have to create a
'ChangeContext' operation as child of your tool 'Initial Operation'.
Then you will call your service from the browse expression. You will
find a sample service able to change a layer activation at [3]. With
this service in the VSM project and declared as 'Java extension' on the
current Viewpoint, you can call the service from the 'ChangeContext'
with the browse expression
"service:changeSampleLayerActivation(elementView)"
> 2. Open another presentation for the same model. [This is I guess
> already supported]
This is supported by the use of model operations in the VSM and more
precisely the 'Navigation' operation [4], but only for diagrams.
First you need to create a 'ChangeContext' operation as child of your
tool 'Initial Operation' to select the root semantic element of the
representation to open. If you want to open a representation on the
clicked element, you can simply use var:element as brows expression.
Then you can create a 'Navigation' operation as child of the 'Change
Context', select a diagram description to indicates the type of diagram
to open and enable or not the creation of a diagram if none exists with
the 'Create if not Existent' property.
'
>
> It will be great if someone can help me to achieve the first goal of
> opening a layer of same diagram using Sirius Viewpoint Specification
> Editor.
>
> Thanks & Regards,
> Kunal
Regards,
Maxime
[1]
http://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods
[2]
http://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#specialized
[3] https://gist.github.com/mPorhel/7873875
[4]
http://www.eclipse.org/sirius/doc/specifier/general/Model_Operations.html#navigation
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Drill Down on Double Click [message #1220201 is a reply to message #1220191] |
Tue, 10 December 2013 11:03 |
|
Le 10/12/2013 11:14, Kunal Prasad a écrit :
> Thanks Maxime for the methods to solve the problems. I was wondering if
> we can use Detail Descriptions for the same purpose, where a node
> provides a next level of presentation in the same diagram.
A Representation Creation Description [1] linked to a diagram element
mapping A will produce (regarding the precondition check) a contextual
menu entry: right click a diagram element described by the mapping A >
Navigate > New Detail : Tool Label. This menu will allow to create a new
representation on the clicked sementic element or on a semantic element
accessible from the clicked element throught the Browse Expression.
You can also look into Representation Navigation Description [2] which
allow to open existing diagrams.
>
> Can you detail how we can use the feature of 'Detail Descriptions'. I
> have tried to find ways to create a new Detail Description, but no luck
> so far :cry:
The detail description property section allows you to select
Diagram/Table/Tree Creation Description tools. These tools must first be
created in a tool section of an existing Diagram Description or in a
Table/Tree Description. Then you can link a mapping and a Representation
Creation Description from the mappin Details Descriptions property
section or from the tool Mappings property section.
> Thanks,
> Kunal
Regards,
Maxime
[1]
http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#representation_creation
[2]
http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#representation_navigation
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Drill Down on Double Click [message #1385674 is a reply to message #1220201] |
Tue, 10 June 2014 12:52 |
Wenjing Yuan Messages: 7 Registered: May 2014 |
Junior Member |
|
|
Hi Maxime,
I have tried the java service you provided above, it do works for adding a new layer to the current diagram, but I would like to remove the previous layer from the diagram, it seems not possible. I have it like this:
EList<Layer> currentLayers = diagram.getActivatedLayers();
diagram.getActivatedLayers().removeAll(currentLayers);
Is that because the DefaultLayer could not be removed or the restriction of double-click event which does not allow the element triggers the double click to be removed.
My goal is the same as described above, I need a more detailed view of one specific element after double-click while the general view should not be shown at the same time. And there needs some way to go back to the generalView in detailedView.
As shown in attachment image, The generated view should only contain "A_TopEle" and "B_TopEle", when user click A, "A_SubEles" should be seen and if B_Top is clicked, only "B_SubEles" are shown. I have thought about using different presentations or diagrams to show, but pass the targeted element could be a problem or? Could you give me some suggestions here which would be better to handle this situation?
KR,
Winny
|
|
|
Powered by
FUDForum. Page generated in 0.04003 seconds