Java Code Examples for javax.swing.table.TableCellEditor#cancelCellEditing()
The following examples show how to use
javax.swing.table.TableCellEditor#cancelCellEditing() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PropertySheetTable.java From CodenameOne with GNU General Public License v2.0 | 6 votes |
public void tableChanged(TableModelEvent e) { // in case the table changes for the following reasons: // * the editing row has changed // * the editing row was removed // * all rows were changed // * rows were added // // it is better to cancel the editing of the row as our editor // may no longer be the right one. It happens when you play with // the sorting while having the focus in one editor. if (e.getType() == TableModelEvent.UPDATE) { int first = e.getFirstRow(); int last = e.getLastRow(); int editingRow = PropertySheetTable.this.getEditingRow(); TableCellEditor editor = PropertySheetTable.this.getCellEditor(); if (editor != null && first <= editingRow && editingRow <= last) { editor.cancelCellEditing(); } } }
Example 2
Source File: PropertySheetTable.java From orbit-image-analysis with GNU General Public License v3.0 | 6 votes |
public void tableChanged(TableModelEvent e) { // in case the table changes for the following reasons: // * the editing row has changed // * the editing row was removed // * all rows were changed // * rows were added // // it is better to cancel the editing of the row as our editor // may no longer be the right one. It happens when you play with // the sorting while having the focus in one editor. if (e.getType() == TableModelEvent.UPDATE) { int first = e.getFirstRow(); int last = e.getLastRow(); int editingRow = PropertySheetTable.this.getEditingRow(); TableCellEditor editor = PropertySheetTable.this.getCellEditor(); if (editor != null && first <= editingRow && editingRow <= last) { editor.cancelCellEditing(); } } }
Example 3
Source File: ToDoCustomizer.java From netbeans with Apache License 2.0 | 6 votes |
private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed TableCellEditor editor = table.getCellEditor(); if( null != editor ) editor.cancelCellEditing(); boolean wasValid = isDataValid(); int selRow = table.getSelectedRow(); if( selRow < 0 ) return; DefaultTableModel model = (DefaultTableModel)table.getModel(); model.removeRow( selRow ); if( selRow > model.getRowCount()-1 ) selRow--; if( selRow >= 0 ) table.getSelectionModel().setSelectionInterval( selRow, selRow ); boolean wasChanged = changed; fireChanged(); firePropertyChange( OptionsPanelController.PROP_CHANGED, new Boolean(wasChanged), Boolean.TRUE); firePropertyChange( OptionsPanelController.PROP_VALID, new Boolean(wasValid), new Boolean(isDataValid())); }
Example 4
Source File: InnerTablePanel.java From netbeans with Apache License 2.0 | 6 votes |
protected void removeRowActionPerformed(ActionEvent e) { int row = table.getSelectedRow(); final int column = table.getSelectedColumn(); final TableCellEditor cellEditor = table.getCellEditor(row, column); if (cellEditor != null) { cellEditor.cancelCellEditing(); } InnerTableModel model = (InnerTableModel) table.getModel(); int rowCount = model.getRowCount() - 1; model.removeRow(row); model.modelUpdatedFromUI(); if (row >= rowCount) { row = rowCount - 1; } if (row >= 0) { final int n = row; Utils.runInAwtDispatchThread(new Runnable() { public void run() { selectCell(n, column); } }); } }
Example 5
Source File: AttrTable.java From Logisim with GNU General Public License v3.0 | 5 votes |
@Override public void attrStructureChanged(AttrTableModelEvent e) { if (e.getSource() != attrModel) { attrModel.removeAttrTableModelListener(this); return; } TableCellEditor ed = table.getCellEditor(); if (ed != null) { ed.cancelCellEditing(); } fireTableChanged(); }
Example 6
Source File: XMBeanAttributes.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 7
Source File: XMBeanAttributes.java From hottub with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 8
Source File: XMBeanAttributes.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.TRACE)) { LOGGER.log(Level.TRACE, "Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 9
Source File: PropertySheetTable.java From CodenameOne with GNU General Public License v2.0 | 5 votes |
/** * Cancels on-going cell editing */ public void cancelEditing() { TableCellEditor editor = getCellEditor(); if (editor != null) { editor.cancelCellEditing(); } }
Example 10
Source File: XMBeanAttributes.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 11
Source File: XMBeanAttributes.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 12
Source File: RunPortBindingsVisual.java From netbeans with Apache License 2.0 | 5 votes |
private void randomBindCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_randomBindCheckBoxItemStateChanged boolean selected = randomBindCheckBox.isSelected(); portMappingTable.setEnabled(!selected); addExposedButton.setEnabled(!selected); addButton.setEnabled(!selected); removeButton.setEnabled(!selected); TableCellEditor editor = portMappingTable.getCellEditor(); if (editor != null) { editor.cancelCellEditing(); } portMappingTable.clearSelection(); }
Example 13
Source File: XMBeanAttributes.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 14
Source File: PropertySheetTable.java From orbit-image-analysis with GNU General Public License v3.0 | 5 votes |
/** * Cancels on-going cell editing */ public void cancelEditing() { TableCellEditor editor = getCellEditor(); if (editor != null) { editor.cancelCellEditing(); } }
Example 15
Source File: AttrTable.java From Logisim with GNU General Public License v3.0 | 5 votes |
@Override public void attrValueChanged(AttrTableModelEvent e) { if (e.getSource() != attrModel) { attrModel.removeAttrTableModelListener(this); return; } int row = e.getRowIndex(); TableCellEditor ed = table.getCellEditor(); if (row >= 0 && ed instanceof CellEditor && attrModel.getRow(row) == ((CellEditor) ed).currentRow) { ed.cancelCellEditing(); } fireTableChanged(); }
Example 16
Source File: XMBeanAttributes.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 17
Source File: XMBeanAttributes.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 18
Source File: XMBeanAttributes.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void cancelCellEditing() { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Cancel Editing Row: "+getEditingRow()); } final TableCellEditor tableCellEditor = getCellEditor(); if (tableCellEditor != null) { tableCellEditor.cancelCellEditing(); } }
Example 19
Source File: StorageAddressEditorDialog.java From ghidra with Apache License 2.0 | 5 votes |
@Override public void tableRowsChanged() { TableCellEditor cellEditor = varnodeTable.getCellEditor(); if (cellEditor != null) { if (!cellEditor.stopCellEditing()) { cellEditor.cancelCellEditing(); } } }
Example 20
Source File: MemoryMapModel.java From ghidra with Apache License 2.0 | 5 votes |
void update() { JTable table = provider.getTable(); TableCellEditor cellEditor = table.getCellEditor(); if (cellEditor != null) { cellEditor.cancelCellEditing(); } populateMap(); }