[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Table Cell Editor Frustration !!

Hi,

I have a table in which the first 2 columns will have a checkbox (created dynamically as not all rows will have it). I have implemented the checkbox inside my label provider in the getColumnImage method.

I want the user to be able to click on the rows which have a checkbox and toggle its state so i have created CellEditors like this:

CellEditor[] editors = new CellEditor[columns.length];
CellEditor[0] = new CheckboxCellEditor(t);
CellEditor[1] = new CheckboxCellEditor(t);

getOrdersTableViewer().setCellModifier(new CellModifier());		
getOrdersTableViewer().setCellEditors(editors);

But, when i run my app and click on the first or 2nd column, I get a unhandled loop exception with the following stack trace:

Any ideas what ive done wrong ? its driving me MENTAL !!! Ive tried to single step the code but i just cant work out where it blows up. If i comment out the line setCellModifier, the exception go's away. but if i put breakpoints in my CellModifier, it never gets called!


java.lang.NullPointerException
at org.eclipse.jface.viewers.TableEditorImpl.activateCellEditor(TableEditorImpl.java:72)
at org.eclipse.jface.viewers.TableEditorImpl.activateCellEditor(TableEditorImpl.java:145)
at org.eclipse.jface.viewers.TableEditorImpl.handleMouseDown(TableEditorImpl.java:271)
at org.eclipse.jface.viewers.TableViewer$2.mouseDown(TableViewer.java:608)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:133)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at com.jpmorgan.im.osm.Application.run(Application.java:39)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)