Using a DirectEditPolicy [message #184647] |
Wed, 15 June 2005 06:37 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04711 seconds