javax.swing.table.TableCellEditor#addCellEditorListener ( )源码实例Demo

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

源代码1 项目: rapidminer-studio   文件: EditableTableHeader.java
public boolean editCellAt(int index, EventObject e) {
	if (cellEditor != null && !cellEditor.stopCellEditing()) {
		return false;
	}
	if (!isCellEditable(index)) {
		return false;
	}
	TableCellEditor editor = getCellEditor(index);

	if (editor != null && editor.isCellEditable(e)) {
		editorComp = prepareEditor(editor, index);
		editorComp.setBounds(getHeaderRect(index));
		add(editorComp);
		editorComp.validate();
		setCellEditor(editor);
		setEditingColumn(index);
		editor.addCellEditorListener(this);

		return true;
	}
	return false;
}
 
源代码2 项目: pentaho-reporting   文件: EditableHeader.java
public boolean editCellAt( final int index, final EventObject e ) {
  if ( cellEditor != null && !cellEditor.stopCellEditing() ) {
    return false;
  }
  if ( !isCellEditable( index ) ) {
    return false;
  }
  final TableCellEditor editor = getCellEditor( index );

  if ( editor != null && editor.isCellEditable( e ) ) {
    editorComp = prepareEditor( editor, index );
    editorComp.setBounds( getHeaderRect( index ) );
    add( editorComp );
    editorComp.validate();
    setCellEditor( editor );
    setEditingColumn( index );
    editor.addCellEditorListener( this );

    return true;
  }
  return false;
}
 
源代码3 项目: chipster   文件: EditableHeader.java
public boolean editCellAt(int index, EventObject e){
	if (cellEditor != null && !cellEditor.stopCellEditing()) { 
		return false;
	}
	if (!isCellEditable(index)) {
		return false;
	}    
	TableCellEditor editor = getCellEditor(index);

	if (editor != null && editor.isCellEditable(e)) {
		editorComp = prepareEditor(editor, index);
		editorComp.setBounds(getHeaderRect(index));
		add(editorComp);
		editorComp.validate();
		setCellEditor(editor);
		setEditingColumn(index);
		editor.addCellEditorListener(this);

		return true;
	}    
	return false;
}
 
源代码4 项目: gate-core   文件: AlternatingTableCellEditor.java
/**
 * Add the specified listener to <em>all</em> the delegate editors.
 * @param l the listener to add
 */
@Override
public void addCellEditorListener(CellEditorListener l) {
  for(TableCellEditor e : editors) {
    e.addCellEditorListener(l);
  }
}
 
源代码5 项目: rapidminer-studio   文件: PropertyTable.java
/**
 * Programmatically starts editing the cell at <code>row</code> and <code>column</code>, if
 * those indices are in the valid range, and the cell at those indices is editable. To prevent
 * the <code>JTable</code> from editing a particular table, column or cell value, return false
 * from the <code>isCellEditable</code> method in the <code>TableModel</code> interface.
 * 
 * @param row
 *            the row to be edited
 * @param column
 *            the column to be edited
 * @param e
 *            event to pass into <code>shouldSelectCell</code>; note that as of Java 2 platform
 *            v1.2, the call to <code>shouldSelectCell</code> is no longer made
 * @return false if for any reason the cell cannot be edited, or if the indices are invalid
 */
@Override
public boolean editCellAt(int row, int column, EventObject e) {
	if (cellEditor != null && !cellEditor.stopCellEditing()) {
		return false;
	}

	if (row < 0 || row >= getRowCount() || column < 0 || column >= getColumnCount()) {
		return false;
	}

	if (!isCellEditable(row, column)) {
		return false;
	}

	TableCellEditor editor = getCellEditor(row, column);
	if (editor != null && editor.isCellEditable(e)) {
		editorComp = prepareEditor(editor, row, column);
		if (editorComp == null) {
			removeEditor();
			return false;
		}
		editorComp.setBounds(getCellRect(row, column, false));
		add(editorComp);
		editorComp.validate();
		editorComp.repaint();

		setCellEditor(editor);
		setEditingRow(row);
		setEditingColumn(column);
		editor.addCellEditorListener(this);

		return true;
	}
	return false;
}
 
源代码6 项目: rapidminer-studio   文件: EditableTableHeader.java
public void setCellEditor(TableCellEditor newEditor) {
	TableCellEditor oldEditor = cellEditor;
	cellEditor = newEditor;

	// firePropertyChange

	if (oldEditor != null) {
		oldEditor.removeCellEditorListener(this);
	}
	if (newEditor != null) {
		newEditor.addCellEditorListener(this);
	}
}
 
源代码7 项目: pentaho-reporting   文件: EditableHeader.java
public void setCellEditor( final TableCellEditor newEditor ) {
  final TableCellEditor oldEditor = cellEditor;
  cellEditor = newEditor;
  if ( oldEditor != null ) {
    oldEditor.removeCellEditorListener( this );
  }
  if ( newEditor != null ) {
    newEditor.addCellEditorListener( this );
  }
}