本文整理汇总了Java中org.onosproject.ui.table.TableModel.SortDir类的典型用法代码示例。如果您正苦于以下问题:Java SortDir类的具体用法?Java SortDir怎么用?Java SortDir使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortDir类属于org.onosproject.ui.table.TableModel包,在下文中一共展示了SortDir类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sortAndFormat
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortAndFormat() {
initUnsortedTable();
// set hex formatter
tm.setFormatter(BAR, HexFormatter.INSTANCE);
// sort by number
tm.sort(BAR, SortDir.ASC, null, null);
// verify results
rows = tm.getRows();
int nr = rows.length;
assertEquals("row count", SORTED_HEX.length, nr);
for (int i = 0; i < nr; i++) {
assertEquals(UNEX_SORT + i, SORTED_HEX[i], rows[i].getAsString(BAR));
}
}
示例2: enumSort
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void enumSort() {
tm = new TableModel(FOO);
tm.addRow().cell(FOO, StarWars.HAN_SOLO);
tm.addRow().cell(FOO, StarWars.C3PO);
tm.addRow().cell(FOO, StarWars.JABBA_THE_HUTT);
tm.addRow().cell(FOO, StarWars.LEIA_ORGANA);
tm.addRow().cell(FOO, StarWars.R2D2);
tm.addRow().cell(FOO, StarWars.LUKE_SKYWALKER);
tm.sort(FOO, SortDir.ASC, null, null);
// verify expected results
StarWars[] ordered = StarWars.values();
TableModel.Row[] rows = tm.getRows();
assertEquals("wrong length?", ordered.length, rows.length);
int nr = rows.length;
for (int i = 0; i < nr; i++) {
assertEquals(UNEX_SORT + i, ordered[i], rows[i].get(FOO));
}
}
示例3: tableStringSort
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void tableStringSort() {
initUnsortedTable();
// sort by name
tm.sort(FOO, SortDir.ASC, null, null);
// verify results
rows = tm.getRows();
int nr = rows.length;
assertEquals("row count", NAMES.length, nr);
for (int i = 0; i < nr; i++) {
assertEquals(UNEX_SORT + i, SORTED_NAMES[i], rows[i].get(FOO));
}
// now the other way
tm.sort(FOO, SortDir.DESC, null, null);
// verify results
rows = tm.getRows();
nr = rows.length;
assertEquals("row count", NAMES.length, nr);
for (int i = 0; i < nr; i++) {
assertEquals(UNEX_SORT + i,
SORTED_NAMES[nr - 1 - i], rows[i].get(FOO));
}
}
示例4: tableNumberSort
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void tableNumberSort() {
initUnsortedTable();
// sort by number
tm.sort(BAR, SortDir.ASC, null, null);
// verify results
rows = tm.getRows();
int nr = rows.length;
assertEquals("row count", NUMBERS.length, nr);
for (int i = 0; i < nr; i++) {
assertEquals(UNEX_SORT + i, SORTED_NUMBERS[i], rows[i].get(BAR));
}
// now the other way
tm.sort(BAR, SortDir.DESC, null, null);
// verify results
rows = tm.getRows();
nr = rows.length;
assertEquals("row count", NUMBERS.length, nr);
for (int i = 0; i < nr; i++) {
assertEquals(UNEX_SORT + i,
SORTED_NUMBERS[nr - 1 - i], rows[i].get(BAR));
}
}
示例5: sortAndFormatTwo
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortAndFormatTwo() {
initUnsortedTable();
tm.setFormatter(BAR, HexFormatter.INSTANCE);
tm.sort(FOO, SortDir.ASC, null, null);
rows = tm.getRows();
int nr = rows.length;
for (int i = 0; i < nr; i++) {
String[] exp = SORTED_NAMES_AND_HEX[i];
String[] act = rows[i].getAsFormattedStrings();
assertArrayEquals(UNEX_SORT + i, exp, act);
}
}
示例6: sortAlphaAscNumberAsc
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortAlphaAscNumberAsc() {
tm = unsortedDoubleTableModel();
verifyRowOrder("unsorted", tm, UNSORTED_IDS);
tm.sort(ALPHA, SortDir.ASC, NUMBER, SortDir.ASC);
verifyRowOrder("aana", tm, ROW_ORDER_AA_NA);
}
示例7: sortAlphaDescNumberAsc
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortAlphaDescNumberAsc() {
tm = unsortedDoubleTableModel();
verifyRowOrder("unsorted", tm, UNSORTED_IDS);
tm.sort(ALPHA, SortDir.DESC, NUMBER, SortDir.ASC);
verifyRowOrder("adna", tm, ROW_ORDER_AD_NA);
}
示例8: sortAlphaAscNumberDesc
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortAlphaAscNumberDesc() {
tm = unsortedDoubleTableModel();
verifyRowOrder("unsorted", tm, UNSORTED_IDS);
tm.sort(ALPHA, SortDir.ASC, NUMBER, SortDir.DESC);
verifyRowOrder("aand", tm, ROW_ORDER_AA_ND);
}
示例9: sortAlphaDescNumberDesc
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortAlphaDescNumberDesc() {
tm = unsortedDoubleTableModel();
verifyRowOrder("unsorted", tm, UNSORTED_IDS);
tm.sort(ALPHA, SortDir.DESC, NUMBER, SortDir.DESC);
verifyRowOrder("adnd", tm, ROW_ORDER_AD_ND);
}
示例10: sortDirAsc
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortDirAsc() {
assertEquals("asc sort dir", SortDir.ASC, TableModel.sortDir("asc"));
}
示例11: sortDirDesc
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortDirDesc() {
assertEquals("desc sort dir", SortDir.DESC, TableModel.sortDir("desc"));
}
示例12: sortDirOther
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortDirOther() {
assertEquals("other sort dir", SortDir.ASC, TableModel.sortDir("other"));
}
示例13: sortDirNull
import org.onosproject.ui.table.TableModel.SortDir; //导入依赖的package包/类
@Test
public void sortDirNull() {
assertEquals("null sort dir", SortDir.ASC, TableModel.sortDir(null));
}