Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Setting dirty flag
Setting dirty flag [message #25300] Tue, 22 August 2006 07:12 Go to next message
Eclipse UserFriend
Originally posted by: zsolt.sandor.gmail.com

Hi all!

I run into an other problem. We have a property dialog box
for every graphical element, which can be selected by the user
using the right mouse button -> context menu -> item sequence.

After the user press the ok on the dialog box, the data will
be copied to the representing emf model.

Before the user opens the dialog, we set the emf model regarding
to the graphical element:

- window variable is the graphical window

NodeImpl graphicalElement = (NodeImpl) mySelectedElement.getModel();
window.setModelFilter(graphicalElement.getElement());
window.setSize(580, 480);
shell.pack();
shell.open();

However the model change does not implies the change of the
dirty flag. Can we somehow force the diagram editor to set
the dirty flag?

Thanks:

Zsolti
Re: Setting dirty flag [message #25691 is a reply to message #25300] Tue, 22 August 2006 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Zsolt,

In the generated EMF editors, the dirty flag is based on the state of
the command stack, i.e, have any commands been executed (or undone)
since the last save/load. So maybe you aren't using a command to modify
the model's state?


Zsolt Sandor wrote:
> Hi all!
>
> I run into an other problem. We have a property dialog box
> for every graphical element, which can be selected by the user using
> the right mouse button -> context menu -> item sequence.
>
> After the user press the ok on the dialog box, the data will
> be copied to the representing emf model.
>
> Before the user opens the dialog, we set the emf model regarding
> to the graphical element:
>
> - window variable is the graphical window
>
> NodeImpl graphicalElement = (NodeImpl) mySelectedElement.getModel();
> window.setModelFilter(graphicalElement.getElement());
> window.setSize(580, 480);
> shell.pack();
> shell.open();
>
> However the model change does not implies the change of the
> dirty flag. Can we somehow force the diagram editor to set
> the dirty flag?
>
> Thanks:
>
> Zsolti
>
>
Re: Setting dirty flag [message #25737 is a reply to message #25691] Tue, 22 August 2006 10:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zsolt.sandor.gmail.com

Yes, I don't use commands, because I don't need the
undo/redo support for my dialog boxes.
Re: Setting dirty flag [message #25874 is a reply to message #25737] Tue, 22 August 2006 10:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Zsolt,

Do you use the command stack at all? Changing the model without a
command will potentially invalidate the stack which relies on the fact
that all changes are done with commands and hence the model is in a
known state at the time of an undo. The solution to your problem is to
use commands to update the model state; a change recorder-based command,
like EMF's ChangeCommand, can be used to wrap your direct model changes
as a command...


Zsolt Sandor wrote:
> Yes, I don't use commands, because I don't need the
> undo/redo support for my dialog boxes.
>
>
>
Re: Setting dirty flag [message #25956 is a reply to message #25874] Tue, 22 August 2006 10:52 Go to previous message
Eclipse UserFriend
Originally posted by: zsolt.sandor.gmail.com

Ahamm.... now, I understand the concept, thanks!
Previous Topic:Re: Please Help -Using EMFT Validation in GMF
Next Topic:MindMap Tutorial
Goto Forum:
  


Current Time: Fri Apr 25 07:27:55 EDT 2025

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

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

Back to the top