Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » drag shortcut bug candidate ?
drag shortcut bug candidate ? [message #122348] Fri, 27 April 2007 11:01 Go to next message
Eclipse UserFriend
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
Re: drag shortcut bug candidate ? [message #122380 is a reply to message #122348] Fri, 27 April 2007 13:45 Go to previous messageGo to next message
Eclipse UserFriend
Hello Marian,

> It is thrown in the overridden getDropObjectsCommand method of the
> DiagramDragDropEditPolicy of my DiagramEditPart
Can you reproduce this problem with the original generated code?

-----------------
Alex Shatalin
Re: drag shortcut bug candidate ? [message #122474 is a reply to message #122380] Sat, 28 April 2007 18:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: NOSPAM.xyz.com

Hi Alex,
yes, it happens in a freshly generated editor.
It turns out that this problem is related to the shortcut mechanism.
I was experimenting with that, so in the xxx.gmfgen I have:
<containsShortcutsTo>flow</containsShortcutsTo>
<containsShortcutsTo>flow_diagram</containsShortcutsTo>
<shortcutsProvidedFor>Flow</shortcutsProvidedFor>

In my original posting I mentioned that the kind of the resource being
dragged is the same as that of the open editor's diagram.
This is irrelevant, forget it.
The porblem shows up with any kind of file.
Simply the
getDropObjectsCommand( DropObjectsRequest dropRequest)
gets wrong requests.

BTW the same problem can be spotted in the Taipan example as well.
M.


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e61306e8c9571bbb63db92@news.eclipse.org...
> Hello Marian,
>
>> It is thrown in the overridden getDropObjectsCommand method of the
>> DiagramDragDropEditPolicy of my DiagramEditPart
> Can you reproduce this problem with the original generated code?
>
> -----------------
> Alex Shatalin
>
>
Re: drag shortcut bug candidate ? [message #122519 is a reply to message #122474] Mon, 30 April 2007 08:38 Go to previous messageGo to next message
Eclipse UserFriend
Hello Marian,

Can you please submitt a request for it?

-----------------
Alex Shatalin
Re: drag shortcut bug candidate ? [message #123103 is a reply to message #122519] Tue, 01 May 2007 10:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: NOSPAM.xyz.com

Ok, I'll try
"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e6131238c9594c5cac697f@news.eclipse.org...
> Hello Marian,
>
> Can you please submitt a request for it?
>
> -----------------
> Alex Shatalin
>
>
Re: drag shortcut bug candidate ? [message #124199 is a reply to message #122519] Fri, 04 May 2007 12:03 Go to previous message
Eclipse UserFriend
Originally posted by: NOSPAM.xyz.com

Hi everybody,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=184869


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e6131238c9594c5cac697f@news.eclipse.org...
> Hello Marian,
>
> Can you please submitt a request for it?
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Acces from a GMF diagram to a project root
Next Topic:Diagram Code Generation
Goto Forum:
  


Current Time: Sun Apr 27 01:51:19 EDT 2025

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

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

Back to the top