Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » DropObjectsRequest problem
DropObjectsRequest problem [message #209101] Tue, 21 October 2008 16:31 Go to next message
Eclipse UserFriend
Originally posted by: knakov.scopeset.de

Hi,

I use RCP and I am dragging items from the Project Explorer view to one
of the parts in the open diagram editor. I am having some troubles with
DragDropEditPolicy::getDropObjectsCommand(DropObjectsRequest dropRequest).

When I drag an IFile from the Project Explorer, dropRequest.getObjects()
contains the file. But if I expand the items in the domain model file in
the Project Explorer and drag an item to the edit part, then
dropRequest.getObjects() is an empty list. What can be wrong?

Thanks in advance,
Kalin
Re: DropObjectsRequest problem [message #209162 is a reply to message #209101] Wed, 22 October 2008 10:16 Go to previous message
Eclipse UserFriend
Originally posted by: knakov.scopeset.de

Kalin Nakov wrote:
> Hi,
>
> I use RCP and I am dragging items from the Project Explorer view to one
> of the parts in the open diagram editor. I am having some troubles with
> DragDropEditPolicy::getDropObjectsCommand(DropObjectsRequest dropRequest).
>
> When I drag an IFile from the Project Explorer, dropRequest.getObjects()
> contains the file. But if I expand the items in the domain model file in
> the Project Explorer and drag an item to the edit part, then
> dropRequest.getObjects() is an empty list. What can be wrong?
>
> Thanks in advance,
> Kalin

I have found a solution by using a patch. The following patch added to
my DiagramDocumentEditor solves the problem:

getDiagramGraphicalViewer().addDropTargetListener(new
DiagramDropTargetListener(getDiagramGraphicalViewer(),
LocalSelectionTransfer.getTransfer()) {
@Override
protected List getObjectsBeingDropped() {
/* Get the selection from the transfer agent */
List fileList = new ArrayList();


fileList.add(LocalSelectionTransfer.getTransfer().getSelecti on());

if (fileList.size() > 0)
return fileList;

return null;
}
});


I believe this is a bug since the dragged objects have to be added manually.
Previous Topic:DnD in GMF Editor
Next Topic:How to create link and node at the same time
Goto Forum:
  


Current Time: Wed Apr 24 23:54:58 GMT 2024

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

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

Back to the top