Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Filter variable filter
Filter variable filter [message #1821144] Thu, 06 February 2020 10:23 Go to next message
Michael C is currently offline Michael CFriend
Messages: 40
Registered: April 2019
Member
Hello,

I have a diagram that have as the diagram.target an element that can have an infinite number of sub elements.
I can create the diagram from any of these sub elements.
I'm trying to implement a variable filter to hide the subs elements of the diagram. The user should be able to enter the level of elements that have to be hidden. The level 0 is the level of the element (they are nodes) on the diagram and not in the whole model.

So I need to to access diagram.target in the semantic condition expression of the variable filter to subtract the level in the model to the level in the diagram.

Also, in an other diagram I would like to hide with the level of a container view, is there a variable to get the view of the element in the semantic condition expression of the variable filter ?

Thanks
Re: Filter variable filter [message #1821294 is a reply to message #1821144] Mon, 10 February 2020 14:13 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 493
Registered: May 2011
Senior Member
Hello,

Concerning the first question about having the user enter a level beyond which the element will be filtered, you can add to your "variable filter" a sub element "typed variable" [1]. This will display a pop up dialog where the user can enter the wanted level.

For the second question, as the filter works on semantic element, I do not think that we have a variables on graphical elements as this functionality was intended to be applied on a the currently selected element but the whole diagram. However, you can call a java service from the diagram and compute the result after accessing the diagram selection with ((org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl)EclipseUIUtil.getActiveEditor()).getDiagramEditPart().getViewer().getSelection().

Best regards,
Steve

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#filter_with_typed_variable


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Filter variable filter [message #1821448 is a reply to message #1821294] Thu, 13 February 2020 08:55 Go to previous message
Michael C is currently offline Michael CFriend
Messages: 40
Registered: April 2019
Member
Hi Steve,

About 1, I saw the pop up thing but needed to filter with the level of containment starting from the element that initialized the diagram and not the semantic level.
For example if the user enter 1 and the diagram is initialized with a sub element of semantic depth 3, it should filter all the sub elements of semantic depth 4.
Since the elements that are of semantic depth 1,2,3(except the element that initialized the diagram) will not be shown.

So the java service will solve both my issues, and I'm sure it will be useful for other situations,

Thanks you very much.
Previous Topic:Svg background color
Next Topic:Decoration Tooltip not showing, error or bug ?
Goto Forum:
  


Current Time: Thu Dec 03 21:01:21 GMT 2020

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

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

Back to the top