Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Re: How to override ItemProvider and use a custom table cell editor for a referenced Feature in the
Re: How to override ItemProvider and use a custom table cell editor for a referenced Feature in the [message #63552] Mon, 16 October 2006 13:13 Go to next message
Eclipse UserFriend
Originally posted by: rbbnjmn.yahoo.com

Thanks for the tips...

In my case, I'm not authoring the ecore models; in any case they
are already pretty much fixed in stone.

I'm actually using GMF. Re-posted here when it was suggested (there) that
my question
was really an EMF question. After working on this over the weekend I'm more
convinced
than ever that its a GMF question after all. I should have seen this
immediately, but as
my diagram plugin depends only on the core and edit plugins.. and I won't be
introducing
any UI component dependencies into these plugins... all work to accomplish
this must
be done in the diagram plugin code. ie. in the GMF generated code.

I supposed that the answer might be the same for the editor and diagram
plugins; but
actually I think its not! Which if true really would be a minor weakness
with repect to
reuse.

It *must* be possible to do this; so I can only keep slogging along and
debugging while
wondering if the answer will turn out to be as hard as it now seems or
something easy
I'm just overlooking,

Thanks

Roy
"Ed Merks" <merks@ca.ibm.com> wrote in message
news:egqk9l$khp$1@utils.eclipse.org...
Roy,

You'll probably want to turn off feature of this type as being a child (via
the GenFeature's properties) and turn it on as an editable property. Then
you'll want to specialize the property descriptor for such a feature to
handle turning the value into something that can be displayed as an editable
text value and can convert the editable text value into into an instance of
XDate. Perhaps you don't really want to model XDate as an EClass at all but
rather treat it as an EData which would support createFromString and
convertToString for doing the editing via some nice textual representation
of a Date. Are you sure you really need something different from a standard
XML Schema date as provided by the XMLTypePackage?



rbbnjmn wrote:
Thanks for the link Steve,

I've been following up on the nearly countless links and returns from
the search. Seems many people have had this question... but the
answers I'm seeing may drive me mad... nothing is complete, just
thought fragments and hints...

Thanks anyway,

Roy

"Steve Blass" <sblass@acm.org> wrote in message
news:egonhj$a04$1@utils.eclipse.org...

rbbnjmn wrote:

Hi,

I have an XNode object with a one-way reference to an XDate
(a number of eInts for year, month, etc..).

The XDate is optional, ie. its cardinality is 0 or 1.

I can add an XDate using addChild in the tree view, but I want to
also be able to do this from the property's cell via a custom cell editor
(implemented as a dialog).

Even so, -if- the XNode already has an XDate, the default generated
properties editor is too hard for my user's to use, after all its a Date,
not just a series of int values.

So I can override and or modify the generated XDateItemProvider...
but how? I'm really looking at what is "best practice" for a case like
this.

Does anyone know of an example they could point me too?

Any help appreciated!

Roy






Its in here somewhere, but all I can find is Ed's message with the search
URL for finding the cell editor explanation. Try starting at
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9094.html
and following the search link in that message.
Re: How to override ItemProvider and use a custom table cell editor for a referenced Feature in the [message #63575 is a reply to message #63552] Mon, 16 October 2006 15:01 Go to previous messageGo to next message
Eclipse UserFriend
It's hard to grasp what's needed. Would you like to get a dialog on
doubleclick on diagram node or just a different cell editor in the property
sheet?

Artem

"rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
news:eh0eit$d2e$1@utils.eclipse.org...
> Thanks for the tips...
>
> In my case, I'm not authoring the ecore models; in any case they
> are already pretty much fixed in stone.
>
> I'm actually using GMF. Re-posted here when it was suggested (there) that
> my question
> was really an EMF question. After working on this over the weekend I'm
> more convinced
> than ever that its a GMF question after all. I should have seen this
> immediately, but as
> my diagram plugin depends only on the core and edit plugins.. and I won't
> be introducing
> any UI component dependencies into these plugins... all work to accomplish
> this must
> be done in the diagram plugin code. ie. in the GMF generated code.
>
> I supposed that the answer might be the same for the editor and diagram
> plugins; but
> actually I think its not! Which if true really would be a minor weakness
> with repect to
> reuse.
>
> It *must* be possible to do this; so I can only keep slogging along and
> debugging while
> wondering if the answer will turn out to be as hard as it now seems or
> something easy
> I'm just overlooking,
>
> Thanks
>
> Roy
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:egqk9l$khp$1@utils.eclipse.org...
> Roy,
>
> You'll probably want to turn off feature of this type as being a child
> (via the GenFeature's properties) and turn it on as an editable property.
> Then you'll want to specialize the property descriptor for such a feature
> to handle turning the value into something that can be displayed as an
> editable text value and can convert the editable text value into into an
> instance of XDate. Perhaps you don't really want to model XDate as an
> EClass at all but rather treat it as an EData which would support
> createFromString and convertToString for doing the editing via some nice
> textual representation of a Date. Are you sure you really need something
> different from a standard XML Schema date as provided by the
> XMLTypePackage?
>
>
>
> rbbnjmn wrote:
> Thanks for the link Steve,
>
> I've been following up on the nearly countless links and returns from
> the search. Seems many people have had this question... but the
> answers I'm seeing may drive me mad... nothing is complete, just
> thought fragments and hints...
>
> Thanks anyway,
>
> Roy
>
> "Steve Blass" <sblass@acm.org> wrote in message
> news:egonhj$a04$1@utils.eclipse.org...
>
> rbbnjmn wrote:
>
> Hi,
>
> I have an XNode object with a one-way reference to an XDate
> (a number of eInts for year, month, etc..).
>
> The XDate is optional, ie. its cardinality is 0 or 1.
>
> I can add an XDate using addChild in the tree view, but I want to
> also be able to do this from the property's cell via a custom cell editor
> (implemented as a dialog).
>
> Even so, -if- the XNode already has an XDate, the default generated
> properties editor is too hard for my user's to use, after all its a Date,
> not just a series of int values.
>
> So I can override and or modify the generated XDateItemProvider...
> but how? I'm really looking at what is "best practice" for a case like
> this.
>
> Does anyone know of an example they could point me too?
>
> Any help appreciated!
>
> Roy
>
>
>
>
>
>
> Its in here somewhere, but all I can find is Ed's message with the search
> URL for finding the cell editor explanation. Try starting at
> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9094.html
> and following the search link in that message.
>
>
>
>
>
>
Re: How to override ItemProvider and use a custom table cell editor for a referenced Feature in the [message #63598 is a reply to message #63575] Mon, 16 October 2006 15:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rbbnjmn.yahoo.com

All I need is a specialized cell editor for the property editor.

Roy


"Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
news:eh0knd$qms$1@utils.eclipse.org...
> It's hard to grasp what's needed. Would you like to get a dialog on
> doubleclick on diagram node or just a different cell editor in the
> property sheet?
>
> Artem
>
> "rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
> news:eh0eit$d2e$1@utils.eclipse.org...
>> Thanks for the tips...
>>
>> In my case, I'm not authoring the ecore models; in any case they
>> are already pretty much fixed in stone.
>>
>> I'm actually using GMF. Re-posted here when it was suggested (there)
>> that my question
>> was really an EMF question. After working on this over the weekend I'm
>> more convinced
>> than ever that its a GMF question after all. I should have seen this
>> immediately, but as
>> my diagram plugin depends only on the core and edit plugins.. and I won't
>> be introducing
>> any UI component dependencies into these plugins... all work to
>> accomplish this must
>> be done in the diagram plugin code. ie. in the GMF generated code.
>>
>> I supposed that the answer might be the same for the editor and diagram
>> plugins; but
>> actually I think its not! Which if true really would be a minor weakness
>> with repect to
>> reuse.
>>
>> It *must* be possible to do this; so I can only keep slogging along and
>> debugging while
>> wondering if the answer will turn out to be as hard as it now seems or
>> something easy
>> I'm just overlooking,
>>
>> Thanks
>>
>> Roy
>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>> news:egqk9l$khp$1@utils.eclipse.org...
>> Roy,
>>
>> You'll probably want to turn off feature of this type as being a child
>> (via the GenFeature's properties) and turn it on as an editable property.
>> Then you'll want to specialize the property descriptor for such a feature
>> to handle turning the value into something that can be displayed as an
>> editable text value and can convert the editable text value into into an
>> instance of XDate. Perhaps you don't really want to model XDate as an
>> EClass at all but rather treat it as an EData which would support
>> createFromString and convertToString for doing the editing via some nice
>> textual representation of a Date. Are you sure you really need something
>> different from a standard XML Schema date as provided by the
>> XMLTypePackage?
>>
>>
>>
>> rbbnjmn wrote:
>> Thanks for the link Steve,
>>
>> I've been following up on the nearly countless links and returns from
>> the search. Seems many people have had this question... but the
>> answers I'm seeing may drive me mad... nothing is complete, just
>> thought fragments and hints...
>>
>> Thanks anyway,
>>
>> Roy
>>
>> "Steve Blass" <sblass@acm.org> wrote in message
>> news:egonhj$a04$1@utils.eclipse.org...
>>
>> rbbnjmn wrote:
>>
>> Hi,
>>
>> I have an XNode object with a one-way reference to an XDate
>> (a number of eInts for year, month, etc..).
>>
>> The XDate is optional, ie. its cardinality is 0 or 1.
>>
>> I can add an XDate using addChild in the tree view, but I want to
>> also be able to do this from the property's cell via a custom cell editor
>> (implemented as a dialog).
>>
>> Even so, -if- the XNode already has an XDate, the default generated
>> properties editor is too hard for my user's to use, after all its a Date,
>> not just a series of int values.
>>
>> So I can override and or modify the generated XDateItemProvider...
>> but how? I'm really looking at what is "best practice" for a case like
>> this.
>>
>> Does anyone know of an example they could point me too?
>>
>> Any help appreciated!
>>
>> Roy
>>
>>
>>
>>
>>
>>
>> Its in here somewhere, but all I can find is Ed's message with the search
>> URL for finding the cell editor explanation. Try starting at
>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9094.html
>> and following the search link in that message.
>>
>>
>>
>>
>>
>>
>
>
Re: How to override ItemProvider and use a custom table cell editor for a referenced Feature in the [message #63751 is a reply to message #63598] Tue, 17 October 2006 06:53 Go to previous messageGo to next message
Eclipse UserFriend
Overriding ItemProvider won't help
(o.e.e.edit.ui.provider.PropertyDescripror#createPropertyEdi tor). You need
to provide your own implementation of
o.e.ui.views.properties.IPropertyDescriptor. With GMF 1.0 start looking at
GenericEMFPropertiesProvider (and
EMFCompositePropertySource#newPropertyDescriptor); with latest M2 you may
find convenient to modify Property Section class generated for you.

Artem

"rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
news:eh0m3i$9ct$1@utils.eclipse.org...
> All I need is a specialized cell editor for the property editor.
>
> Roy
>
>
> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
> news:eh0knd$qms$1@utils.eclipse.org...
>> It's hard to grasp what's needed. Would you like to get a dialog on
>> doubleclick on diagram node or just a different cell editor in the
>> property sheet?
>>
>> Artem
>>
>> "rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
>> news:eh0eit$d2e$1@utils.eclipse.org...
>>> Thanks for the tips...
>>>
>>> In my case, I'm not authoring the ecore models; in any case they
>>> are already pretty much fixed in stone.
>>>
>>> I'm actually using GMF. Re-posted here when it was suggested (there)
>>> that my question
>>> was really an EMF question. After working on this over the weekend I'm
>>> more convinced
>>> than ever that its a GMF question after all. I should have seen this
>>> immediately, but as
>>> my diagram plugin depends only on the core and edit plugins.. and I
>>> won't be introducing
>>> any UI component dependencies into these plugins... all work to
>>> accomplish this must
>>> be done in the diagram plugin code. ie. in the GMF generated code.
>>>
>>> I supposed that the answer might be the same for the editor and diagram
>>> plugins; but
>>> actually I think its not! Which if true really would be a minor
>>> weakness with repect to
>>> reuse.
>>>
>>> It *must* be possible to do this; so I can only keep slogging along and
>>> debugging while
>>> wondering if the answer will turn out to be as hard as it now seems or
>>> something easy
>>> I'm just overlooking,
>>>
>>> Thanks
>>>
>>> Roy
>>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>>> news:egqk9l$khp$1@utils.eclipse.org...
>>> Roy,
>>>
>>> You'll probably want to turn off feature of this type as being a child
>>> (via the GenFeature's properties) and turn it on as an editable
>>> property. Then you'll want to specialize the property descriptor for
>>> such a feature to handle turning the value into something that can be
>>> displayed as an editable text value and can convert the editable text
>>> value into into an instance of XDate. Perhaps you don't really want to
>>> model XDate as an EClass at all but rather treat it as an EData which
>>> would support createFromString and convertToString for doing the editing
>>> via some nice textual representation of a Date. Are you sure you really
>>> need something different from a standard XML Schema date as provided by
>>> the XMLTypePackage?
>>>
>>>
>>>
>>> rbbnjmn wrote:
>>> Thanks for the link Steve,
>>>
>>> I've been following up on the nearly countless links and returns from
>>> the search. Seems many people have had this question... but the
>>> answers I'm seeing may drive me mad... nothing is complete, just
>>> thought fragments and hints...
>>>
>>> Thanks anyway,
>>>
>>> Roy
>>>
>>> "Steve Blass" <sblass@acm.org> wrote in message
>>> news:egonhj$a04$1@utils.eclipse.org...
>>>
>>> rbbnjmn wrote:
>>>
>>> Hi,
>>>
>>> I have an XNode object with a one-way reference to an XDate
>>> (a number of eInts for year, month, etc..).
>>>
>>> The XDate is optional, ie. its cardinality is 0 or 1.
>>>
>>> I can add an XDate using addChild in the tree view, but I want to
>>> also be able to do this from the property's cell via a custom cell
>>> editor
>>> (implemented as a dialog).
>>>
>>> Even so, -if- the XNode already has an XDate, the default generated
>>> properties editor is too hard for my user's to use, after all its a
>>> Date,
>>> not just a series of int values.
>>>
>>> So I can override and or modify the generated XDateItemProvider...
>>> but how? I'm really looking at what is "best practice" for a case like
>>> this.
>>>
>>> Does anyone know of an example they could point me too?
>>>
>>> Any help appreciated!
>>>
>>> Roy
>>>
>>>
>>>
>>>
>>>
>>>
>>> Its in here somewhere, but all I can find is Ed's message with the
>>> search
>>> URL for finding the cell editor explanation. Try starting at
>>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9094.html
>>> and following the search link in that message.
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
Re: How to override ItemProvider and use a custom table cell editor for a referenced Feature in the [message #73605 is a reply to message #63751] Thu, 02 November 2006 17:17 Go to previous message
Eclipse UserFriend
Originally posted by: rbbnjmn.yahoo.com

Now that I've got about four weeks of work into this I figure I can ask
again
for some more help. I've read everything on the eclipse site, and debugged
and
stepped through each and every line of EMF and still see no way to do this.

The ultimate problem is that createPropertyEditor(Composite) from
org.eclipse.emf.edit.ui.provider.PropertyDescriptor is always called. Thats
it.

My property descriptors are buried down under the instance and their
methods for creating a cell editor are not called.


I have an emf object that essentially holds on to a reference to an alien
non-emf object. That object can provide an array of standard:
java.beans.PropertyDescriptor(s) that are 'converted' using my class:

public class BeanBridgePropertyDescriptor extends
EMFCompositeSourcePropertyDescriptor implements
IItemPropertyDescriptor.

So my xxxxItemProvider's List getPropertyDescriptors(Object object) method
returns
a list where BeanBridgePropertyDescriptor(s) have been added. The problem
is that
these are in turn again wrapped inside of
org.eclipse.emf.edit.ui.provider.PropertyDescriptor!
It's lame createPropertyEditor() method is then always called.

There must be some way out of this. There is a rats-nest of links in the
eclipse news all pointing to each other and referencing the fact that this
question has been answered many times. But the answer cannot be found.

Can someone please re-post the actual answer one more time for this poor
laim newcomer?

Thanks!

Roy


"Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
news:eh2cg4$jbh$1@utils.eclipse.org...
> Overriding ItemProvider won't help
> (o.e.e.edit.ui.provider.PropertyDescripror#createPropertyEdi tor). You need
> to provide your own implementation of
> o.e.ui.views.properties.IPropertyDescriptor. With GMF 1.0 start looking at
> GenericEMFPropertiesProvider (and
> EMFCompositePropertySource#newPropertyDescriptor); with latest M2 you may
> find convenient to modify Property Section class generated for you.
>
> Artem
>
> "rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
> news:eh0m3i$9ct$1@utils.eclipse.org...
>> All I need is a specialized cell editor for the property editor.
>>
>> Roy
>>
>>
>> "Artem Tikhomirov" <artem.tikhomirov@borland.com> wrote in message
>> news:eh0knd$qms$1@utils.eclipse.org...
>>> It's hard to grasp what's needed. Would you like to get a dialog on
>>> doubleclick on diagram node or just a different cell editor in the
>>> property sheet?
>>>
>>> Artem
>>>
>>> "rbbnjmn" <rbbnjmn@yahoo.com> wrote in message
>>> news:eh0eit$d2e$1@utils.eclipse.org...
>>>> Thanks for the tips...
>>>>
>>>> In my case, I'm not authoring the ecore models; in any case they
>>>> are already pretty much fixed in stone.
>>>>
>>>> I'm actually using GMF. Re-posted here when it was suggested (there)
>>>> that my question
>>>> was really an EMF question. After working on this over the weekend I'm
>>>> more convinced
>>>> than ever that its a GMF question after all. I should have seen this
>>>> immediately, but as
>>>> my diagram plugin depends only on the core and edit plugins.. and I
>>>> won't be introducing
>>>> any UI component dependencies into these plugins... all work to
>>>> accomplish this must
>>>> be done in the diagram plugin code. ie. in the GMF generated code.
>>>>
>>>> I supposed that the answer might be the same for the editor and diagram
>>>> plugins; but
>>>> actually I think its not! Which if true really would be a minor
>>>> weakness with repect to
>>>> reuse.
>>>>
>>>> It *must* be possible to do this; so I can only keep slogging along and
>>>> debugging while
>>>> wondering if the answer will turn out to be as hard as it now seems or
>>>> something easy
>>>> I'm just overlooking,
>>>>
>>>> Thanks
>>>>
>>>> Roy
>>>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>>>> news:egqk9l$khp$1@utils.eclipse.org...
>>>> Roy,
>>>>
>>>> You'll probably want to turn off feature of this type as being a child
>>>> (via the GenFeature's properties) and turn it on as an editable
>>>> property. Then you'll want to specialize the property descriptor for
>>>> such a feature to handle turning the value into something that can be
>>>> displayed as an editable text value and can convert the editable text
>>>> value into into an instance of XDate. Perhaps you don't really want to
>>>> model XDate as an EClass at all but rather treat it as an EData which
>>>> would support createFromString and convertToString for doing the
>>>> editing via some nice textual representation of a Date. Are you sure
>>>> you really need something different from a standard XML Schema date as
>>>> provided by the XMLTypePackage?
>>>>
>>>>
>>>>
>>>> rbbnjmn wrote:
>>>> Thanks for the link Steve,
>>>>
>>>> I've been following up on the nearly countless links and returns from
>>>> the search. Seems many people have had this question... but the
>>>> answers I'm seeing may drive me mad... nothing is complete, just
>>>> thought fragments and hints...
>>>>
>>>> Thanks anyway,
>>>>
>>>> Roy
>>>>
>>>> "Steve Blass" <sblass@acm.org> wrote in message
>>>> news:egonhj$a04$1@utils.eclipse.org...
>>>>
>>>> rbbnjmn wrote:
>>>>
>>>> Hi,
>>>>
>>>> I have an XNode object with a one-way reference to an XDate
>>>> (a number of eInts for year, month, etc..).
>>>>
>>>> The XDate is optional, ie. its cardinality is 0 or 1.
>>>>
>>>> I can add an XDate using addChild in the tree view, but I want to
>>>> also be able to do this from the property's cell via a custom cell
>>>> editor
>>>> (implemented as a dialog).
>>>>
>>>> Even so, -if- the XNode already has an XDate, the default generated
>>>> properties editor is too hard for my user's to use, after all its a
>>>> Date,
>>>> not just a series of int values.
>>>>
>>>> So I can override and or modify the generated XDateItemProvider...
>>>> but how? I'm really looking at what is "best practice" for a case like
>>>> this.
>>>>
>>>> Does anyone know of an example they could point me too?
>>>>
>>>> Any help appreciated!
>>>>
>>>> Roy
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Its in here somewhere, but all I can find is Ed's message with the
>>>> search
>>>> URL for finding the cell editor explanation. Try starting at
>>>> http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 9094.html
>>>> and following the search link in that message.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Previous Topic:lack of semantic properties in Properties view (GMF 1.0.1 and 2.0M2)
Next Topic:Custom action in generated editor
Goto Forum:
  


Current Time: Tue Apr 29 00:07:50 EDT 2025

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

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

Back to the top