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