Examples of TCTreeNode


Examples of com.qspin.qtaste.ui.TCTreeNode

    public void expandSelected(TCTreeNode node) {
      if (tree.getModel() instanceof TestCampaignTreeModel) {
          TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
          Enumeration<?> children = node.children();
          while (children.hasMoreElements()) {
              TCTreeNode childNode = (TCTreeNode) children.nextElement();
              for (int i = 1; i < model.getColumnCount(); i++) {
                  TristateCheckBox.State state = (TristateCheckBox.State) model.getValueAt(childNode, i);
                  if (state == TristateCheckBox.DONT_CARE) {
                      TreeNode[] nodes = childNode.getPath();
                      TreePath treepath = new TreePath(nodes);
                      tree.expandPath(treepath);
                  }
              }
              expandSelected(childNode);
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

      if (tree.getModel() instanceof TestCampaignTreeModel) {
          TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
          // retrieve Treepath associated to the child row
          TreePath treePath = tree.getPathForRow(childRow);
          // get its node
          TCTreeNode node = (TCTreeNode) treePath.getLastPathComponent();
          // only applicable if the child is a JTreeNode (otherwise there is no parent (rootNode)
          if (node.getUserObject() instanceof JTreeNode) {
              String testbedName = model.getColumnName(col);
              model.updateParent((JTreeNode) node.getUserObject(), testbedName);
          }
      }
    }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    public void updateChildCells(TreePath treePath, int col) {
      if (tree.getModel() instanceof TestCampaignTreeModel) {
          TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
          // get the node associated to the treepath
          TCTreeNode node = (TCTreeNode) treePath.getLastPathComponent();
          JTreeNode fNode = null;
          // retrieve userObject only if based on a JTreeNode
          if (node.getUserObject() instanceof FileNode || node.getUserObject() instanceof TestDataNode) {
              fNode = (JTreeNode) node.getUserObject();
          }
          int childCount = node.getChildCount();
          if (fNode != null) {
              childCount = fNode.getChildren().length;
          } // it can be different is user didn't expand the tree view


          String testbedName = model.getColumnName(col);
          if (fNode != null) {
              model.updateChild(fNode, testbedName);
              return;
          } else {
              // update child from root
              for (int i = 0; i < childCount; i++) {
                  TCTreeNode childNode = (TCTreeNode) node.getChildAt(i);
                  JTreeNode childFileNode = (JTreeNode) childNode.getUserObject();
                  // set the value to child from its parent
                  TristateCheckBox.State rootState = model.getNodeState(node.toString(), testbedName);
                  model.setNodeState(childFileNode, testbedName, rootState);
                  model.updateChild(childFileNode, testbedName);
              }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    }

    public TCTreeNode getTreeNode(TCTreeNode parentNode, JTreeNode childNode) {
        Enumeration<?> childrenNodeEnum = parentNode.children();
        while (childrenNodeEnum.hasMoreElements()) {
            TCTreeNode childNodeTC = (TCTreeNode) childrenNodeEnum.nextElement();
            JTreeNode childFileNode = (JTreeNode) childNodeTC.getUserObject();
            if (childFileNode.equals(childNode)) {
                return childNodeTC;
            }
        }
        return null;
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    public void removeSelectedTestSuites() {
      if (tree.getModel() instanceof TestCampaignTreeModel) {
          TreePath[] selectedPaths = tree.getSelectionPaths();
          for (TreePath selectedPath : selectedPaths) {
              TCTreeNode node = (TCTreeNode) selectedPath.getLastPathComponent();
              //
              //remove it from the model
              TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
              model.removeTestSuite(node);
          }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

       
        this.setCellRenderer(new TestCaseTreeCellRenderer());

        FileNode rootFileNode = createRootFileNode();

        TCTreeNode rootNode = new TCTreeNode(rootFileNode, true);
        DefaultTreeModel tm = new DefaultTreeModel(rootNode);
        setModel(tm);
        generateScriptsTree(rootFileNode);
        TCTreeListener listener = new TCTreeListener();
        this.addMouseListener(listener);
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    public TCTreeNode generateScriptsTree() {
        return generateScriptsTree(createRootFileNode());
    }

    public TCTreeNode generateScriptsTree(FileNode rootFileNode) {
        TCTreeNode rootNode = (TCTreeNode) getModel().getRoot();
        rootNode.removeAllChildren();
        rootNode.setUserObject(rootFileNode);
        addTreeToDir(rootFileNode.getFile(), rootNode);
        updateUI();
        return rootNode;
    }
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.