Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:37 Go to next message
Gemma Bowers is currently offline Gemma BowersFriend
Messages: 13
Registered: July 2009
Junior Member
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 15:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: AdapterFactoryTreeEditor or IUpdateableItemText not notifying editor of chan [message #417490 is a reply to message #417476] Thu, 13 March 2008 08:48 Go to previous messageGo to next message
Gemma Bowers is currently offline Gemma BowersFriend
Messages: 13
Registered: July 2009
Junior Member
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 12:26 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:IUpdateableItemText with Trees and columns
Next Topic:EMF and dev.eclipse.org
Goto Forum:
  


Current Time: Sat Apr 27 00:10:51 GMT 2024

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

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

Back to the top