|
|
|
|
|
|
|
|
Re: Reference elements from other Ecore models [message #1844981 is a reply to message #1844976] |
Fri, 01 October 2021 13:45 |
John Henbergs Messages: 239 Registered: October 2020 |
Senior Member |
|
|
Ok I have create a very simple metamodel as follows:
and after I save it, from the genmodel -> Generate All
In ModelRootItemProvider.java I modify location property by the following snippet of code:
protected void addLocationPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_ModelRoot_location_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_ModelRoot_location_feature",
"_UI_ModelRoot_type"),
MappingV1Package.Literals.MODEL_ROOT__LOCATION, true, false, true,
null, null, null)
{
@Override
public Collection<?> getChoiceOfValues(Object object)
{
List<Object> choiceOfValues = new ArrayList<Object>(super.getChoiceOfValues(object));
// Filter the choices before returning them.
return choiceOfValues;
}
});
}
I save everything and I run a new instance of Eclipse.
In the new instance of eclipse I create a test.mappingv1 model.
Right click on the root of the model -> Load Resource -> Browse from Workspace -> and I choose the metamodel city.ecore.
I try to click on the location property of ModelRoot, but now I cannot write anything myself there, but I also do not get anything else. This is a screenshot of it.
|
|
|
|
|
|
|
|
|
|
|
|
Re: Reference elements from other Ecore models [message #1848012 is a reply to message #1845042] |
Wed, 17 November 2021 12:09 |
Jan Crkvic Messages: 18 Registered: November 2021 |
Junior Member |
|
|
Hi, I am having a similar issue. I create an Ecore Modeling Project, create an EClass and then and EReference as its child. I want to make the Etype of the Ereference as EPackage. For that reason, I Load Resource -> Browse Target Platform Packages -> ahttp://www.eclipse.org/emf/2002/Ecore . After doing this I get Epackage as alternative.
When I check my .genmodel I do not have usedGenPackages and I get errors in:
ecore.impl
(EcoreFactoryImpl.java (Type mismatch: cannot convert from ecore.EObject to org.eclipse.emf.ecore.EObject) and
EObjectImpl.java (The type EObjectImpl must implement the inherited abstract method EObject.eAllContents()))
and ecore.util
(EcoreValidator.java (The method validate_EveryDefaultConstraint(org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object,java.lang.
Object>) in the type EObjectValidator is not applicable for the arguments (ecore.EObject, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map<java.lang.Object, java.lang.Object>)))
Should I use another way to load the resource?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05822 seconds