Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Filter TreeMasterDetail for predefined Elements
[EMF Forms] Filter TreeMasterDetail for predefined Elements [message #1744503] Tue, 27 September 2016 13:55 Go to next message
Kristof Zalecki is currently offline Kristof ZaleckiFriend
Messages: 23
Registered: October 2013
Junior Member
Hi everyone,

I am fairly new to EMF Forms and am currently trying to extend the GenericEditor for my needs.
More precicely I am trying to alter the TreeMasterDetail by extending it with a filter, that would enable it
to filter for a certain class from a loaded domain model, which would then be the only type of element shown in the Navigation Tree. The filter
itself could - in a later state of development - be controled with a combobox.

For simplicity this could mean only showing one certain branch of my domain model, which would only contain this one type of element and filtering by
some kind of predefined pattern from the domain model or directly by the type of the class.


My question would be: Is there a way to implement such a filter or even a better way of handling this?

Regards,
Kristof
Re: [EMF Forms] Filter TreeMasterDetail for predefined Elements [message #1744635 is a reply to message #1744503] Thu, 29 September 2016 07:45 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 174
Registered: May 2015
Senior Member
Hi Kristof,
so if I understand you correctly, you want to have a tree, but only show elements on it which are of a specific type?
what if those elements are on a "deeper" level? should the parent nodes be visible or not?

I think the easiest approach would be to change the content provider of the tree as this is the class which manages the shown elements.
In order to replace the content provider you will need to override the org.eclipse.emfforms.spi.editor.GenericEditor.createTreeMasterDetail(Composite, Object, CreateElementCallback) method, copy the current code and on the TreeMasterDetailFactory add a .customizeContentProvider(contentProvider) where you pass in your content provider which will do the filtering.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Filter TreeMasterDetail for predefined Elements [message #1744638 is a reply to message #1744635] Thu, 29 September 2016 08:07 Go to previous message
Kristof Zalecki is currently offline Kristof ZaleckiFriend
Messages: 23
Registered: October 2013
Junior Member
Hi Eugen,

thanks for the quick reply.
This sounds exactly like what I was looking for. I know this could lead to some trouble showing elements in deeper parts of the tree but my idea was to counter this issue by creating an entry in the context menu which would have a predefined path to save the new elements to.
I will let you know if it worked.

Regards,
Kristof
Previous Topic:Performance issue after EMF complex tree creation?
Next Topic:Collect proxies from Resource
Goto Forum:
  


Current Time: Thu Apr 25 12:24:00 GMT 2024

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

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

Back to the top