|TemplateTransferDragSourceListener.getTemplate() returns null [message #661017]
||Tue, 22 March 2011 17:47
| John Palof
Registered: July 2009
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.
Powered by FUDForum
. Page generated in 0.05736 seconds