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


Java TableColumnExt.setSortable方法代码示例

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


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

示例1: 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

示例2: testTableUnsortedColumnOnColumnSortableChange

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * Issue 1131-swingx: table must unsort column on sortable change.
 * 
 * Invalid as of switch to core sorting. On the contrary, the table must
 * not go clever under the feat of the controller.
 * 
 */
@Test
public void testTableUnsortedColumnOnColumnSortableChange() {
    JXTable table = new JXTable(10, 2);
    TableColumnExt columnExt = table.getColumnExt(0);
    table.toggleSortOrder(0);
    assertTrue("sanity: sorted", SortUtils.isSorted(table.getSortOrder(0)));
    columnExt.setSortable(false);
    assertTrue("changing sortability must not change sort state (with default controller)", 
            SortUtils.isSorted(table.getSortOrder(0)));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:18,代码来源:JXTableUnitTest.java

示例3: testSetSortOrderByIdentifierColumnNotSortable

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * JXTable has responsibility to respect TableColumnExt
 * sortable property.
 * 
 */
@Test
public void testSetSortOrderByIdentifierColumnNotSortable() {
    JXTable table = new JXTable(sortableTableModel);
    Object identifier = "Last Name";
    TableColumnExt columnX = table.getColumnExt(identifier);
    //  make column not sortable.
    columnX.setSortable(false);
    table.setSortOrder(identifier, SortOrder.ASCENDING);
    assertEquals("unsortable column must be unsorted", SortOrder.UNSORTED, table.getSortOrder(identifier));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:JXTableUnitTest.java

示例4: testToggleSortOrderByIdentifierColumnNotSortable

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * JXTable has responsibility to respect TableColumnExt
 * sortable property.
 * 
 */
@Test
public void testToggleSortOrderByIdentifierColumnNotSortable() {
    JXTable table = new JXTable(sortableTableModel);
    Object identifier = "Last Name";
    TableColumnExt columnX = table.getColumnExt(identifier);
    // old way: make column not sortable.
    columnX.setSortable(false);
    table.toggleSortOrder(identifier);
    assertEquals("unsortable column must be unsorted", SortOrder.UNSORTED, table.getSortOrder(identifier));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:JXTableUnitTest.java

示例5: testSetSortOrderColumnNotSortable

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * JXTable has responsibility to respect TableColumnExt
 * sortable property.
 * 
 */
@Test
public void testSetSortOrderColumnNotSortable() {
    JXTable table = new JXTable(sortableTableModel);
    TableColumnExt columnX = table.getColumnExt(0);
    // old way: make column not sortable.
    columnX.setSortable(false);
    table.setSortOrder(0, SortOrder.ASCENDING);
    assertEquals("unsortable column must be unsorted", SortOrder.UNSORTED, table.getSortOrder(0));
   
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:JXTableUnitTest.java

示例6: testToggleSortOrderColumnNotSortable

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
/**
 * JXTable has responsibility to respect TableColumnExt
 * sortable property.
 * 
 */
@Test
public void testToggleSortOrderColumnNotSortable() {
    JXTable table = new JXTable(sortableTableModel);
    TableColumnExt columnX = table.getColumnExt(0);
    // old way: make column not sortable.
    columnX.setSortable(false);
    table.toggleSortOrder(0);
    assertEquals("unsortable column must be unsorted", SortOrder.UNSORTED, table.getSortOrder(0));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:15,代码来源:JXTableUnitTest.java

示例7: StatisticsTableColumnModel

import org.jdesktop.swingx.table.TableColumnExt; //导入方法依赖的package包/类
public StatisticsTableColumnModel(String... columns) {
    for (int i = 0; i < columns.length; i++) {
        TableColumnExt tableColumn = new TableColumnExt(i);
        tableColumn.setCellRenderer(statisticsTableCellRenderer);
        tableColumn.setHeaderValue(TextToHtmlSplitter.instance.split(columns[i]));
        if (i == 0) {
            tableColumn.setPreferredWidth(165);
        }
        tableColumn.setSortable(false);
        addColumn(tableColumn);
    }
    getSelectionModel().addListSelectionListener(statisticsListSelectionListener);
}
 
开发者ID:objektwerks,项目名称:swing,代码行数:14,代码来源:BenchmarkPortfolioStatisticsTable.java


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