Community
Participate
Working Groups
I create a table (with a tableViewer) without a column header. I am using a DialogCellEditor. If I do not set columnProperties (tableViewer.setColumnProperties(String[])) there will be an error in the eventDispatch thread (I think) when I click the table. If the code looks like this: Composite iTableViewerComposite = new Composite(permissionsGroup, SWT.NONE); iTableViewerComposite.setLayout(itvFillLayout); GridData itGridData = new GridData(GridData.FILL_BOTH); iTableViewerComposite.setLayoutData(itGridData); Table instanceTable = new Table(iTableViewerComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI); TableColumn column = new TableColumn(instanceTable, SWT.LEFT); column.setWidth(200); instanceTable.setLinesVisible(true); instanceTableViewer = new TableViewer(instanceTable); instanceTableViewer.setContentProvider(new ArrayContentProvider ()); instanceTableViewer.setLabelProvider(new InstanceTableLabelProvider()); instanceTableViewer.setCellModifier( new InstanceCellModifier(instanceTableViewer)); instanceTableViewer.setCellEditors( new CellEditor[] { new InstanceDialogCellEditor(instanceTable)}); instanceTableViewer.setInput(populateInstances()); ...and I click the table I get an error like this: java.lang.NullPointerException at org.eclipse.jface.viewers.TableViewerImpl.activateCellEditor (TableViewerImpl.java:61) at org.eclipse.jface.viewers.TableViewerImpl.activateCellEditor (TableViewerImpl.java:134) at org.eclipse.jface.viewers.TableViewerImpl.handleMouseDown (TableViewerImpl.java:231) at org.eclipse.jface.viewers.TableViewer$1.mouseDown (TableViewer.java:320) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:128) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:847) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2173) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1863) at org.eclipse.jface.window.Window.runEventLoop(Window.java:583) at org.eclipse.jface.window.Window.open(Window.java:563) at se.capitalc.prototype.moonraypermission.MoonrayPermissionClient.main (MoonrayPermissionClient.java:26) But if I complete the code with: String[] iColumnNames = {"Instance"}; //... code above instanceTableViewer.setColumnProperties(iColumnNames); // Not using columnHeaders! ...it works just fine! If this is by design, it makes no sense to me in this case or at least it is poorly documented(I spent 2 days trying to find out what was wrong)
The property names are needed to pass to the ICellModifier methods. I agree that the error handling could be improved though.
Reassigning bugs in component areas that are changing ownership.
Cleaning up defect lists by setting ones without recent traffic to 'REMIND'.
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.