Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318957

Summary: Flow Example: DND Broken
Product: [Tools] GEF Reporter: Daniel Hirscher <devel>
Component: GEF-Legacy GEF (MVC)Assignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, nyssen
Version: unspecified   
Target Milestone: 3.6.2 (Helios SR2)   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
stack trace none

Description Daniel Hirscher CLA 2010-07-06 03:23:01 EDT
Build Identifier: I20100608-0911/Helios/3.6

When dragging from the palette and dropping anywhere in the diagram, an exception occures. Clicking to the palette and clicking in the diagram, it works.

Reproducible: Always

Steps to Reproduce:
1. Install GEF Examples
2. Open the Flow Example
3. Drag an "Activity" from the palette
4. Drop anywhere on diagram
-> Exception: java.lang.IllegalArgumentException: CreateRequest has unspecified CreationFactory
Comment 1 Daniel Hirscher CLA 2010-07-06 03:23:53 EDT
Created attachment 173503 [details]
stack trace
Comment 2 Daniel Hirscher CLA 2010-07-06 04:35:41 EDT
In the type: FlowEditor, in method: initializeGraphicalViewer() the drop target listener is wrong. The template of the TemplateTransferDragSourceListener is the creation tool an not a CreationFactory. So the factory is null and a model object cannot be created.

And just for your information: the type FlowElementFactory is not used and can be deleted.
Comment 3 Anthony Hunter CLA 2010-09-28 10:10:41 EDT
Which Linux is this?
Comment 4 Daniel Hirscher CLA 2010-09-29 01:48:45 EDT
This is on: Ubuntu 10.04 LTS - Lucid Lynx 64bit with Gnome Desktop 2.30.2
Comment 5 Alexander Nyßen CLA 2010-11-14 15:50:38 EST
Changed implementation of TemplateTransferDropTargetListener#getFactory(Object) to use a SimpleFactory in case the provided template is a class, which seems to be a common use case. 

This way, the reported problem in the flow example is covered by the default behavior of TemplateTransferDropTargetListener, and a custom implementation does not have to be provided.

Removed FlowElementFactory from example, which is not used (and was identical to SimpleFactory).

Committed changes to R_3_6_maintenance branch as well as cvs HEAD (3.7).