Skip to main content



      Home
Home » Eclipse Projects » GEF » Can I send Request to the EditPart and let do something?
Can I send Request to the EditPart and let do something? [message #108141] Sun, 07 December 2003 23:58 Go to next message
Eclipse UserFriend
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 #108170 is a reply to message #108141] Mon, 08 December 2003 04:47 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
>
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 Go to previous message
Eclipse UserFriend
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.
> >
> >
>
>
>
Previous Topic:Maximising with FigureCanvas Scrollbars
Next Topic:WYSIWYG Environment
Goto Forum:
  


Current Time: Tue Jul 22 06:32:34 EDT 2025

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

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

Back to the top