Can I send Request to the EditPart and let do something? [message #108141] |
Sun, 07 December 2003 23:58  |
Eclipse User |
|
|
|
Originally posted by: sckimos.enet.co.kr
Hi.
I know that user-action is converted to Request object,
and it is passed to the EditPart,
and Command object is returned (maybe with EditPart.getCommand() ?),
and it is executed.
Then if I want to simulate the user-action,
how can I do?
I have implemented like followings in the Action class.
EditPart part = (EditPart)getSelectedObjects().get(0);
Command cmd = part.getCommand(createCreateMemberRequest());
if (cmd == null) return;
NDEditorPart editor = (NDEditorPart)getEditorPart();
editor.getEditDomain().getCommandStack().execute(cmd);
But it seems that there is more nicely methods...
thanks for reading.
|
|
|
|
Re: Can I send Request to the EditPart and let do something? [message #108356 is a reply to message #108170] |
Mon, 08 December 2003 20:11  |
Eclipse User |
|
|
|
Originally posted by: sckimos.enet.co.kr
Thanks Shady.
But, AbstractEditPart.performRequest() is empty.
So It seems that I must implement the performRequest() method.
Then I think that it is not different from previous code...
When user-action is occured, which method is invoked from EditPart?
"Shady Said" <sh_said@yahoo.com> wrote in message
news:br1h83$coj$1@eclipse.org...
>
> You can call EditPart.performRequest(your_own_request)
>
> "Kimos" <sckimos@enet.co.kr> wrote in message
> news:br108p$rjq$1@eclipse.org...
> > Hi.
> >
> > I know that user-action is converted to Request object,
> > and it is passed to the EditPart,
> > and Command object is returned (maybe with EditPart.getCommand() ?),
> > and it is executed.
> >
> > Then if I want to simulate the user-action,
> > how can I do?
> >
> > I have implemented like followings in the Action class.
> >
> > EditPart part = (EditPart)getSelectedObjects().get(0);
> > Command cmd = part.getCommand(createCreateMemberRequest());
> > if (cmd == null) return;
> >
> > NDEditorPart editor = (NDEditorPart)getEditorPart();
> > editor.getEditDomain().getCommandStack().execute(cmd);
> >
> > But it seems that there is more nicely methods...
> >
> > thanks for reading.
> >
> >
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04070 seconds