Skip to main content



      Home
Home » Eclipse Projects » GEF » How to implement Part's Property changes as a Command
How to implement Part's Property changes as a Command [message #158738] Fri, 19 November 2004 09:53 Go to next message
Eclipse UserFriend
The parts in the Graphical Editor I'm working on have many properties that
the user can change. Since the default Properties View left much to be
desired in terms of its UI, I've written a custom View that uses a
PageBook that can provide many different TabFolders that are suitable for
the different parts.

When the user makes a change via the custom property view, I want to
update the model via a Command so that the change can have Undo/Redo.

I'm confused about what Policy to use. DirectEditPolicy looks somewhat
like what I want, but I am NOT editing via a CellEditor in the Viewer. Am
really using a customized Properties View as explained above. Thought of
subclassing ComponentEditPolicy, but that is not supposed to be used for
interacting with visuals and a change in any of these properties does
change the Part's figure.

Can anyone recommend the right Policy for this?
Re: How to implement Part's Property changes as a Command [message #158892 is a reply to message #158738] Fri, 19 November 2004 17:37 Go to previous messageGo to next message
Eclipse UserFriend
What I've decided to do (and seems to work fine) is one the Property
Editing UI has gotten a change that needs to be applied it:
1. gets the CommandStack
2. Creates a Command subclass appropriate for the change being made.
3. calls commandStack.execute(<command from Step 2>)

Now I've got undo/redo (if command supports it) and dirty state of editor
is automatically updated.

Guess my problem was being hung up about doing this via a Policy.
Re: How to implement Part's Property changes as a Command [message #159238 is a reply to message #158892] Tue, 23 November 2004 11:36 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Good solution. Don't use a wrench as a hammer.

Not that like the properties viewer, you'll need to refresh your UI any time
the commandstack changes, unless you have some notifier mechanism that your
custom view is observing.

"Steve Harper" <steve_harper@adp.com> wrote in message
news:cnlsj8$do5$1@www.eclipse.org...
> What I've decided to do (and seems to work fine) is one the Property
> Editing UI has gotten a change that needs to be applied it:
> 1. gets the CommandStack
> 2. Creates a Command subclass appropriate for the change being made.
> 3. calls commandStack.execute(<command from Step 2>)
>
> Now I've got undo/redo (if command supports it) and dirty state of editor
> is automatically updated.
>
> Guess my problem was being hung up about doing this via a Policy.
>
Previous Topic:Multipage editor with zoom
Next Topic:Dynamically resizing label
Goto Forum:
  


Current Time: Wed Jul 09 14:14:17 EDT 2025

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

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

Back to the top