Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Variable Filter
Variable Filter [message #1822291] Tue, 03 March 2020 10:20 Go to next message
Alexandra Tritean is currently offline Alexandra TriteanFriend
Messages: 20
Registered: February 2019
Junior Member
Hello,

I was trying to define a Variable Filter based on an attribute that in my case is a list of strings. But as you already know, the candidates expression requires a Collection<EObject>, so therefore I used the following code for 'converting' my list of strings to a list of EObjects.
SimpleAnyType wrapper = XMLTypeFactory.eINSTANCE.createSimpleAnyType();
wrapper.setInstanceType(EcorePackage.eINSTANCE.getEString());
wrapper.setValue(myString);

Is there another way in which this situation can be handled?

The inconvenient part of this solution is the way in which the labels are displayed, see the attached picture.
Is there a way in which I can override the LabelProvider for this specific type? More explicitly I would probably need to customize the getText method from the ReflectiveItemProvider class.

I tried to play around with the org.eclipse.emf.edit.itemProviderAdapterFactories extension, but I didn't managed to get it work. I guess I'm doing something wrong, but I'm not sure what exactly.

Thank you!

Kind Regards,

Alexandra
  • Attachment: Capture.PNG
    (Size: 11.48KB, Downloaded 37 times)
Re: Variable Filter [message #1822350 is a reply to message #1822291] Wed, 04 March 2020 15:53 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hello,

The Variable Filter allows to filter displayed elements based on a Semantic condition expression. The candidates expression is used by the Select Model Element Variable to display the list of semantic elements that can be filtered. The candidates expression is intended to return a list of semantic elements from your model.

For instance, the Variable Filter semantic condition expression will be aql:MyVariable->includes(self). The Select Model Element Variable will look like:
candidates expression: aql:self.eContents()
name: MyVariable

Regards,

Florian
Previous Topic:How to change layout programatically
Next Topic:Diagram Element Selection
Goto Forum:
  


Current Time: Fri Apr 19 10:19:44 GMT 2024

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

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

Back to the top