Package net.sf.gluebooster.java.booster.basic.container

Examples of net.sf.gluebooster.java.booster.basic.container.BeanTreeNode


          action = new ActionEvent(bean, GeneralConstants.END,
              ACTION_SAVE_BEAN);
          listeners.actionPerformed(action);
        }
      } else if (addButton.equals(event.getSource())) {
        BeanTreeNode selection = (BeanTreeNode) tree.getSelectionPath()
            .getLastPathComponent();
        selection.addNewChild();
        model.nodeStructureChanged(selection);
      } else if (removeButton.equals(event.getSource())) {
        BeanTreeNode selection = (BeanTreeNode) tree.getSelectionPath()
            .getLastPathComponent();
        BeanTreeNode parent = (BeanTreeNode) selection.getParent();
        selection.removeFromParent();
        model.nodeStructureChanged(parent);
      }
else
        throw new InvalidParameterException("Command " + command
View Full Code Here


  }

  public void setBean(Object bean) throws Exception {
    this.bean = bean;

    DefaultMutableTreeNode rootNode = new BeanTreeNode(bean);
    model = new DefaultTreeModel(rootNode);
    tree = new JTree(model);
    tree.setEditable(true);

    DefaultTreeSelectionModel selectionModel = new DefaultTreeSelectionModel();
View Full Code Here

  }

  @Override
  public void valueChanged(TreeSelectionEvent event) {
    TreePath path = event.getPath();
    BeanTreeNode selected = (BeanTreeNode) path.getLastPathComponent();
    BeanTreeNode parent = (BeanTreeNode) selected.getParent();

    removeButton.setEnabled(parent != null
        && parent.isUseElementsAsChildren());
    addButton.setEnabled(selected.isUseElementsAsChildren()
        && (selected.getUserObject() instanceof ObjectFactory));
    // System.out.println(selected);
  }
View Full Code Here

TOP

Related Classes of net.sf.gluebooster.java.booster.basic.container.BeanTreeNode

Copyright © 2018 www.massapicom. 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.