else if ("single".equals(selectionMode.getSelectedItem())) { tree.getSelectionModel().setSelectionMode(STree.SINGLE_SELECTION); tree.setSelectionModel(SDefaultTreeSelectionModel.SINGLE_SELECTION_MODEL);
else if (SELECTION_MODES[1].equals(selectionMode.getSelectedItem())) { tree.getSelectionModel().setSelectionMode(STree.CONTIGUOUS_TREE_SELECTION);
        public TreeControls() {            final SCheckBox showAsFormComponent = new SCheckBox("<html>Show as Form Component&nbsp;&nbsp;&nbsp;");            showAsFormComponent.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    tree.setShowAsFormComponent(showAsFormComponent.isSelected());                }            });            final SComboBox selectionMode = new SComboBox(SELECTION_MODES);            selectionMode.addItemListener(new ItemListener() {                public void itemStateChanged(ItemEvent e) {                    if ("no".equals(selectionMode.getSelectedItem())) {                        tree.getSelectionModel().setSelectionMode(STree.NO_SELECTION);                        tree.setSelectionModel(SDefaultTreeSelectionModel.NO_SELECTION_MODEL);                    }                    else if ("single".equals(selectionMode.getSelectedItem())) {                        tree.getSelectionModel().setSelectionMode(STree.SINGLE_SELECTION);                        tree.setSelectionModel(SDefaultTreeSelectionModel.SINGLE_SELECTION_MODEL);                    }                    else if ("multiple".equals(selectionMode.getSelectedItem())) {                        tree.getSelectionModel().setSelectionMode(STree.MULTIPLE_SELECTION);                        tree.setSelectionModel(SDefaultTreeSelectionModel.MULTIPLE_SELECTION_MODEL);                    }                }            });            final SComboBox indentationWidth = new SComboBox(WIDTHS);            // sync indentation width of tree with controller            indentationWidth.setSelectedIndex(3); // set to 24px indent            tree.setNodeIndentDepth(WIDTHS[3].intValue());            // now add the listener            indentationWidth.addItemListener(new ItemListener() {                public void itemStateChanged(ItemEvent e) {                    tree.setNodeIndentDepth(((Integer) indentationWidth.getSelectedItem()).intValue());                }            });            final SRadioButton plusButton = new SRadioButton("plus/minus");            plusButton.setToolTipText("use [+] and [-] as expansion controls");            final SRadioButton arrowButton = new SRadioButton("arrows");            arrowButton.setToolTipText("use right-arrow and down-arrow as expansion controls");            SButtonGroup group = new SButtonGroup();            group.add(plusButton);            group.add(arrowButton);            plusButton.setSelected(true);            group.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent e) {                    if (plusButton.isSelected()) {                        PropertyAccessor.setProperty(tree.getCG(), "collapseControlIcon", MINUS);                        PropertyAccessor.setProperty(tree.getCG(), "expandControlIcon", PLUS);                    } else {                        PropertyAccessor.setProperty(tree.getCG(), "collapseControlIcon", ARROW_DOWN);                        PropertyAccessor.setProperty(tree.getCG(), "expandControlIcon", ARROW_RIGHT);                    }                }            });            add(showAsFormComponent);            add(new SLabel(" selection mode "));            add(selectionMode);            add(new SLabel(" indentation width "));            add(indentationWidth);            add(new SLabel(" folding icons "));            add(plusButton);            add(arrowButton);        }