I\'m using Wicket\'s Tree component in a web app. But empty folders are shown in a file-way. Just like this:
You can override Folder.getStyleClass to return the desired Icon. I got something like this:
@Override
protected String getStyleClass() {
String styleClass;
if (isFolder(getModelObject()))
{
if (tree.getState(matter) == State.EXPANDED)
{
styleClass = getOpenStyleClass();
} else {
styleClass = getClosedStyleClass();
}
} else {
styleClass = getOtherStyleClass(matter);
}
if (isSelected()) {
styleClass += " " + getSelectedStyleClass();
}
return styleClass;
}
Your implementation of isFolder() may vary.