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


Java TableColumnExt.setComparator方法代码示例

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


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

示例1: configureTableColumn

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * {@inheritDoc} <p>
 * 
 * Overridden to set the column's identifier, lookup the title 
 */
@Override
public void configureTableColumn(TableModel model,
        TableColumnExt columnExt) {
    super.configureTableColumn(model, columnExt);
    columnExt.setIdentifier(model.getColumnName(columnExt.getModelIndex()));
    configureTitle(columnExt);
    ComponentProvider<?> provider = getComponentProvider(columnExt.getIdentifier());
    if (provider != null) {
        columnExt.setCellRenderer(new DefaultTableRenderer(provider));
    }
    Highlighter highlighter = getHighlighter(columnExt.getIdentifier());
    if (highlighter != null) {
        columnExt.setHighlighters(highlighter);
    }
    columnExt.setComparator(getComparator(columnExt.getIdentifier()));
    columnExt.setPrototypeValue(getPrototypeValue(columnExt.getIdentifier()));
    if (getHiddenNames().contains(columnExt.getIdentifier())) {
        columnExt.setVisible(false);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:26,代码来源:CustomColumnFactory.java

示例2: testComparatorToController

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * JXTable has responsibility to guarantee usage of 
 * TableColumnExt comparator.
 * 
 */
@Test
public void testComparatorToController() {
    JXTable table = new JXTable(new AncientSwingTeam());
    TableColumnExt columnX = table.getColumnExt(0);
    columnX.setComparator(Collator.getInstance());
    assertSame(columnX.getComparator(), getSortController(table).getComparator(columnX.getModelIndex()));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:13,代码来源:JXTableUnitTest.java

示例3: testComparatorToControllerInSetSorter

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * JXTable has responsibility to guarantee usage of 
 * TableColumnExt comparator.
 * 
 */
@Test
public void testComparatorToControllerInSetSorter() {
    JXTable table = new JXTable(new AncientSwingTeam());
    TableColumnExt columnX = table.getColumnExt(0);
    columnX.setComparator(Collator.getInstance());
    table.setRowSorter(new TableSortController<TableModel>(table.getModel()));
    assertSame(columnX.getComparator(), getSortController(table).getComparator(columnX.getModelIndex()));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:14,代码来源:JXTableUnitTest.java

示例4: configureTableColumn

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
@Override
public void configureTableColumn(TableModel model,
        TableColumnExt columnExt) {
    super.configureTableColumn(model, columnExt);
    if (columnExt.getModelIndex() % 2 != 0) {
        // make odd columns not-sortable
        columnExt.setSortable(false);
    } else {
        // set per-column comparator for even columns
        columnExt.setComparator(Collator.getInstance());
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:13,代码来源:JXTableUnitTest.java


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