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.

View | Details | Raw Unified | Return to bug 194617
Collapse All | Expand All

(-)/home/mblaesing/src/netbeans-0.7-beta/db.dataview/src/org/netbeans/modules/db/dataview/output/DataViewTableUI.java.orig (-31 / +15 lines)
Lines 192-212 Link Here
192
                if (row == -1) {
192
                if (row == -1) {
193
                    return;
193
                    return;
194
                }
194
                }
195
                editCellAt(row, col);
196
195
197
                TableCellEditor editor = getCellEditor();
196
                DBColumn dbcol = getDBColumn(col);
198
                if (editor != null) {
197
                if (dbcol.isGenerated() || !dbcol.isNullable()) {
199
                    DBColumn dbcol = getDBColumn(col);
198
                    Toolkit.getDefaultToolkit().beep();
200
                    if (dbcol.isGenerated() || !dbcol.isNullable()) {
199
                } else {
201
                        Toolkit.getDefaultToolkit().beep();
200
                    setValueAt("<NULL>", row, col);
202
                        editor.stopCellEditing();
203
                    } else {
204
                        editor.getTableCellEditorComponent(DataViewTableUI.this, null, rowSelectionAllowed, row, col);
205
                        setValueAt(null, row, col);
206
                        editor.stopCellEditing();
207
                    }
208
                    setRowSelectionInterval(row, row);
209
                }
201
                }
202
                setRowSelectionInterval(row, row);
210
            } else if (e.isControlDown() && e.getKeyChar() == KeyEvent.VK_1) {
203
            } else if (e.isControlDown() && e.getKeyChar() == KeyEvent.VK_1) {
211
                int row = getSelectedRow();
204
                int row = getSelectedRow();
212
                int col = getSelectedColumn();
205
                int col = getSelectedColumn();
Lines 214-238 Link Here
214
                    return;
207
                    return;
215
                }
208
                }
216
209
217
                editCellAt(row, col);
210
                DBColumn dbcol = getDBColumn(col);
218
                TableCellEditor editor = getCellEditor();
211
                Object val = getValueAt(row, col);
219
                if (editor != null) {
212
                if (dbcol.isGenerated() || !dbcol.hasDefault()) {
220
                    DBColumn dbcol = getDBColumn(col);
213
                    Toolkit.getDefaultToolkit().beep();
221
                    Object val = getValueAt(row, col);
214
                } else if (val != null && val instanceof String && ((String) val).equals("<DEFAULT>")) {
222
                    if (dbcol.isGenerated() || !dbcol.hasDefault()) {
215
                    setValueAt(null, row, col);
223
                        Toolkit.getDefaultToolkit().beep();
216
                } else {
224
                        editor.stopCellEditing();
217
                    setValueAt("<DEFAULT>", row, col);
225
                    } else if (val != null && val instanceof String && ((String) val).equals("<DEFAULT>")) {
226
                        editor.getTableCellEditorComponent(DataViewTableUI.this, "", rowSelectionAllowed, row, col);
227
                        setValueAt(null, row, col);
228
                        editor.stopCellEditing();
229
                    } else {
230
                        editor.getTableCellEditorComponent(DataViewTableUI.this, "<DEFAULT>", rowSelectionAllowed, row, col);
231
                        setValueAt("<DEFAULT>", row, col);
232
                        editor.stopCellEditing();
233
                    }
234
                    setRowSelectionInterval(row, row);
235
                }
218
                }
219
                setRowSelectionInterval(row, row);
236
            }
220
            }
237
        }
221
        }
238
222

Return to bug 194617