how to show List in a property view [message #228840] |
Tue, 05 May 2009 05:19  |
Eclipse User |
|
|
|
Hi,
I am trying to build an application in which there is an EClass which has
an EReference to itself. For e.g.
Fruit(EClass)
|--->name(EAttribute)(EType is EString)
|--->otherFruits(EReference) (and its EType is Fruit)
Basically what I want is when i drop a node FRUIT on GMF Editor, then its
OTHERFRUITS property should show list of other FRUIT nodes already
present. But when i am implementing it actually, only NAME property is
coming up in properties view not OTHERFRUITS property. What shall I do?
Please help me.
Thanks,
Akansha
|
|
|
|
|
|
|
|
|
Re: how to show List in a property view [message #229153 is a reply to message #229145] |
Thu, 07 May 2009 07:35   |
Eclipse User |
|
|
|
Originally posted by: tobk42.gmx.de
Another Idea: In your .edit plugin, you can change the method
addTypePropertyDescriptor of class OperationItemProvider and overwrite
the method getComboBoxObjects of the created ItemPropertyDescriptor. I
am not sure how exactly to do this, but this way you could add all the
Type elements to the list, as well as a number of fixed types --
however, this way the attribute Operation.type would have to be of type
String or Object...
Hope this helps,
Tobias
Tobias schrieb:
> Hello Akansha,
>
> again I am not sure whether I understood you correctly. What you want is
> that for that attribute Operation.type both all instances of Type
> (including TypeA etc.) are displayed, /and/ the literals of that
> enumeration, right?
>
> What exactly do you want to achieve? Shall the enums be predefined
> values for types (like primitive types in Java as opposed to Java
> classes)? I don't think this is possible this way. Maybe you could
> create a number of Type instances on diagram creation, representing the
> values of the enumeration using a fifth Type type which has no graphical
> representation in the diagram.
>
> Regards,
> Tobias
>
>
> Akansha schrieb:
>> Actually structure of my ecore file was different but i modified it
>> according to what you mentioned and its showing up in list now. But
>> one more problem is there, apart from EClasses i have EEnum
>> (containing EENum Literals) also which i want to show in that list. So
>> what i did is created an EClass and added one EAttribute in it with
>> its Etype referring to EENum and set its super type as TYPE. But the
>> property list is not showing the EEnum literals. Where i am wrong ?
>>
|
|
|
|
Re: how to show List in a property view [message #229184 is a reply to message #229161] |
Thu, 07 May 2009 09:23   |
Eclipse User |
|
|
|
Originally posted by: tobk42.gmx.de
I think you should have a look at how this was realized in the EMF ecore
editor, since there you have exactly the same functionality: A dropdown
list featuring a number of predefined classes (such as EObject, EEList,
EJavaObject, ...) and your own classes. I think, they are using Strings
as representation for these, and not references to the actual objects.
Maybe you can build upon this...
Tobias
Akansha schrieb:
> Hi,
> You understood me correctly. What I want is that for attribute
> Operation.type both all instances of Type (including TypeA etc.) are
> displayed and the predefined literals of that enumeration. For better
> understanding you can consider that java primitive types constitute Enum
> literals and Java classes are other Types (TypeA, TypeB,etc). So what i
> want is the display of Java classes as well as primitive java types in
> the list.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.46167 seconds