Skip to main content



      Home
Home » Modeling » EMF » Scoping in EMF generated Editor
Scoping in EMF generated Editor [message #1841268] Mon, 10 May 2021 10:05 Go to next message
Eclipse UserFriend
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 10:27] by Moderator

Re: Scoping in EMF generated Editor [message #1841272 is a reply to message #1841268] Mon, 10 May 2021 11:03 Go to previous messageGo to next message
Eclipse UserFriend
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 11:27 Go to previous message
Eclipse UserFriend
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
Previous Topic:ChangeRecorder cannot be found by org.eclipse.emf.edit
Next Topic:DeleteCommand on a resource
Goto Forum:
  


Current Time: Fri Nov 07 11:52:14 EST 2025

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

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

Back to the top