javax.swing.JTable#isEditing ( )源码实例Demo

下面列出了javax.swing.JTable#isEditing ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: marathonv5   文件: RTable.java
public RTable(Component source, JSONOMapConfig omapConfig, Point point, IJSONRecorder recorder) {
    super(source, omapConfig, point, recorder);
    JTable table = (JTable) source;
    if (table.isEditing()) {
        column = table.getEditingColumn();
        row = table.getEditingRow();
    } else {
        if (point != null) {
            row = table.rowAtPoint(point);
            column = table.columnAtPoint(point);
        } else {
            row = table.getSelectedRow();
            column = table.getSelectedColumn();
        }
    }
    if (row == -1 || column == -1) {
        row = column = -1;
    }
}
 
源代码2 项目: netbeans   文件: BaseTable.java
public void actionPerformed(ActionEvent ae) {
    JTable jt = (JTable) ae.getSource();

    if (jt != null) {
        if (jt.isEditing()) {
            TableCellEditor tce = jt.getCellEditor();

            if (PropUtils.isLoggable(BaseTable.class)) {
                PropUtils.log(BaseTable.class, "Cancelling edit due to keyboard event"); //NOI18N
            }

            if (tce != null) {
                jt.getCellEditor().cancelCellEditing();
            }
        } else {
            //If we're in a dialog, try to close it
            trySendEscToDialog(jt);
        }
    }
}
 
源代码3 项目: marathonv5   文件: JTableJavaElement.java
@Override
public boolean marathon_select(String text) {
	JTable table = (JTable) component;
	boolean cellEditing = table.isEditing();
	if (cellEditing) {
		return true;
	}
	if ("".equals(text)) {
		table.clearSelection();
		return true;
	}
	int[] rows;
	int[] cols;
	if ("all".equals(text)) {
		int rowCount = table.getRowCount();
		int columnCount = table.getColumnCount();
		rows = new int[rowCount];
		cols = new int[columnCount];
		for (int i = 0; i < rowCount; i++) {
			rows[i] = i;
		}
		for (int i = 0; i < columnCount; i++) {
			cols[i] = i;
		}
	} else {
		rows = parseRows(text);
		String[] colNames = parseCols(text);
		cols = new int[colNames.length];
		for (int i = 0; i < colNames.length; i++) {
			cols[i] = getColumnIndex(colNames[i]);
		}
	}

	return selectRowsColumns(table, rows, cols);
}
 
源代码4 项目: jts   文件: GuiUtil.java
public static void commitChanges(JTable table) {
    if (table.isEditing()) {
        String text = ((JTextComponent) table.getEditorComponent()).getText();
        table.setValueAt(text, table.getEditingRow(), table.getEditingColumn());
        table.getCellEditor().cancelCellEditing();
    }
}
 
 方法所在类
 同类方法