Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Conditional style in tree description
Conditional style in tree description [message #1805151] Mon, 08 April 2019 13:32 Go to next message
Aurélien Pinsonneau is currently offline Aurélien PinsonneauFriend
Messages: 4
Registered: April 2019
Junior Member
Hello,

I am trying to create a new tree view based on sirius tree description.
So far I have successfully been able to define the content of the tree, and to define some drag & drop tools.

However, I do not achieve to apply conditional style on the tree.

I have declared a conditional style under a tree element.
In order to know if the conditional style has to be applied, I need to get the DTreeItem in order to know where the semantic element is represented in the tree.

The predicate expression I use is: "<% $view.isMissingFromInterfaces() %>" and I have defined the associated Java function:
public boolean isMissingFromInterfaces (DTreeItem item) { ... }

The result is that my Java function is never called...
It seems like the variable "view" is use is not recognized.

Any idea?
Re: Conditional style in tree description [message #1805170 is a reply to message #1805151] Tue, 09 April 2019 08:01 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 228
Registered: August 2010
Senior Member
Hello,

Have you tried "var:" with ctrl+space for auto-completion to see available variables? The var interpreter is an optimized interpreter for quick access to variable. The view variable should be available for in predicate expression.
I see that you use an Acceleo2 expression (query legacy). Have you tried with an AQL expression?

Regards,

Florian
Re: Conditional style in tree description [message #1805172 is a reply to message #1805170] Tue, 09 April 2019 08:44 Go to previous messageGo to next message
Aurélien Pinsonneau is currently offline Aurélien PinsonneauFriend
Messages: 4
Registered: April 2019
Junior Member
Hello Florian,

Thank you for your quick answer.
I am not familiar with AQL expression. Could you help me translate my expression in AQL ?

BTW, when using var + auto-completion, the variable "view" is indeed listed...
Re: Conditional style in tree description [message #1805174 is a reply to message #1805172] Tue, 09 April 2019 09:16 Go to previous messageGo to next message
Aurélien Pinsonneau is currently offline Aurélien PinsonneauFriend
Messages: 4
Registered: April 2019
Junior Member
Moreover, when I check the variables available from the field "Label Expression" of the style itself, I have:
- self
- diagram: [diagram.DSemanticDiagram]
- view: [diagram.DDiagramElement]
(either from info help or from auto-completion)

Isn't there an issue in the definition of the variables?
I am defining a tree and not a diagram!
Re: Conditional style in tree description [message #1805176 is a reply to message #1805174] Tue, 09 April 2019 09:32 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 228
Registered: August 2010
Senior Member
About the label expression, that sounds as a bug. The problem could be a wrong auto-completion documentation. In that case, it would be interesting to see with a Java service the real type of the "view" variable for instance.

About AQL expression, you can define them by using the aql: interpreter. Your expression will be "aql:view.isMissingFromInterfaces()".
You can find documentation about AQL expressions in this page[1] and a detailed documentation here[2].

Regards,
Florian

[1] https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#aql
[2] https://www.eclipse.org/acceleo/documentation/aql.html
Re: Conditional style in tree description [message #1805177 is a reply to message #1805176] Tue, 09 April 2019 09:40 Go to previous messageGo to next message
Aurélien Pinsonneau is currently offline Aurélien PinsonneauFriend
Messages: 4
Registered: April 2019
Junior Member
I have tried the aql expression. The result is the same (the java service is not called).

How could I check if there is an error in the definition of the auto-completion documentation?
How to use this Java service you are talking about?
Re: Conditional style in tree description [message #1805224 is a reply to message #1805177] Wed, 10 April 2019 08:59 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 228
Registered: August 2010
Senior Member
I have done a debug session and the only available variable is "self" (so the semantic element in that case). The "view" is available in the context of a diagramDescription but not in a treeDescription. That's a bug. Do not hesitate to raise a bugzilla about this issue[1]
About your initial need, conditional style are designed to be applied on the semantic model but not really to depend on the graphical state.

Regards,
Florian

[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius
Previous Topic:Element Creation Tool doesn't work
Next Topic:Use a List of eObject in a table
Goto Forum:
  


Current Time: Mon Nov 18 15:07:12 GMT 2019

Powered by FUDForum. Page generated in 0.01670 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top