SetPropertyValueCommnad used by the UndoablePropertySheetEntry [message #168704] |
Thu, 17 February 2005 14:58  |
Eclipse User |
|
|
|
Originally posted by: kevinlouisnospam.hotmail.com
Hi,
My model already has the command objects. I am creating my model wrapper
class and expose some properties to the Properties Window. I want to
create a GEF command wrapper class and delegate the calls to my command
object. However, I find that setting property value through the Properties
Window uses the SetPropertyValueCommand. This SetPropertyValueCommand calls
the setPropertyValue of the target object (my model wrapper object) and keep
the undoValue. When it is undone, it calls the setPropertyValue of my model
object with the undoValue.
In other words, setPropertyValue is the only function called in my wrapper
model object in both redo/undo. The model wrapper object has no idea it is
an undo action and it cannot delegate the call to myCommand#undo.
This SetPropertyValueCommand is new inside the UndoablePropertySheetEntry.
I cannot override them unless I write my own Properties Window.
Is there any good way to solve this problem?
Thanks.
|
|
|
|
Re: SetPropertyValueCommnad used by the UndoablePropertySheetEntry [message #169230 is a reply to message #169129] |
Mon, 21 February 2005 20:25  |
Eclipse User |
|
|
|
Originally posted by: kevinlouisnospam.hotmail.com
My OM already has the UndoManager to do the undo.
I think I can create my own CommandStack derived class and set it to the
EditPolicy. The CommandStack#undo just calls the getUndoManager().undo()
and remove the command from the stack. The Command#undo is never used.
"Randy Hudson" <none@us.ibm.com> wrote in message
news:cvdaf9$oi8$1@www.eclipse.org...
> There are already API hooks which you can implement to do whatever you
want
> to do. It's the IPropertySource interface you should customize, not
> Command. Command#execute()==IPS#setPropertyValue(), etc. What would you
do
> differently, but you are not able to do via the IPropertySource API?
> Perhaps you should get more creative in defining what the current "value"
of
> the property is.
>
> "Kevin" <kevinlouisnospam@hotmail.com> escreveu na mensagem
> news:cv2t1t$3lg$1@www.eclipse.org...
> > Hi,
> >
> > My model already has the command objects. I am creating my model
wrapper
> > class and expose some properties to the Properties Window. I want to
> > create a GEF command wrapper class and delegate the calls to my command
> > object. However, I find that setting property value through the
> > Properties
> > Window uses the SetPropertyValueCommand. This SetPropertyValueCommand
> > calls
> > the setPropertyValue of the target object (my model wrapper object) and
> > keep
> > the undoValue. When it is undone, it calls the setPropertyValue of my
> > model
> > object with the undoValue.
> >
> > In other words, setPropertyValue is the only function called in my
wrapper
> > model object in both redo/undo. The model wrapper object has no idea it
> > is
> > an undo action and it cannot delegate the call to myCommand#undo.
> >
> > This SetPropertyValueCommand is new inside the
UndoablePropertySheetEntry.
> > I cannot override them unless I write my own Properties Window.
> >
> > Is there any good way to solve this problem?
> >
> > Thanks.
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07192 seconds