tree.setCheckNodes(CheckNodes.BOTH);
}
}
});
ToolBar toolBar = new ToolBar();
toolBar.setBorders(true);
toolBar.add(new Button("Get Checked", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
StringBuffer sb = new StringBuffer();
for (ModelData item : tree.getCheckedSelection()) {
sb.append(", " + (String) item.get("name"));
}
String s = sb.toString();
if (s.length() > 1) s = s.substring(2);
Info.display("Checked Items", Format.ellipse(s, 100), "");
}
}));
toolBar.add(new SeparatorToolItem());
toolBar.add(new LabelToolItem("Cascade Behavior: "));
toolBar.add(cascade);
toolBar.add(new SeparatorToolItem());
toolBar.add(new LabelToolItem("CheckNode Behavior: "));
toolBar.add(checkNodes);
add(toolBar, new FlowData(10));
add(tree, new FlowData(10));
}