当前位置: 首页>>代码示例>>Java>>正文


Java TableCellEditor.cancelCellEditing方法代码示例

本文整理汇总了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()));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ToDoCustomizer.java

示例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) {

                }
            }
        }
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:20,代码来源:BaseDialog.java

示例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) {

                }
            }
        }
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:19,代码来源:BaseDialog.java

示例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();
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:EditablePropertyDisplayer.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:RunPortBindingsVisual.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:FmtImports.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:FmtImports.java

示例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();
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:16,代码来源:InputSectionPanel.java

示例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);
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:15,代码来源:TableEditor.java

示例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();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XMBeanAttributes.java

示例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();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:XMBeanAttributes.java

示例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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:13,代码来源:AttrTable.java

示例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();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:14,代码来源:AttrTable.java

示例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();
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:13,代码来源:AttrTable.java


注:本文中的javax.swing.table.TableCellEditor.cancelCellEditing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。