icefaces王牌树样式破碎

时间:2013-05-24 09:25:34

标签: java jsf icefaces icefaces-3

我正在使用延迟加载的冰面的ace:tree组件。

在post构造中初始化:

    lazyTreeModel = new LazyNodeDataModel<ProjektPaketNode>() {

        private List<ProjektPaketNode> treeRoots = initialize();

        private List<ProjektPaketNode> initialize() {

            List<ProjektPaketNode> result = new ArrayList<ProjektPaketNode>(); 
            for (ProjektPaket paket : projektPaketDAO.findAllRoots()) {
                result.add(new ProjektPaketNode(paket));
            }

            return result;
        }

        @Override
        public List<ProjektPaketNode> loadChildrenForNode(ProjektPaketNode node) {
            if (node == null) {
                return treeRoots;
            }
            return node.getChildren();
        }
    };

这是树节点实现

private List<ProjektPaketNode> children = new ArrayList<ProjektPaketNode>();
private ProjektPaket projektPaket;

public ProjektPaketNode(ProjektPaket pProjektPaket) {
    this.projektPaket = pProjektPaket;
    for (ProjektPaket p : projektPaket.getChildren()) {
        children.add(new ProjektPaketNode(p));
    }
}

@Override
public TreeNode getChildAt(int i) {
    if (children == null) {
        return null;
    }
    return children.get(i);
}

@Override
public int getChildCount() {

    if (children != null) {
        return children.size();
    }
    return 0;
}

@Override
public TreeNode getParent() {
    return new ProjektPaketNode(projektPaket.getProjektPaket());
}

@Override
public int getIndex(TreeNode treeNode) {
    return children.indexOf(treeNode);
}

@Override
public boolean getAllowsChildren() {
    return children != null;
}

@Override
public boolean isLeaf() {
    return getChildCount() == 0;
}

@Override
public Enumeration children() {
    if (children == null) {
        return IteratorUtils.asEnumeration(IteratorUtils.emptyIterator());
    }
    return IteratorUtils.asEnumeration(children.iterator());
}

public List<ProjektPaketNode> getChildren() {

    if (isLeaf()) {
        return Collections.emptyList();
    }

    return children;
}

public ProjektPaket getProjektPaket() {
    return projektPaket;
}

public void setProjektPaket(ProjektPaket projektPaket) {
    this.projektPaket = projektPaket;
}

这是我的问题。树看起来不像冰面展示的那样。这就是它的样子:

enter image description here

1 个答案:

答案 0 :(得分:0)

噢,嗯,它完成了。问题是我自己的css类,它为所有TD设置了一般填充。