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());
		Transfer[] transfers = new Transfer[] {
		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 {
		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

!ENTRY org.eclipse.ui 4 0 2011-08-04 01:12:26.734
!MESSAGE Unhandled event loop exception
org.eclipse.core.runtime.AssertionFailedException: null argument:
at org.eclipse.core.runtime.Assert.isNotNull(
at org.eclipse.core.runtime.Assert.isNotNull(
at org.eclipse.jface.viewers.AbstractTreeViewer.getTreePathFromItem(
at org.eclipse.jface.viewers.AbstractTreeViewer.getSelection(
at org.eclipse.jface.viewers.StructuredViewer.handleSelect(
at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(
at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(
at org.eclipse.jface.util.OpenStrategy.access$4(
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(
at org.eclipse.swt.widgets.EventTable.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at org.eclipse.ui.internal.Workbench.runEventLoop(
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$4(
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
at org.eclipse.ui.internal.ide.application.IDEApplication.start(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
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(
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

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