drag shortcut bug candidate ? [message #122348] |
Fri, 27 April 2007 11:01  |
Eclipse User |
|
|
|
Originally posted by: NOSPAM.xyz.com
On my installation (M5uh) when I :
1) Have a diagram open , and ...
2) Grab and drag from the Navigator the resource
of another diagram of the same kind over the control
of the first one the following exception occurs:
java.lang.ClassCastException: java.lang.String
at
org.lum.diagram.edit.parts.FlowEditPart$1.getDropObjectsComm and(FlowEditPart.java:59)
at
org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEdit Policy.getCommand(DragDropEditPolicy.java:80)
at
org.eclipse.gef.editparts.AbstractEditPart.getCommand(Abstra ctEditPart.java:473)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.access$1(GraphicalEditPart.java:1)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt$1.run(GraphicalEditPart.java:456)
at
org.eclipse.emf.transaction.impl.TransactionalEditingDomainI mpl.runExclusive(TransactionalEditingDomainImpl.java:260)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getCommand(GraphicalEditPart.java:451)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramDropTargetLi stener$1.evaluate(DiagramDropTargetListener.java:203)
at
org.eclipse.gef.ui.parts.GraphicalViewerImpl$1$ConditionalTr eeSearch.accept(GraphicalViewerImpl.java:168)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart $1.findFigureAt(DiagramEditPart.java:148)
It is thrown in the overridden getDropObjectsCommand method of the
DiagramDragDropEditPolicy of my DiagramEditPart
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new
GeometryItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new
DiagramDragDropEditPolicy() {
public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
List viewDescriptors = new ArrayList();
for (Iterator it = dropRequest.getObjects().iterator(); it.hasNext();)
{
viewDescriptors
.add(new CreateViewRequest.ViewDescriptor(new
EObjectAdapter((EObject) it.next()), Node.class, null,
getDiagramPreferencesHint()));
}
return createShortcutsCommand(dropRequest, viewDescriptors);
}
The problem is that the object wrapped in the request is
just a String - the full path of the dragged resource - therefore
(EObject) it.next() throws.
BTW my intention was to just drop it onto the editor tab area so that the
second diagram opens in a new editor instance, it was only accidentally
that the mouse passed over the canvas of the first editor.
Is this a bug?
Marian
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03354 seconds