|
|
Re: Definition and data editor [message #894453 is a reply to message #894222] |
Mon, 09 July 2012 09:40 |
John M. Messages: 198 Registered: July 2010 |
Senior Member |
|
|
Thanks so far, I have generated the base model with the help of the map.
My definition model looks like the following:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="container"
nsURI="com.test.container" nsPrefix="container">
<eClassifiers xsi:type="ecore:EClass" name="StringToInteger" instanceClassName="java.util.Map$Entry">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="key" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="data">
<eStructuralFeatures xsi:type="ecore:EReference" name="definition" upperBound="-1"
eType="#//StringToInteger" containment="true"/>
</eClassifiers>
</ecore:EPackage>
But how can I connect it with my data editor?
In that case the integer value tells the validator the length of the data input. Furthermore the definition model contains possible keys.
EDIT:
My first approach to connect the keys is to reference from the second Map on the first map, but using StringToInteger as EType and key:EString as EKeys doesn't work.
[Updated on: Mon, 09 July 2012 09:57] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Definition and data editor [message #897475 is a reply to message #897467] |
Tue, 24 July 2012 09:00 |
Ed Merks Messages: 33133 Registered: July 2009 |
Senior Member |
|
|
Comments below.
On 24/07/2012 10:30 AM, Missing name Mising name wrote:
> I tried to explain it in my first post
> (http://www.eclipse.org/forums/index.php/mv/msg/367048/894222/#msg_894222).
> I am searching for a good way to model and implement a definition and
> data editor.
It's a very long thread...
>
> Definition editor shall give the possibility to create a structure of
> attributes with constraints values.
> Data editor shall use the structure of attributes to store them and
> check them against the constraints values.
>
> The definition model was realized very fast and with your hints, I
> know the way how to handle constraints and so on.
> But I want to model and implement the data editor now.
>
> The idea was to create a data model, which loads the definition model
> and I "copy" the structure of the definition.
> After that I change the types (of the constraints values) to the
> needed one (of the data values) and add the needed constraints
> annotation.
Try it.
>
> Perhaps there is a better way.
I don't have the time to fully understand your design.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03465 seconds