Skip to main content



      Home
Home » Eclipse Projects » GEF » When getCreateCommand() will be called?
When getCreateCommand() will be called? [message #162680] Thu, 23 December 2004 08:59 Go to next message
Eclipse UserFriend
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 #162688 is a reply to message #162680] Thu, 23 December 2004 12:21 Go to previous messageGo to next message
Eclipse UserFriend
If you're doing click-and-drop, it will. But not with drag-and-drop (which
is native). Set a breakpoint in that method to see when it's being 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 :)
>
Re: When getCreateCommand() will be called? [message #162711 is a reply to message #162680] Thu, 23 December 2004 16:40 Go to previous message
Eclipse UserFriend
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 :)
>
Previous Topic:Non printable layer and Outline Overview
Next Topic:Problem with picture using plugin
Goto Forum:
  


Current Time: Wed Jul 30 12:12:04 EDT 2025

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

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

Back to the top