Examples of CheckBoxTree


Examples of com.intellij.ui.CheckboxTree

    private CheckBoxTreeWrapper(CheckedTreeNode rootNode) {
        topPanel = new JDialog();
        topPanel.setTitle(Constants.APPLICATION_SELECTION_TITLE);

        tree = new CheckboxTree(new AppRenderer(), rootNode);
        JScrollPane jScrollPane = new JBScrollPane(tree);
        jScrollPane.setPreferredSize(new Dimension(600, 400));
        topPanel.getContentPane().add(jScrollPane, BorderLayout.CENTER);

        JPanel buttonPanel = getButtonsPanel();
View Full Code Here

Examples of com.jidesoft.swing.CheckBoxTree

    public CheckBoxTreeBinder(String[] supportedContextKeys) {
        super(null, supportedContextKeys);
    }
   
  protected JComponent createControl(Map arg0) {
    CheckBoxTree tree = new CheckBoxTree();
    return tree;
  }
View Full Code Here

Examples of com.jidesoft.swing.CheckBoxTree

    return tree;
  }
 
  protected Binding doBind(JComponent control, FormModel formModel, String formPropertyPath, Map context) {
    Assert.isTrue(control instanceof CheckBoxTree, formPropertyPath);
    CheckBoxTree list = (CheckBoxTree)control;
    CheckBoxTreeBinding binding = new CheckBoxTreeBinding(list,
        formModel, formPropertyPath);
    applyContext(binding, context);
    return binding;
  }
View Full Code Here

Examples of com.jidesoft.swing.CheckBoxTree

 
  public KSTree(CTIRConnection oracle) {
    this.setMinimumSize(new Dimension(195,350));
    this.setPreferredSize(new Dimension(195,350));
    this.oracle = oracle;
    tree = new CheckBoxTree();
    loadTree();
    this.setViewportView(tree);
    return;
  }
View Full Code Here

Examples of com.jidesoft.swing.CheckBoxTree

 
  public KSTree(CTIRConnection oracle) {
    this.setMinimumSize(new Dimension(195,350));
    this.setPreferredSize(new Dimension(195,350));
    this.oracle = oracle;
    tree = new CheckBoxTree();
    loadTree();
    this.setViewportView(tree);
    return;
  }
View Full Code Here

