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
John Palof is currently offline John PalofFriend
Messages: 18
Registered: July 2009
Junior Member
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

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.

Previous Topic:[Zest] Layer for a grid
Next Topic:Multiple connection layers
Goto Forum:

Current Time: Mon May 21 03:27:36 GMT 2018

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

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

Back to the top