Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF.Edit Commands, UI updated challenge.
EMF.Edit Commands, UI updated challenge. [message #468071] Mon, 03 August 2009 22:07 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi There,

I am really stuck with this one. Sofar I have been succesfully using the
Command Framework. The 'CreateChildCommand.create(...)' works well and
the UI gets updated very nicely.

Now further on, I have this feature of EDataType which is basically a
EList<String>. which is edited by a text editor, in a separate workbench
editor. (Customized text editor to work with this feature only).

I can't use 'CreateChildCommand.create(...)' to update this datatype, so
I use the 'SetCommand.create(...)', the command executes correctly, I
verify the new List is indeed correct. ( I use the EditingDomain from
the EMF Editor).

Now when I switch to the EMF Editor and look in my propertyView of the
EMF Editor, the value hasn't updated. (It hasn't updated in any of the
views i.e Outline or any of the table, tree etc... viewers).

I do see a notification is received in the item provider, I also see the
EMF Editor is marked dirty (So it was notified). Interrestingly, when I
save the model, my changes which are reported changed correctly in the
model, are not reflected in the file on disc).


So to troubleshoot, I would need to know.
- Is it needed to explicitly notify the views when working on the model
with Commands from another editor? (Wouldn't the views refresh/update
when becoming visible?).
- How can it be that a command executes correctly, but then when saving
with the Editor save command, the command changes are not actually
saved, but the old value is?

I am really puzzled by this one, can anyone help?
thank you
Christophe Bouhier
Re: EMF.Edit Commands, UI updated challenge. [message #468142 is a reply to message #468071] Tue, 04 August 2009 10:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Christophe,

Comments below.

Christophe Bouhier wrote:
> Hi There,
>
> I am really stuck with this one. Sofar I have been succesfully using
> the Command Framework. The 'CreateChildCommand.create(...)' works well
> and the UI gets updated very nicely.
>
> Now further on, I have this feature of EDataType which is basically a
> EList<String>. which is edited by a text editor, in a separate
> workbench editor. (Customized text editor to work with this feature
> only).
>
> I can't use 'CreateChildCommand.create(...)' to update this datatype,
> so I use the 'SetCommand.create(...)', the command executes correctly,
> I verify the new List is indeed correct. ( I use the EditingDomain
> from the EMF Editor).
>
> Now when I switch to the EMF Editor and look in my propertyView of the
> EMF Editor, the value hasn't updated. (It hasn't updated in any of the
> views i.e Outline or any of the table, tree etc... viewers).
>
> I do see a notification is received in the item provider, I also see
> the EMF Editor is marked dirty (So it was notified). Interrestingly,
> when I save the model, my changes which are reported changed correctly
> in the model, are not reflected in the file on disc).
That makes it sound like the model isn't really changed to the value you
are expecting. When debugging, can you actually see the new value has
been set properly?
>
>
> So to troubleshoot, I would need to know.
> - Is it needed to explicitly notify the views when working on the
> model with Commands from another editor? (Wouldn't the views
> refresh/update when becoming visible?).
Is the item provider's notifyChanged method calling fireNotifyChanged
for the notification it's getting?
> - How can it be that a command executes correctly,
I'm doubting that the value has been set the way you expect.
> but then when saving with the Editor save command, the command changes
> are not actually saved, but the old value is?
That's basically not possible unless the value wasn't set at all or was
set again as a result of something else. Setting a breakpoint in the
setter method should help track what's actually being set...
>
> I am really puzzled by this one, can anyone help?
> thank you
> Christophe Bouhier


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF.Edit Commands, UI updated challenge. [message #468459 is a reply to message #468142] Wed, 05 August 2009 15:16 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Ed,

I came to the same conclusion, that whatever I was doing was not on the
correct resource, so took a step back and realized both editors were
using a different Resource for the same URI, resulting the effects I
described.

sorry to have bothered you with this, now I crawl back under my rock 8-(
Christophe


Ed Merks wrote:



> Christophe,
>
> Comments below.
>
> Christophe Bouhier wrote:
>> Hi There,
>>
>> I am really stuck with this one. Sofar I have been succesfully using
>> the Command Framework. The 'CreateChildCommand.create(...)' works well
>> and the UI gets updated very nicely.
>>
>> Now further on, I have this feature of EDataType which is basically a
>> EList<String>. which is edited by a text editor, in a separate
>> workbench editor. (Customized text editor to work with this feature
>> only).
>>
>> I can't use 'CreateChildCommand.create(...)' to update this datatype,
>> so I use the 'SetCommand.create(...)', the command executes correctly,
>> I verify the new List is indeed correct. ( I use the EditingDomain
>> from the EMF Editor).
>>
>> Now when I switch to the EMF Editor and look in my propertyView of the
>> EMF Editor, the value hasn't updated. (It hasn't updated in any of the
>> views i.e Outline or any of the table, tree etc... viewers).
>>
>> I do see a notification is received in the item provider, I also see
>> the EMF Editor is marked dirty (So it was notified). Interrestingly,
>> when I save the model, my changes which are reported changed correctly
>> in the model, are not reflected in the file on disc).
> That makes it sound like the model isn't really changed to the value you
> are expecting. When debugging, can you actually see the new value has
> been set properly?
>>
>>
>> So to troubleshoot, I would need to know.
>> - Is it needed to explicitly notify the views when working on the
>> model with Commands from another editor? (Wouldn't the views
>> refresh/update when becoming visible?).
> Is the item provider's notifyChanged method calling fireNotifyChanged
> for the notification it's getting?
>> - How can it be that a command executes correctly,
> I'm doubting that the value has been set the way you expect.
>> but then when saving with the Editor save command, the command changes
>> are not actually saved, but the old value is?
> That's basically not possible unless the value wasn't set at all or was
> set again as a result of something else. Setting a breakpoint in the
> setter method should help track what's actually being set...
>>
>> I am really puzzled by this one, can anyone help?
>> thank you
>> Christophe Bouhier
Previous Topic:Dynamically Loading EMF Metamodels
Next Topic:Re: Metamodeling
Goto Forum:
  


Current Time: Thu Apr 25 10:07:22 GMT 2024

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

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

Back to the top