Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to reflect model state in a custom view after Undo
How to reflect model state in a custom view after Undo [message #207169] Wed, 11 January 2006 16:37 Go to next message
Neil Sanderson is currently offline Neil SandersonFriend
Messages: 3
Registered: July 2009
Junior Member
Hello,

I wonder if anyone can help me understand how views reflect the state of a
model after an Undo command has been issued. I have built a GEF editor
with undoable/redoable GEF commands to edit my model. I use both the
standard Properties view and Outline view to support my editor. Using gef
commands and the command stack of my editor I can change properties of the
elements in my model through the properties view and my gef Figures are
updated appropriately. Also when I undo one of these commands my Figures
are updated appropriately and the Properties view and the Outline view is
also updated appropriately.

My problem is that I also have another View which I've created myself. Its
state is not updated to reflect the new state of my model after an Undo,
and I can't understand why. What is it that the standard Properties and
Outline views are doing that my view is not doing.

The only listener which my view currently implements is ISelectionListener
to listen to selection changes within my editor. Obviously I could make my
view also listen to property changes within my model in the same way as my
edit parts do, but I don't see how the standard Properties and Outline
views could be doing that, and I don't want my view to operate in a
non-standard manner.

Can anybody enlighten me?

Thanks in advance
Neil
Re: How to reflect model state in a custom view after Undo [message #207306 is a reply to message #207169] Thu, 12 January 2006 21:40 Go to previous message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Your diagram is updated from the model because the model fires events to the
EditParts whenever something relevant changes. If your view is based on
EditParts listening to these events, it will update. Take a look at the GEF
ediagram example which is available from CVS.

"Neil Sanderson" <neil.sanderson@scapatech.com> wrote in message
news:233120d37535c8eb4ff3c116503715af$1@www.eclipse.org...
> Hello,
>
> I wonder if anyone can help me understand how views reflect the state of a
> model after an Undo command has been issued. I have built a GEF editor
> with undoable/redoable GEF commands to edit my model. I use both the
> standard Properties view and Outline view to support my editor. Using gef
> commands and the command stack of my editor I can change properties of the
> elements in my model through the properties view and my gef Figures are
> updated appropriately. Also when I undo one of these commands my Figures
> are updated appropriately and the Properties view and the Outline view is
> also updated appropriately.
>
> My problem is that I also have another View which I've created myself. Its
> state is not updated to reflect the new state of my model after an Undo,
> and I can't understand why. What is it that the standard Properties and
> Outline views are doing that my view is not doing.
>
> The only listener which my view currently implements is ISelectionListener
> to listen to selection changes within my editor. Obviously I could make my
> view also listen to property changes within my model in the same way as my
> edit parts do, but I don't see how the standard Properties and Outline
> views could be doing that, and I don't want my view to operate in a
> non-standard manner.
>
> Can anybody enlighten me?
>
> Thanks in advance
> Neil
>
Previous Topic:Running/Editing the examples
Next Topic:Shold I start from EMF or GMF?
Goto Forum:
  


Current Time: Thu Jan 23 11:51:46 GMT 2025

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

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

Back to the top