How to place property set operations in commands? [message #229939] |
Mon, 29 January 2007 05:06 |
Eclipse User |
|
|
|
Originally posted by: zjg.robin.gmail.com
Hi,
I use the standard eclipse property view to edit my GEF application model, fg. set the model elements background, then fire the property change event to editpart, and the latter refresh the figure. All seems fine, since the GEF eviroment supports Redo and Undo by using commands. So, how to link the commands to property view? Code be btter.
Thanks. Robin.
|
|
|
|
Re: How to place property set operations in commands? [message #230184 is a reply to message #229996] |
Tue, 06 February 2007 17:12 |
Eclipse User |
|
|
|
Originally posted by: manuel.zabelt.sap.com
Alex Boyko wrote:
> Hi,
> Isn't there an example of this functionality with GEF example editors:
> logic and geoshapes editors? You can edit your model from the property
> view and undo/redo those changes... Perhaps, you missed it?
> Cheers,
> Alex
The examples seem to work in the following way:
- the default PropertySheet uses UndoablePropertySheetEntry to perform its
task
- if the user edits an value the valueChanged(...) Method is called on the
UndoablePropertySheetEntrys.
- by this method a SetValueCommand is created
- the SetValueCommand stores the original value by calling
getPropertyValue(propertyName) on the according IPropertySource,
und writes the new value by calling
setPropertyValue(propertyName, propertyValue) on it.
This behaviour seems adequate for simple things like the LEDCounter in the
logic example. The problem is, that the IPropertySource has no chance of
knowing, whether the setPropertyValue(...) call is part of an execute or
an undo of some SetValueCommand.
A more general approach would be to let the IPropertySource itself create
a Command instead of using SetValueCommands.
Unfortunatelly I got no glue of how and where to implement the proposed
behaviour.
I would really like to know of any sollution to this problem.
greetings
Manuel
|
|
|
Powered by
FUDForum. Page generated in 0.02865 seconds