Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to get the right cellEditor for a referenced Feature in the properties sheet
How to get the right cellEditor for a referenced Feature in the properties sheet [message #61019] Wed, 11 October 2006 17:20 Go to next message
Eclipse UserFriend
Originally posted by: rbbnjmn.yahoo.com

I have a XNode object with a one-way reference to a Date
(a number of eInts for year, month, etc..). Since only one
graph node has this Date property I don't want to model it
in the graph.

The Date property does not appear in the property sheet for
an XNode unless I add an ItemPropertyDescriptor for it in the
NodeItemProvider. (?) why ?

So, I add an ItemPropertyDescriptor for the Date property in the
XNodeItemProvider.getPropertyDescriptors(Object) method. I see in
the debugger that I have used the correct (Date) StructuralFeature.
After this I get the property Ok, but with an empty ComboBox cell editor.
What I really need to to launch my own cell editor here.

Of course I also have a DateDataItemProvider class. I would have
expected it would have been used as the property label and cell
editor provider... but it is not. I assume I should customize this class
to provide my Date cell editor (?) for the moment its not even accessed
I think....

Any help appreciated!

Roy

code:
NodePackage nodePackage = NodeFactory.eINSTANCE.getNodePackage();
EReference feature = nodePackage.getXNode_Date();
ItemPropertyDescriptor ipd = new ItemPropertyDescriptor(adapterFactory,
"Date", "Date", feature);
itemPropertyDescriptors.add(ipd);
Re: How to get the right cellEditor for a referenced Feature in the properties sheet [message #61214 is a reply to message #61019] Thu, 12 October 2006 04:24 Go to previous messageGo to next message
Eclipse UserFriend
> The Date property does not appear in the property sheet for
> an XNode unless I add an ItemPropertyDescriptor for it in the
> NodeItemProvider. (?) why ?

Well, because this very implementation delegates to adapter factory and item
providers. You can supply different implementation (in which case it's
Platform, not GMF question ;) )

org.eclipse.emf.edit.ui.provider.ProviderDescriptor#createPr opertyEditor
might be helpful to understand why and how cell editor looks like.


Artem

"rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
news:egjn79$q1g$1@utils.eclipse.org...
>I have a XNode object with a one-way reference to a Date
> (a number of eInts for year, month, etc..). Since only one
> graph node has this Date property I don't want to model it
> in the graph.
>
> The Date property does not appear in the property sheet for
> an XNode unless I add an ItemPropertyDescriptor for it in the
> NodeItemProvider. (?) why ?
>
> So, I add an ItemPropertyDescriptor for the Date property in the
> XNodeItemProvider.getPropertyDescriptors(Object) method. I see in
> the debugger that I have used the correct (Date) StructuralFeature.
> After this I get the property Ok, but with an empty ComboBox cell editor.
> What I really need to to launch my own cell editor here.
>
> Of course I also have a DateDataItemProvider class. I would have
> expected it would have been used as the property label and cell
> editor provider... but it is not. I assume I should customize this class
> to provide my Date cell editor (?) for the moment its not even accessed
> I think....
>
> Any help appreciated!
>
> Roy
>
> code:
> NodePackage nodePackage = NodeFactory.eINSTANCE.getNodePackage();
> EReference feature = nodePackage.getXNode_Date();
> ItemPropertyDescriptor ipd = new ItemPropertyDescriptor(adapterFactory,
> "Date", "Date", feature);
> itemPropertyDescriptors.add(ipd);
>
>
>
Re: How to get the right cellEditor for a referenced Feature in the properties sheet [message #61961 is a reply to message #61214] Thu, 12 October 2006 18:37 Go to previous message
Eclipse UserFriend
Originally posted by: rbbnjmn.yahoo.com

Artem,

Thanks for the hint, I continue looking into this.... ;-)
I've post the question to the emf group.

For the moment all is still murky,

Roy

"Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
news:egktug$6od$1@utils.eclipse.org...
>> The Date property does not appear in the property sheet for
>> an XNode unless I add an ItemPropertyDescriptor for it in the
>> NodeItemProvider. (?) why ?
>
> Well, because this very implementation delegates to adapter factory and
> item providers. You can supply different implementation (in which case
> it's Platform, not GMF question ;) )
>
> org.eclipse.emf.edit.ui.provider.ProviderDescriptor#createPr opertyEditor
> might be helpful to understand why and how cell editor looks like.
>
>
> Artem
>
> "rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
> news:egjn79$q1g$1@utils.eclipse.org...
>>I have a XNode object with a one-way reference to a Date
>> (a number of eInts for year, month, etc..). Since only one
>> graph node has this Date property I don't want to model it
>> in the graph.
>>
>> The Date property does not appear in the property sheet for
>> an XNode unless I add an ItemPropertyDescriptor for it in the
>> NodeItemProvider. (?) why ?
>>
>> So, I add an ItemPropertyDescriptor for the Date property in the
>> XNodeItemProvider.getPropertyDescriptors(Object) method. I see in
>> the debugger that I have used the correct (Date) StructuralFeature.
>> After this I get the property Ok, but with an empty ComboBox cell editor.
>> What I really need to to launch my own cell editor here.
>>
>> Of course I also have a DateDataItemProvider class. I would have
>> expected it would have been used as the property label and cell
>> editor provider... but it is not. I assume I should customize this class
>> to provide my Date cell editor (?) for the moment its not even accessed
>> I think....
>>
>> Any help appreciated!
>>
>> Roy
>>
>> code:
>> NodePackage nodePackage = NodeFactory.eINSTANCE.getNodePackage();
>> EReference feature = nodePackage.getXNode_Date();
>> ItemPropertyDescriptor ipd = new ItemPropertyDescriptor(adapterFactory,
>> "Date", "Date", feature);
>> itemPropertyDescriptors.add(ipd);
>>
>>
>>
>
>
Previous Topic:TextDirectEditManager throws exception in Eclipse 3.2.1
Next Topic:Please help I need an advise how to create ebedded Label for figure ?
Goto Forum:
  


Current Time: Mon May 12 09:30:36 EDT 2025

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

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

Back to the top