Undo/Redo support for non EMF based domain objects [message #556346] |
Tue, 31 August 2010 17:41  |
Eclipse User |
|
|
|
It seems that if my domain objects are not EMF based, then we don't get the undo/redo support (whether it's a move feature or add feature). After some digging, I noticed that Graphiti uses GFCommandStack class which seems to replace GEF's command stack with emf's command stack.
How do I get undo/redo support if my domain objects are not EMF based? Thank you for your suggestions!
Shenxue
|
|
|
|
|
Re: Undo/Redo support for non EMF based domain objects [message #557655 is a reply to message #557499] |
Wed, 08 September 2010 08:35  |
Eclipse User |
|
|
|
Shenxue,
I just had a closer look and saw that you are right. This is a gap in our
command stack implementation. After a short team discussion we also saw that
there is currently no other hook to actually undo/redo non-EMF changes.
Could you please open an enhancement request Bugzilla (Under modeling,
product GMP, component Graphiti) for this? We have a rough idea how to
implement the feature, but this needs to be detailed out.
Thanks,
Michael
"Shenxue Zhou" <shenxue.zhou@oracle.com> wrote in message
news:i664t9$44g$1@build.eclipse.org...
> Michael,
>
> Thanks for your reply. I did some experiment based on your suggestion. In
> my editor, I overrode the setInput() method. My setInput() method looks
> like this:
>
> @Override
> protected void setInput(IEditorInput input) {
> super.setInput(input);
> getEditDomain().getCommandStack().addCommandStackEventListen er(this); }
>
> But I'm registering a command stack event listener to GFCommandStack()
> since the default domain's GEF command stack has been replaced by
> GFCommandStack after super.setInput() is called. GFCommandStack doesn't
> seem to notify listeners about POST_REDO/POST_UNDO events.
>
> Thoughts?
>
> Shenxue
|
|
|
Re: Undo/Redo support for non EMF based domain objects [message #567972 is a reply to message #557283] |
Tue, 07 September 2010 15:47  |
Eclipse User |
|
|
|
Michael,
Thanks for your reply. I did some experiment based on your suggestion. In my editor, I overrode the setInput() method. My setInput() method looks like this:
@Override
protected void setInput(IEditorInput input)
{
super.setInput(input);
getEditDomain().getCommandStack().addCommandStackEventListen er(this);
}
But I'm registering a command stack event listener to GFCommandStack() since the default domain's GEF command stack has been replaced by GFCommandStack after super.setInput() is called. GFCommandStack doesn't seem to notify listeners about POST_REDO/POST_UNDO events.
Thoughts?
Shenxue
|
|
|
Re: Undo/Redo support for non EMF based domain objects [message #568043 is a reply to message #567972] |
Wed, 08 September 2010 08:35  |
Eclipse User |
|
|
|
Shenxue,
I just had a closer look and saw that you are right. This is a gap in our
command stack implementation. After a short team discussion we also saw that
there is currently no other hook to actually undo/redo non-EMF changes.
Could you please open an enhancement request Bugzilla (Under modeling,
product GMP, component Graphiti) for this? We have a rough idea how to
implement the feature, but this needs to be detailed out.
Thanks,
Michael
"Shenxue Zhou" <shenxue.zhou@oracle.com> wrote in message
news:i664t9$44g$1@build.eclipse.org...
> Michael,
>
> Thanks for your reply. I did some experiment based on your suggestion. In
> my editor, I overrode the setInput() method. My setInput() method looks
> like this:
>
> @Override
> protected void setInput(IEditorInput input) {
> super.setInput(input);
> getEditDomain().getCommandStack().addCommandStackEventListen er(this); }
>
> But I'm registering a command stack event listener to GFCommandStack()
> since the default domain's GEF command stack has been replaced by
> GFCommandStack after super.setInput() is called. GFCommandStack doesn't
> seem to notify listeners about POST_REDO/POST_UNDO events.
>
> Thoughts?
>
> Shenxue
|
|
|
Powered by
FUDForum. Page generated in 0.04944 seconds