我想更改Column
的默认排序,以便它只在第一层按字母顺序排序,并按其余层上的jcr节点排序。
老实说,我不知道从哪里开始。首先,我试图扩展现有的TreePresenterDefinition
,但很快我意识到这是错误的方式。
目前,我尝试扩展PropertyColumnDefinition
并编写自己的ColumnFormatter
。
任何人都可以给我指导一下吗?
愿望, Hellfiend
答案 0 :(得分:1)
最有可能你应该触摸容器,例如,可以为你的应用程序扩展 AbstractJcrContainer 并根据你的意愿设置排序,基本上可以按照这种方式进行排序; (Vaadin方式)
IndexedContainer ic = new IndexedContainer() {
@Override
public Collection<?> getSortableContainerPropertyIds() {
// Default implementation allows sorting only if the property
// type can be cast to Comparable
return getContainerPropertyIds();
}
};
ic.setItemSorter(new DefaultItemSorter(new Comparator<Object>() {
public int compare(Object o1, Object o2) {
}
}));
希望这有帮助,
干杯,