Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Scoping in EMF generated Editor
Scoping in EMF generated Editor [message #1841268] Mon, 10 May 2021 14:05 Go to next message
Francesco Bedini is currently offline Francesco BediniFriend
Messages: 27
Registered: March 2018
Junior Member
Is there a way to filter the elements which are prepopulated in the dropdowns of a Reference? (in my case, it has a cardinality of [0, 1], if that matters)

I am having a look in the .edit project, and here looks like a good place to start working about that:
	protected void addTargetPropertyDescriptor(Object object) {
		itemPropertyDescriptors
				.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
						getResourceLocator(), getString("_UI_Connector_target_feature"),
						getString("_UI_PropertyDescriptor_description", "_UI_Connector_target_feature",
								"_UI_Connector_type"),
						myPackage.Literals.CONNECTOR__TARGET, true, false, true, null, null, null));
	}

but I don't see what I could change to only show a subset of the elements which are shown currently (from the whole model) in that "Target" dropdown.

[Updated on: Mon, 10 May 2021 14:27]

Report message to a moderator

Re: Scoping in EMF generated Editor [message #1841272 is a reply to message #1841268] Mon, 10 May 2021 15:03 Go to previous messageGo to next message
Francesco Bedini is currently offline Francesco BediniFriend
Messages: 27
Registered: March 2018
Junior Member
Nevermind, I found this answer here:
https://www.eclipse.org/forums/index.php/t/1085387

For other people bumping into this, don't forget to add
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;

to the header.
Re: Scoping in EMF generated Editor [message #1841273 is a reply to message #1841272] Mon, 10 May 2021 15:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 32985
Registered: July 2009
Senior Member
This is in the FAQ as well:

https://wiki.eclipse.org/EMF/FAQ#How_can_I_control_which_instances_are_available_as_choices_when_editing_a_property_in_the_properties_view.3F


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:ChangeRecorder cannot be found by org.eclipse.emf.edit
Next Topic:DeleteCommand on a resource
Goto Forum:
  


Current Time: Sat Nov 11 09:26:28 GMT 2023

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

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

Back to the top