本文整理汇总了Java中javax.swing.table.TableCellEditor.cancelCellEditing方法的典型用法代码示例。如果您正苦于以下问题:Java TableCellEditor.cancelCellEditing方法的具体用法?Java TableCellEditor.cancelCellEditing怎么用?Java TableCellEditor.cancelCellEditing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.table.TableCellEditor
的用法示例。
在下文中一共展示了TableCellEditor.cancelCellEditing方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: btnRemoveActionPerformed
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
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()));
}
示例2: commitComponent
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
private void commitComponent(final Component container) {
if (container == null)
return;
if (container instanceof JTable) {
TableCellEditor cellEditor = ((JTable) container)
.getCellEditor();
if (cellEditor != null) {
try {
cellEditor.stopCellEditing();
} catch (Exception e) {
try {
cellEditor.cancelCellEditing();
} catch (Exception ex) {
}
}
}
}
}
示例3: commitComponent
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
private void commitComponent(final Component container) {
if (container == null)
return;
if (container instanceof JTable) {
TableCellEditor cellEditor = ((JTable) container).getCellEditor();
if (cellEditor != null) {
try {
cellEditor.stopCellEditing();
} catch (Exception e) {
try {
cellEditor.cancelCellEditing();
} catch (Exception ex) {
}
}
}
}
}
示例4: cancelEditor
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
private void cancelEditor() {
if (getInplaceEditor() != null) {
java.awt.Container parent = getParent();
while (parent != null && !(parent instanceof javax.swing.JTable)) {
parent = parent.getParent();
}
if (parent != null) {
TableCellEditor tce = ((javax.swing.JTable) parent).getCellEditor();
if (tce != null) {
tce.cancelCellEditing();
}
}
}
}
示例5: randomBindCheckBoxItemStateChanged
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
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();
}
示例6: removeStarImportPackageButtonActionPerformed
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
private void removeStarImportPackageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeStarImportPackageButtonActionPerformed
int row = starImportPackagesTable.getSelectedRow();
if (row >= 0) {
TableCellEditor cellEditor = starImportPackagesTable.getCellEditor();
if (cellEditor != null)
cellEditor.cancelCellEditing();
((DefaultTableModel)starImportPackagesTable.getModel()).removeRow(row);
}
}
示例7: removeButtonActionPerformed
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
int row = importLayoutTable.getSelectedRow();
if (row >= 0) {
TableCellEditor cellEditor = importLayoutTable.getCellEditor();
if (cellEditor != null)
cellEditor.cancelCellEditing();
((DefaultTableModel)importLayoutTable.getModel()).removeRow(row);
}
}
示例8: setQueueLength
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
private void setQueueLength() {
if (infiniteQueueSelector.isSelected()) {
queueLengthSpinner.setEnabled(false);
data.setStationQueueCapacity(stationKey, new Integer(-1));
TableCellEditor editor = queueTable.getCellEditor();
if (editor != null) {
editor.cancelCellEditing();
}
queueTable.repaint();
} else {
queueLengthSpinner.setEnabled(true);
data.setStationQueueCapacity(stationKey, (Integer) queueLengthSpinner.getValue());
queueTable.repaint();
}
}
示例9: actionPerformed
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
if ((editorTable.isEditing())) {
TableCellEditor editor = editorTable.getCellEditor();
if (editor != null)
editor.cancelCellEditing();
}
int[] is = editorTable.getSelectedRows();
List<Element> list = new ArrayList<Element>(is.length);
for (int i : is)
list.add(model
.getElement(editorTable.convertRowIndexToModel(i)));
model.removeElements(list);
}
示例10: cancelCellEditing
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
public void cancelCellEditing() {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.finer("Cancel Editing Row: "+getEditingRow());
}
final TableCellEditor tableCellEditor = getCellEditor();
if (tableCellEditor != null) {
tableCellEditor.cancelCellEditing();
}
}
示例11: cancelCellEditing
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
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();
}
}
示例12: attrStructureChanged
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
@Override
public void attrStructureChanged(AttrTableModelEvent e) {
if (e.getSource() != attrModel) {
attrModel.removeAttrTableModelListener(this);
return;
}
TableCellEditor ed = table.getCellEditor();
if (ed != null) {
ed.cancelCellEditing();
}
fireTableChanged();
}
示例13: attrValueChanged
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
@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();
}
示例14: setAttrTableModel
import javax.swing.table.TableCellEditor; //导入方法依赖的package包/类
void setAttrTableModel(AttrTableModel value) {
if (attrModel != value) {
TableCellEditor editor = table.getCellEditor();
if (editor != null) {
editor.cancelCellEditing();
}
attrModel.removeAttrTableModelListener(this);
attrModel = value;
attrModel.addAttrTableModelListener(this);
fireTableChanged();
}
}