This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When TableRendererModel provides TableCellEditor, it's isCellEditable() is not called, because it's replaced with TableRendererModel.canEditCell() by the implementation. There are cases when TableCellEditor needs to decide whether it will actually edit the cell or not based on the event and therefore TableRendererModel.canEditCell() is not sufficient.
Fixed in changeset: 173233:84ca576c42f5 http://hg.netbeans.org/main/rev/84ca576c42f5 Also the test demonstrates how can the event be used to make the cell conditionally editable based of the click location: @Override public boolean isCellEditable(EventObject anEvent) { if (anEvent.getSource() instanceof JTable) { JTable table = (JTable) anEvent.getSource(); if (anEvent instanceof MouseEvent) { MouseEvent event = (MouseEvent) anEvent; Point p = event.getPoint(); int row = table.rowAtPoint(p); int col = table.columnAtPoint(p); Rectangle rect = table.getCellRect(row, col, true); p.translate(-rect.x, -rect.y); System.out.println("isCellEditable("+anEvent+")"); System.out.println("Point "+p+"in rectangle "+rect); if (p.x > rect.width - 24) { // last 24 points not editable return false; } } } return true; }
Integrated into 'main-golden', will be available in build *201006190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/84ca576c42f5 User: mentlicher@netbeans.org Log: #187789 Call TableCellEditor.isCellEditable() and in the test we demonstrate how the cell can be made conditionally editable.
Please verify bugfix for this bug, so it can be integrated into release691 repository. Thanks, -R
Do not see any regression in 201006220001 - verified
I've prepared combined change in branch debugger_ports in release691 repository.
Integrated into release691 repository changeset: 171826:8890faf51fd3 branch: debugger_ports parent: 171804:c30febb9fe6d user: mentlicher@netbeans.org date: Fri Jun 18 16:37:35 2010 +0200 summary: #187789 Call TableCellEditor.isCellEditable() and in the test we demonstrate how the cell can be made conditionally editable.
verified in the source code