本文整理汇总了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());
}
}
示例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)));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}