2
在我的項目中,我使用gwt 2.5.1和gxt 3.0.1。 我創建樹。更改節點樣式
protected void createTree(TreeStore<ProjectExtended> treeStore) {
ValueProvider<ProjectExtended, SafeHtml> provider = new ValueProvider<ProjectExtended, SafeHtml>() {
@Override
public void setValue(ProjectExtended object, SafeHtml value) {
}
@Override
public SafeHtml getValue(ProjectExtended object) {
if(object == null) return SafeHtmlUtils.EMPTY_SAFE_HTML;
if (!object.getActive()) {
return SafeHtmlUtils.fromTrustedString(
"<span class=\"projectNotActive\">" + object.getName() +
"</span> " + "<span class=\"dictIdText\"> (" +
object.getId() + "/" + object.getParentId() + ") </span>");
} else {
return SafeHtmlUtils.fromTrustedString(
object.getName() + "<span class=\"dictIdText\"> (" +
object.getId() + "/" + object.getParentId() + ") </span>");
}
}
@Override
public String getPath() {
return "name";
}
};
Tree<ProjectExtended, SafeHtml> tree = new Tree<ProjectExtended, SafeHtml>(treeStore, provider);
tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
add(tree);
}
我嘗試改變未激活的節點的樣式。但我無法解決這個問題,因爲瀏覽器顯示它們錯了!
http://i.stack.imgur.com/0Jmdq.png
是有沒有辦法解決此問題的方法?