How to check if my object state has changed ? [message #1253585] |
Sat, 22 February 2014 07:33  |
Eclipse User |
|
|
|
So far I'm using the following code to check if my objects where changed:
EContentAdapter adapter = new EContentAdapter() {
@Override
public void notifyChanged(Notification notification) {
super.notifyChanged(notification);
eventBroker.post(CommonEvents.TOPIC_MODEL_IS_DIRTY, Boolean.TRUE);
}
};
But this is not a real solution. If the users types two character and deletes this two characters (i'm using EMF databinding) I would like to get the info that my model is not dirty anymore. Is this possible ?
[Updated on: Sat, 22 February 2014 07:38] by Moderator
|
|
|
|
|
|
|
|
Re: How to check if a model is changed ? [message #1256309 is a reply to message #1256251] |
Tue, 25 February 2014 04:48  |
Eclipse User |
|
|
|
Felix,
Yes, the change recorder effectively remembers the original state as
state changes arrive and then at the end effectively compares the final
state to the original state to compute a description of any actual
deltas. So it is not just an event recorder...
On 25/02/2014 9:42 AM, Felix Dorner wrote:
> On 25/02/2014 05:58, Ed Merks wrote:
>> A ChangeRecorder is much like a content adapter and it's purpose is to
>> detect real value changes between the start point and the end point. But
>> as others have pointed out, in an editor (or anywhere that undo support
>> is needed), a command stack is very effective.
>
> Oh, I thought a changerecorder would not be that clever. I thought it
> simply accumulates notifications. You say it computes a "total delta"?
> I know there's a whole chapter in the book about it, so maybe I'll
> look at it again sometime.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds