Application is an editor for a non-trivial EMF model.
I've found MDirtyable that seems the "Right Way" to track dirty status
in e4.
Unfortunately MDirtyable seems to be tied to a MPart, while I would need
to tie it to a more global structure (TrimmedWindow? Application?) since
my MParts edit single facets of the whole model.
This no different to e3 - and application is considered dirty if at
least on of its part is dirty.
Tom
Am 01.06.12 11:55, schrieb Mauro Condarelli:
> Hi I'm trying to rewrite my app in pure e4.
>
> Application is an editor for a non-trivial EMF model.
> I've found MDirtyable that seems the "Right Way" to track dirty status
> in e4.
>
> Unfortunately MDirtyable seems to be tied to a MPart, while I would need
> to tie it to a more global structure (TrimmedWindow? Application?) since
> my MParts edit single facets of the whole model.
>
> Am I missing something?
> Mauro
You could get all your MParts to register for IEventBroker messages and then send ModelDirty and ModelSaved messages. Then each MPart can set or clear its own MDirtyable as needed. If you have multiple models open at the same time it might be easier to add a listener list to the model so each part registers with its own model.
On 01/06/2012 13:00, Phill Perryman wrote:
> You could get all your MParts to register for IEventBroker messages and
> then send ModelDirty and ModelSaved messages. Then each MPart can set or
> clear its own MDirtyable as needed. If you have multiple models open at
> the same time it might be easier to add a listener list to the model so
> each part registers with its own model.
Sorry,
I was not clear.
My app edits a single EMF model (singleton).
I already track dirty status in the model itself using CommandStack
status and update (manually) the Resource "Modified" status.
IMHO this is the only place where the dirty info is kept.
Should I duplicate it in all MParts?
Is there some way to get a "global" (i.e.: not connected to a single
MPart) MDirtyable?
On 01/06/2012 13:41, Mauro Condarelli wrote:
> On 01/06/2012 13:00, Phill Perryman wrote:
>> You could get all your MParts to register for IEventBroker messages and
>> then send ModelDirty and ModelSaved messages. Then each MPart can set or
>> clear its own MDirtyable as needed. If you have multiple models open at
>> the same time it might be easier to add a listener list to the model so
>> each part registers with its own model.
>
> Sorry,
> I was not clear.
>
> My app edits a single EMF model (singleton).
>
> I already track dirty status in the model itself using CommandStack
> status and update (manually) the Resource "Modified" status.
>
> IMHO this is the only place where the dirty info is kept.
>
> Should I duplicate it in all MParts?
> Is there some way to get a "global" (i.e.: not connected to a single
> MPart) MDirtyable?
>
> What is the e4-correct way to handle this?
An afterthought:
I'm using e4 MParts like I was using Views in e3, is this correct?
Should I do something different?