Skip to main content



      Home
Home » Modeling » EMF » AdapterFactoryTreeEditor or IUpdateableItemText not notifying editor of change
AdapterFactoryTreeEditor or IUpdateableItemText not notifying editor of change [message #417475] Wed, 12 March 2008 10:37 Go to next message
Eclipse UserFriend
I'm trying to use the AdapterFactoryTreeEditor to change the names of
items in my tree.

I've got as far as implementing the IUpdateableItemText in my ItemProvider
(together with adding IUpdateableItemText to the supportedTypes in my
ItemProviderAdapterFactory).

Whilst I can now edit the names in the tree, the editor doesn't seem to be
notified of any change, so the save menu item isn't enabled (the save As
menu item is enabled however).

Does anyone know if there's something else I need to add/change?
Re: AdapterFactoryTreeEditor or IUpdateableItemText not notifying editor of change [message #417476 is a reply to message #417475] Wed, 12 March 2008 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Gemma,

Are you using a command and executing it on the command stack to apply
the change? That's very important and it sounds like you've applied the
change directly to the model without doing that...


Gemma Bowers wrote:
> I'm trying to use the AdapterFactoryTreeEditor to change the names of
> items in my tree.
> I've got as far as implementing the IUpdateableItemText in my
> ItemProvider (together with adding IUpdateableItemText to the
> supportedTypes in my ItemProviderAdapterFactory).
> Whilst I can now edit the names in the tree, the editor doesn't seem
> to be notified of any change, so the save menu item isn't enabled (the
> save As menu item is enabled however).
>
> Does anyone know if there's something else I need to add/change?
>
Re: AdapterFactoryTreeEditor or IUpdateableItemText not notifying editor of chan [message #417490 is a reply to message #417476] Thu, 13 March 2008 04:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

After some further investigation I think I might have found the problem.
Previously in my setText method (in my ItemProvider) I was doing something
like:
public void setText(Object object, String text) {
object.setName(text);
}
whereas I've now changed it to:
public void setText(Object object, String text) {
setPropertyValue(object, "Name", text);
}
Am I right in that by doing this I'm triggering the necessary command you
mentioned?
Re: AdapterFactoryTreeEditor or IUpdateableItemText not notifying editor of chan [message #417499 is a reply to message #417490] Thu, 13 March 2008 08:26 Go to previous message
Eclipse UserFriend
Gemma,

Yes, if you are going through a property descriptor's implementation, it
should properly construct a command and execute it.


Gemma Bowers wrote:
> Hi Ed,
>
> After some further investigation I think I might have found the problem.
> Previously in my setText method (in my ItemProvider) I was doing
> something like:
> public void setText(Object object, String text) {
> object.setName(text);
> }
> whereas I've now changed it to:
> public void setText(Object object, String text) {
> setPropertyValue(object, "Name", text);
> }
> Am I right in that by doing this I'm triggering the necessary command
> you mentioned?
>
Previous Topic:IUpdateableItemText with Trees and columns
Next Topic:EMF and dev.eclipse.org
Goto Forum:
  


Current Time: Mon Jul 07 10:03:13 EDT 2025

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

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

Back to the top