Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to place property set operations in commands?
How to place property set operations in commands? [message #229939] Mon, 29 January 2007 05:06 Go to next message
Eclipse UserFriend
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 #229996 is a reply to message #229939] Tue, 30 January 2007 06:22 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
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
Re: How to place property set operations in commands? [message #230184 is a reply to message #229996] Tue, 06 February 2007 17:12 Go to previous message
Eclipse UserFriend
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
Previous Topic:Sophisticated LayoutManager
Next Topic:Flexible Figure For Nodes
Goto Forum:
  


Current Time: Thu Oct 28 18:43:51 GMT 2021

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

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

Back to the top