Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » MDirtyable usage
MDirtyable usage [message #880029] Fri, 01 June 2012 09:55 Go to next message
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 423
Registered: September 2009
Senior Member
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
Re: MDirtyable usage [message #880038 is a reply to message #880029] Fri, 01 June 2012 10:14 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5351
Registered: July 2009
Senior Member
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
Re: MDirtyable usage [message #880066 is a reply to message #880038] Fri, 01 June 2012 11:00 Go to previous messageGo to next message
Phill Perryman is currently offline Phill Perryman
Messages: 214
Registered: July 2009
Senior Member
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.
Re: MDirtyable usage [message #880083 is a reply to message #880066] Fri, 01 June 2012 11:41 Go to previous messageGo to next message
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 423
Registered: September 2009
Senior Member
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?
Re: MDirtyable usage [message #880085 is a reply to message #880083] Fri, 01 June 2012 11:49 Go to previous message
Mauro Condarelli is currently offline Mauro Condarelli
Messages: 423
Registered: September 2009
Senior Member
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?
Previous Topic:Keyboard Events
Next Topic:Binding Contexts and Binding Tables
Goto Forum:
  


Current Time: Thu Oct 02 12:38:16 GMT 2014

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

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