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


Java JTable.isEditing方法代码示例

本文整理汇总了Java中javax.swing.JTable.isEditing方法的典型用法代码示例。如果您正苦于以下问题:Java JTable.isEditing方法的具体用法?Java JTable.isEditing怎么用?Java JTable.isEditing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTable的用法示例。


在下文中一共展示了JTable.isEditing方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import javax.swing.JTable; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:BaseTable.java

示例2: RTable

import javax.swing.JTable; //导入方法依赖的package包/类
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;
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:RTable.java

示例3: stopEditing

import javax.swing.JTable; //导入方法依赖的package包/类
private void stopEditing(JTable table) {
	if (table.isEditing()) {
		if (!table.getCellEditor().stopCellEditing()) {
			table.getCellEditor().cancelCellEditing();
		}
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:8,代码来源:ClickableTableHeader.java

示例4: marathon_select

import javax.swing.JTable; //导入方法依赖的package包/类
@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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:35,代码来源:JTableJavaElement.java

示例5: focusLost

import javax.swing.JTable; //导入方法依赖的package包/类
public void focusLost(FocusEvent event) {
  if (event.getComponent() instanceof JTable) {
    JTable table = (JTable) event.getComponent();
    if (table.isEditing()) {
      table.getCellEditor().stopCellEditing();
    }
  }
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:9,代码来源:PropertySheet.java

示例6: removeRow

import javax.swing.JTable; //导入方法依赖的package包/类
@Override
public void removeRow(JTable jTable){

	int colIndexTable = jTable.getSelectedColumn();
	int rowIndexTable = jTable.getSelectedRow();
	
	int rowIndexModel = 0;
	int rowIndexTableNew = 0;
	int rowIndexModelNew = 0;
	
	// --- Stop editing -----------------
	if(jTable.isEditing()){
		jTable.getCellEditor().cancelCellEditing();
	}
	
	// ---- Last row of data series? ----
	if(jTable.getRowCount()==1){
		while(parentDataModel.getSeriesCount()>0){
			try {
				parentDataModel.removeSeries(0);
			} catch (NoSuchSeriesException e1) {
				// This cannot happen, as there where clause prevents empty models  
			}
		}
		rowIndexModelNew = -1;
		rowIndexTableNew = -1;
		
	}else{
		
		if ((rowIndexTable+1) > jTable.getRowCount()) {
			rowIndexTable = jTable.getRowCount() - 1;
		}
		Number key = (Number) jTable.getValueAt(rowIndexTable, 0);
		rowIndexModel = jTable.convertRowIndexToModel(rowIndexTable);
		((TimeSeriesDataModel)parentDataModel).removeValuePairsFromAllSeries(key);
		
		rowIndexModelNew = rowIndexModel;
		if (rowIndexModelNew>=jTable.getRowCount()) {
			rowIndexModelNew = jTable.getRowCount()-1;
		}
		rowIndexTableNew = jTable.convertRowIndexToView(rowIndexModelNew);
		
	}
	
	// --- Set new selection ------------
	if(rowIndexTableNew==-1){
		jTable.clearSelection();
	} else {
		jTable.setRowSelectionInterval(rowIndexTableNew, rowIndexTableNew);
		jTable.changeSelection(rowIndexTableNew, colIndexTable, false, false);
	}
	
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:54,代码来源:TimeSeriesTableModel.java


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