When getCreateCommand() will be called? [message #162680] |
Thu, 23 December 2004 13:59 |
Eclipse User |
|
|
|
Originally posted by: zhlmmc.hotmail.com
If I write getCreateCommand() like this:
protected Command getCreateCommand(CreateRequest request) {
/*CreateCommand command = new CreateCommand();
Rectangle constraint = (Rectangle) getConstraintFor(request);
HelloModel model = (HelloModel) request.getNewObject();
model.setConstraint(constraint);
command.setContentsModel(getHost().getModel());
command.setHelloModel(model);
return command;*/
return null;
}
GEF will stop me dragging the component from palette to the
EditPartViewer,has this method been called before my operation?Otherwise
how could system know that this method returns null and should reject this
operation?
Thank you :)
|
|
|
|
Re: When getCreateCommand() will be called? [message #162711 is a reply to message #162680] |
Thu, 23 December 2004 21:40 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Do you have a TemplateTransferDropTarget on your graphical viewer? Put a
breakpoint in its handleDragOver or whatever the method is called.
"zhlmmc" <zhlmmc@hotmail.com> wrote in message
news:cqej09$rid$1@www.eclipse.org...
> If I write getCreateCommand() like this:
> protected Command getCreateCommand(CreateRequest request) {
> /*CreateCommand command = new CreateCommand();
>
> Rectangle constraint = (Rectangle) getConstraintFor(request);
>
> HelloModel model = (HelloModel) request.getNewObject();
>
> model.setConstraint(constraint);
>
> command.setContentsModel(getHost().getModel());
> command.setHelloModel(model);
> return command;*/
> return null;
> }
> GEF will stop me dragging the component from palette to the
> EditPartViewer,has this method been called before my operation?Otherwise
> how could system know that this method returns null and should reject this
> operation?
>
> Thank you :)
>
|
|
|
Powered by
FUDForum. Page generated in 0.03558 seconds