Skip to main content



      Home
Home » Eclipse Projects » GEF » SetPropertyValueCommnad used by the UndoablePropertySheetEntry
SetPropertyValueCommnad used by the UndoablePropertySheetEntry [message #168704] Thu, 17 February 2005 14:58 Go to next message
Eclipse UserFriend
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 #169129 is a reply to message #168704] Mon, 21 February 2005 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

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.
>
>
Re: SetPropertyValueCommnad used by the UndoablePropertySheetEntry [message #169230 is a reply to message #169129] Mon, 21 February 2005 20:25 Go to previous message
Eclipse UserFriend
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.
> >
> >
>
>
Previous Topic:EDiagram Wizard
Next Topic:Can i capture the snapshot of the editor in a JPEG file?
Goto Forum:
  


Current Time: Thu Jun 12 15:43:46 EDT 2025

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

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

Back to the top