use of it.cnr.imaa.essi.lablib.gui.checkboxtree.TreeCheckingEvent in project adempiere by adempiere.
the class RadioButtonTreeCellRenderer method main.
public static void main(String[] args) {
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
DefaultMutableTreeNode one = new DefaultMutableTreeNode("one");
DefaultMutableTreeNode two = new DefaultMutableTreeNode("two");
DefaultMutableTreeNode three = new DefaultMutableTreeNode("three");
root.add(one);
root.add(two);
root.add(three);
RadioButtonTreeCellRenderer m_RadioButtonTreeCellRenderer = new RadioButtonTreeCellRenderer();
final CheckboxTree tree = new CheckboxTree(m_RadioButtonTreeCellRenderer.action_loadBOM(null, false));
tree.getCheckingModel().setCheckingMode(it.cnr.imaa.essi.lablib.gui.checkboxtree.TreeCheckingModel.CheckingMode.SIMPLE);
tree.getCheckingModel().clearChecking();
tree.setCellRenderer(m_RadioButtonTreeCellRenderer);
tree.addTreeCheckingListener(new TreeCheckingListener() {
public void valueChanged(TreeCheckingEvent e) {
log.fine("Checked paths changed: user clicked on " + (e.getLeadingPath().getLastPathComponent()));
// TreeModel tm = tree.getModel();
// TreePath selected = tree.getSelectionPath();
// TreeCheckingModel checkingModel = ((CheckboxTree)tree).getCheckingModel();
}
});
JFrame frame = new JFrame("RadioButton tree");
frame.add(tree);
tree.expandAll();
frame.pack();
frame.setVisible(true);
}
Aggregations