Examples of it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTree

     *
     * @return it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTree
     */
    private JScrollPane getCheckboxTree() {
  if (this.checkboxTree == null) {
      this.checkboxTree = new CheckboxTree();
      this.checkboxTree.getCheckingModel().setCheckingMode(TreeCheckingModel.CheckingMode.PROPAGATE);
      DefaultMutableTreeNode root = (DefaultMutableTreeNode) this.checkboxTree.getModel().getRoot();

      DefaultMutableTreeNode ravioli = (DefaultMutableTreeNode) root.getChildAt(2).getChildAt(2);// ravioli;

View Full Code Here

Examples of it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTree

* @author boldrini
*/
public class CheckboxTreeApplet extends JApplet {

    private void createGUI() {
  final CheckboxTree tree = new CheckboxTree();
  tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);// SINGLE_TREE_SELECTION);

  // Events panel
  JPanel eventsPanel = new JPanel();
  Border eventsBorder = BorderFactory.createTitledBorder("Events");
  eventsPanel.setBorder(eventsBorder);
  final JTextArea textArea = new JTextArea(7, 20);
  textArea.setLineWrap(true);
  JScrollPane textPane = new JScrollPane(textArea);
  tree.addTreeCheckingListener(new TreeCheckingListener() {
      public void valueChanged(TreeCheckingEvent e) {
    // convert(e.getLeadingPath());
    textArea.append("Checking event source: " + (e.getPath().getLastPathComponent()) + "\n");
      }

      // private void convert(TreePath changedPath) {
      // Object[] path = changedPath.getPath();
      // TreeModel tm = tree.getModel();
      // for (int i = 0; i < path.length - 1; i++) {
      // System.out.println(tm.getIndexOfChild(path[i], path[i + 1]));
      // }
      // System.out.println();
      // }
  });
  eventsPanel.add(textPane);

  // Modes panel
  JPanel modesPanel = new JPanel(new GridLayout(0, 1));
  Border border = BorderFactory.createTitledBorder("Checking Mode");
  modesPanel.setBorder(border);
  ButtonGroup group = new ButtonGroup();
  JRadioButton aRadioButton = null;
  final CheckingMode modes[] = { CheckingMode.SIMPLE, CheckingMode.PROPAGATE, CheckingMode.PROPAGATE_PRESERVING_UNCHECK,
    CheckingMode.PROPAGATE_PRESERVING_CHECK };
  for (int i = 0, n = modes.length; i < n; i++) {
      final int g = i;
      ActionListener modeListener = new ActionListener() {
    public void actionPerformed(ActionEvent actionEvent) {
        tree.getCheckingModel().clearChecking();
        tree.getCheckingModel().setCheckingMode(modes[g]);
    }
      };
      aRadioButton = new JRadioButton(modes[i].toString());
      modesPanel.add(aRadioButton);
      group.add(aRadioButton);
      aRadioButton.addActionListener(modeListener);
  }
  aRadioButton.setSelected(true);
  tree.getCheckingModel().setCheckingMode(CheckingMode.PROPAGATE_PRESERVING_CHECK);

  // Actions Panel
  JPanel commandsPanel = new JPanel(new GridLayout(0, 1));
  Border commandsBorder = BorderFactory.createTitledBorder("Actions");
  commandsPanel.setBorder(commandsBorder);
  // expand all action
  JButton actionButton = new JButton("Expand all");
  ActionListener actionListener = new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
    tree.expandAll();
      }
  };
  actionButton.addActionListener(actionListener);
  commandsPanel.add(actionButton);
  // clear all action
  JButton clearButton = new JButton("Clear checking");
  ActionListener clearListener = new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
    tree.clearChecking();
      }
  };
  clearButton.addActionListener(clearListener);
  commandsPanel.add(clearButton);
  // add a children action
  JButton addButton = new JButton("Add child");
  ActionListener addListener = new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
    TreePath selected = tree.getSelectionPath();
    if (selected != null) {
        DefaultMutableTreeNode parent = (DefaultMutableTreeNode) selected.getLastPathComponent();
        DefaultMutableTreeNode child = new DefaultMutableTreeNode("child " + (parent.getChildCount() + 1));
        parent.add(child);
        DefaultTreeModel dtm = (DefaultTreeModel) tree.getModel();
        dtm.nodesWereInserted(parent, new int[] { parent.getIndex(child) });
        tree.expandPath(selected);
    }
      }
  };
  addButton.addActionListener(addListener);
  commandsPanel.add(addButton);
  // remove a children action
  JButton removeButton = new JButton("Remove selected node");
  ActionListener removeListener = new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
    TreePath selected = tree.getSelectionPath();
    if (selected != null) {
        DefaultMutableTreeNode child = (DefaultMutableTreeNode) selected.getLastPathComponent();
        DefaultMutableTreeNode parent = (DefaultMutableTreeNode) child.getParent();
        if (parent != null) {
      int index = parent.getIndex(child);
      child.removeFromParent();
      DefaultTreeModel dtm = (DefaultTreeModel) tree.getModel();
      dtm.nodesWereRemoved(parent, new int[] { index }, new TreeNode[] { child });
        }
    }
      }
  };
View Full Code Here

Examples of it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTree

     *
     * @return it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTree
     */
    private JScrollPane getCheckboxTree() {
  if (this.checkboxTree == null) {
      this.checkboxTree = new CheckboxTree();
      // this.checkboxTree.setCellRenderer(new
      // RadioButtonTreeCellRenderer());
      this.checkboxTree.addKeyListener(new RefreshListener());
      System.out.println(this.checkboxTree.toString());
      this.checkboxTree.getCheckingModel().setCheckingMode(TreeCheckingModel.CheckingMode.PROPAGATE);
View Full Code Here

Examples of it.cnr.imaa.essi.lablib.gui.checkboxtree.CheckboxTree

* @author bigagli
*/
public class RadioButtonTreeCellRenderer extends JPanel implements CheckboxTreeCellRenderer {

    public static void main(String[] args) {
  CheckboxTree tree = new CheckboxTree();
  tree.getCheckingModel().setCheckingMode(CheckingMode.SINGLE);
  tree.setCellRenderer(new RadioButtonTreeCellRenderer());
  JFrame frame = new JFrame("RadioButton tree");
  frame.add(tree);
  tree.expandAll();
  frame.pack();
  frame.setVisible(true);
    }
View Full Code Here

Examples of org.apache.click.extras.tree.CheckboxTree

     * Creates and return a new tree instance.
     *
     * @return a new CheckboxTree instance
     */
    public CheckboxTree createTree() {
        return new CheckboxTree("checkboxTree");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.