Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » (bug?) AssertionFailedException in jface getTreePathFromItem(TreeViewer.getSelection()'s error with a valid Tree control associated)
(bug?) AssertionFailedException in jface getTreePathFromItem [message #709450] Wed, 03 August 2011 19:31 Go to next message
Paul Keryon is currently offline Paul Keryon
Messages: 5
Registered: April 2011
Junior Member
I'm trying to link a Tree control with a drag'n'drop DragSourceAdapter subclass

The tree control is working fine and it's built in a plugin's view, I need to send data over LocalSelectionTransfer so I first converted the Tree control to a TreeViewer control and added the drag support

		// Convert swt Tree to TreeViewer jface
		m_treeViewer = new TreeViewer(aWSMLView.getTree());
		int ops = DND.DROP_COPY | DND.DROP_MOVE;
		Transfer[] transfers = new Transfer[] {
				LocalSelectionTransfer.getTransfer()};
		ParticipantDragAdapter drag = new ParticipantDragAdapter();
		m_treeViewer.addDragSupport(ops, transfers, drag);


m_treeViewer is declared as a private TreeViewer variable in the class and no other methods touch it.

The 'ParticipantDragAdapter' is the following subclass of DragSourceAdapter

private class ParticipantDragAdapter extends DragSourceAdapter {
		@Override
		public void dragStart(DragSourceEvent event) 
		{
			// .. code to retrieve data..
			
			ISelection first_selection = m_treeViewer.getSelection(); // EXCEPTION IF EXECUTED

			LocalSelectionTransfer.getTransfer().setSelection(m_treeViewer.getSelection()); // EXCEPTION IF EXECUTED
			
		}
	}



The problem is that every time I try to make the '.AbstractTreeViewer.getSelection()' method work, the plugin hangs the function and writes out

Quote:
!ENTRY org.eclipse.ui 4 0 2011-08-04 01:12:26.734
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
at org.eclipse.jface.viewers.AbstractTreeViewer.getTreePathFromItem(AbstractTreeViewer.java:2870)
at org.eclipse.jface.viewers.AbstractTreeViewer.getSelection(AbstractTreeViewer.java:2893)
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1190)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1220)
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:228)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:222)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:389)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
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:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)



Is this a bug or am I missing something
Re: (bug?) AssertionFailedException in jface getTreePathFromItem [message #709822 is a reply to message #709450] Thu, 04 August 2011 06:49 Go to previous message
Paul Keryon is currently offline Paul Keryon
Messages: 5
Registered: April 2011
Junior Member
Update: seems like the

m_treeViewer = new TreeViewer(m_treecontrol);

line is creating all this mess. I tried associating a blank ILazyTreePathContentProvider but it failed too
Previous Topic:Binding to JFace Vierer's Filter
Next Topic:Validation Order
Goto Forum:
  


Current Time: Thu Jul 24 04:37:43 EDT 2014

Powered by FUDForum. Page generated in 0.01418 seconds