Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » TemplateTransferDragSourceListener.getTemplate() returns null(java.lang.IllegalArgumentException: CreateRequest has unspecified CreationFactory)
TemplateTransferDragSourceListener.getTemplate() returns null [message #661017] Tue, 22 March 2011 17:47
Eclipse UserFriend
I have a editor based on GraphicalEditorWithFlyoutPalette.

When a drag and drop occurs from the palette, the resulting CreateCommand threads off long running model construction via a Job so that the UI remains responsive.

The problem I am having is that if a user performs another drop, prior to the Job finishing, an exception is encountered:
java.lang.IllegalArgumentException: CreateRequest has unspecified CreationFactory at org.eclipse.gef.requests.CreateRequest.getNewObject(CreateRe quest.java:74)

Through debugging, I see that TemplateTransferDragSourceLIstener.getTemplate is getting a PaletteDraw back from the PaletteViewer, causing it to return null. A PaletteDrawer is definitely not selected but is the first item in the palette.

My theory is that my background Job is notifying the controller to update the figures on the canvas as the model objects are constructed. Could this be causing the canvas to have focus, rather than the palette, and thus confusing PaletteViewer.getSelectedEditParts?

I have temporarily worked around this by overriding TemplateTransferDragSourceListener.getTemplate() to cache the last non-null template and use that in cases where the super call doesn't return one.

I would be happy to hear any insight someone might have on this or if I should create a defect.

Thanks
Previous Topic:[Zest] ConnectionRouter
Next Topic:Polyline Edit
Goto Forum:
  


Current Time: Thu Apr 25 08:54:37 GMT 2024

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

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

Back to the top