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


Java TableColumnExt.setEditable方法代码示例

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

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

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

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

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


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