Magnolia 5.4.7更改列分类

时间:2016-07-21 10:02:10

标签: java vaadin magnolia

我想更改Column的默认排序,以便它只在第一层按字母顺序排序,并按其余层上的jcr节点排序。

老实说,我不知道从哪里开始。首先,我试图扩展现有的TreePresenterDefinition,但很快我意识到这是错误的方式。 目前,我尝试扩展PropertyColumnDefinition并编写自己的ColumnFormatter

任何人都可以给我指导一下吗?

愿望, Hellfiend

1 个答案:

答案 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) {                

            }
        }));

希望这有帮助,

干杯,