Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Using a DirectEditPolicy
Using a DirectEditPolicy [message #184647] Wed, 15 June 2005 06:37 Go to next message
Eclipse UserFriend
Originally posted by: andrew.fleet.iona.com

Hi,
I have a model in which I want to change an attribute of a model element.
I get the attribute
change from a dialog box and it seems to me an implementation of
DirectEditPolicy is the
appropriate way to send a message to the model element. What I'm not getting
is what do I
need to do to get the DirectEditPolicy to trigger after I close the dalog
box,

Thanks,

Andy
Re: Using a DirectEditPolicy [message #184684 is a reply to message #184647] Wed, 15 June 2005 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nospam.gmx.net

DirectEditPolicy is mainly used for handling in-place editing and requests,
that come from a DirectEditManager.
If you use a dialog for changing values, simply put a command on the command
stack,
which changes your model.


You could create a direct edit request, send it to the editpart, and execute
the command which is returned.
getEditPart().getCommand(EditRequest);
be sure to install your directEditPolicy.

Regards, Ingo


"Andrew Fleet" <andrew.fleet@iona.com> wrote in message
news:d8ois4$pls$1@news.eclipse.org...
> Hi,
> I have a model in which I want to change an attribute of a model
element.
> I get the attribute
> change from a dialog box and it seems to me an implementation of
> DirectEditPolicy is the
> appropriate way to send a message to the model element. What I'm not
getting
> is what do I
> need to do to get the DirectEditPolicy to trigger after I close the dalog
> box,
>
> Thanks,
>
> Andy
>
>
Re: Using a DirectEditPolicy [message #184706 is a reply to message #184684] Wed, 15 June 2005 18:05 Go to previous message
Eclipse UserFriend
Originally posted by: arefleet.comcast.net

Thanks Ingo,
I think the command stack is the way to go here - having looked
at the CommandStack and EditDomain I don't see an obvious way to add
the command - I do see I could request the CommandStack to directly
execute a Command but that seems intrusive. Am I supposed to use an API
to queue the command for execution by whatever usually calls the
CommandStack
execute() method?

Thanks,

Andy
Previous Topic:LayoutEditPolicy that affects children
Next Topic:RetargetAction --- Custom requests --- Copy paste actions
Goto Forum:
  


Current Time: Tue Apr 16 12:18:45 GMT 2024

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

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

Back to the top