Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Tool Palette drag and drop error
Tool Palette drag and drop error [message #1334681] Mon, 05 May 2014 14:02 Go to next message
Nickie woo is currently offline Nickie woo
Messages: 21
Registered: February 2014
Junior Member
Hi

I got stuck with a very strange problem while implementing dynamic tool palette.
My palette change its contents every time a shape on the diagram is selected, i do this by overriding the getPallete() method from ToolBehavior and immediately i got this error when drag and drop a tool from the palette.

java.lang.NullPointerException
	at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart$ToggleButtonTracker.handleNativeDragFinished(ToolEntryEditPart.java:117)
	at org.eclipse.gef.tools.AbstractTool.nativeDragFinished(AbstractTool.java:1247)
	at org.eclipse.gef.tools.SelectionTool.handleNativeDragFinished(SelectionTool.java:394)
	at org.eclipse.gef.tools.AbstractTool.nativeDragFinished(AbstractTool.java:1247)
	at org.eclipse.gef.EditDomain.nativeDragFinished(EditDomain.java:330)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchNativeDragFinished(DomainEventDispatcher.java:396)
	at org.eclipse.gef.ui.parts.GraphicalViewerImpl$1$TheLastListener.dragFinished(GraphicalViewerImpl.java:376)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:44)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:778)
	at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:389)
	at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
	at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)


When i debug this problem it turns out the getPaletteViewer() from ToolEntryEditPart returns null but have no idea what causes this.

protected boolean handleNativeDragFinished(DragSourceEvent event) {
			getPaletteViewer().setActiveTool(null);
			return true;
		}


Anyone have any ideas what might cause this ? Sad
Re: Tool Palette drag and drop error [message #1341462 is a reply to message #1334681] Thu, 08 May 2014 09:48 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1577
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Nickie,

it seems you try to exchange the palette in an open editor. As far as I can
remember the details of the internal implementation on this, this is not
supported by GEF our of the box. Not sure if that is doable...

Michael
Previous Topic:DiagramComposite in Eclipse 4
Next Topic:Property Sheet & Buttons
Goto Forum:
  


Current Time: Wed Jul 30 19:34:43 EDT 2014

Powered by FUDForum. Page generated in 0.03132 seconds