Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Table Cell Editor Frustration !!
Table Cell Editor Frustration !! [message #465162] Wed, 07 December 2005 11:14 Go to next message
steve lane is currently offline steve laneFriend
Messages: 24
Registered: July 2009
Junior Member
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(Ta bleEditorImpl.java:271)
at org.eclipse.jface.viewers.TableViewer$2.mouseDown(TableViewe r.java:608)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.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.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at com.jpmorgan.im.osm.Application.run(Application.java:39)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.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)
Re: Table Cell Editor Frustration !! [message #465170 is a reply to message #465162] Wed, 07 December 2005 15:26 Go to previous message
steve lane is currently offline steve laneFriend
Messages: 24
Registered: July 2009
Junior Member
sorry, i fixed my problem. wasnt calling setColumnProperties.
Previous Topic:how to disable Flash inside swt/Browser in linux?
Next Topic:tooltips
Goto Forum:
  


Current Time: Fri Apr 19 07:27:30 GMT 2024

Powered by FUDForum. Page generated in 0.02098 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top