本文整理汇总了Java中org.jdesktop.swingx.table.TableColumnExt.setEditable方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumnExt.setEditable方法的具体用法?Java TableColumnExt.setEditable怎么用?Java TableColumnExt.setEditable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.table.TableColumnExt
的用法示例。
在下文中一共展示了TableColumnExt.setEditable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTableCanceledEditOnColumnEditableChange
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* Issue 372-swingx: table must cancel edit if column property
* changes to not editable.
* Here we test if the table actually canceled the edit.
*/
@Test
public void testTableCanceledEditOnColumnEditableChange() {
JXTable table = new JXTable(10, 2);
TableColumnExt columnExt = table.getColumnExt(0);
table.editCellAt(0, 0);
// sanity
assertTrue(table.isEditing());
assertEquals(0, table.getEditingColumn());
TableCellEditor editor = table.getCellEditor();
CellEditorReport report = new CellEditorReport();
editor.addCellEditorListener(report);
columnExt.setEditable(false);
// sanity
assertFalse(table.isCellEditable(0, 0));
assertEquals("editor must have fired canceled", 1, report.getCanceledEventCount());
assertEquals("editor must not have fired stopped",0, report.getStoppedEventCount());
}
示例2: testTableNotEditingOnColumnEditableChange
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* Issue 372-swingx: table must cancel edit if column property
* changes to not editable.
* Here we test if the table is not editing after editable property
* of the currently edited column is changed to false.
*/
@Test
public void testTableNotEditingOnColumnEditableChange() {
JXTable table = new JXTable(10, 2);
TableColumnExt columnExt = table.getColumnExt(0);
table.editCellAt(0, 0);
// sanity
assertTrue(table.isEditing());
assertEquals(0, table.getEditingColumn());
columnExt.setEditable(false);
assertFalse(table.isCellEditable(0, 0));
assertFalse("table must have terminated edit",table.isEditing());
}
示例3: testTableEditingOnNotEditingColumnEditableChange
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* Issue 372-swingx: table must cancel edit if column property
* changes to not editable.
* Here we test if the table is still editing after the editability
* change of a non-edited column.
*
*/
@Test
public void testTableEditingOnNotEditingColumnEditableChange() {
JXTable table = new JXTable(10, 2);
int notEditingColumn = 1;
TableColumnExt columnExt = table.getColumnExt(notEditingColumn);
table.editCellAt(0, 0);
// sanity
assertTrue(table.isEditing());
assertEquals(0, table.getEditingColumn());
columnExt.setEditable(false);
assertFalse(table.isCellEditable(0, notEditingColumn));
assertTrue("table must still be editing", table.isEditing());
}
示例4: testTableEditingOnHiddenColumnEditableChange
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
* Issue 372-swingx: table must cancel edit if column property
* changes to not editable.
* Here we test if the table is still editing after the editability
* change of a non-edited column, special case of hidden column. <p>
* NOTE: doesn't really test, the columnModel doesn't
* fire propertyChanges for hidden columns (see Issue #??-swingx)
*
*/
@Test
public void testTableEditingOnHiddenColumnEditableChange() {
JXTable table = new JXTable(10, 2);
int hiddenNotEditingColumn = 1;
TableColumnExt columnExt = table.getColumnExt(hiddenNotEditingColumn);
columnExt.setVisible(false);
table.editCellAt(0, 0);
// sanity
assertTrue(table.isEditing());
assertEquals(0, table.getEditingColumn());
columnExt.setEditable(false);
assertTrue("table must still be editing", table.isEditing());
}
示例5: updateColumnExtFromMetaInfo
import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
private static final void updateColumnExtFromMetaInfo(final TableColumnExt columnExt, final TableColumnInfo columnMetaInfo)
{
columnExt.setEditable(columnMetaInfo.isEditable());
columnExt.setVisible(columnMetaInfo.isVisible());
columnExt.setPrototypeValue(columnMetaInfo.getPrototypeValue());
}