Examples of TCTreeNode


Examples of com.qspin.qtaste.ui.TCTreeNode

        Object[] childNodes = parentNode.getChildren();
        for (int i=0 ; i < childNodes.length; i++) {
            JTreeNode childNode = (JTreeNode)childNodes[i];
            // now check in the already added nodes if it is already added
            //
            TCTreeNode rootNode = (TCTreeNode)this.getRoot();
            Enumeration<?> childRootNodes  = rootNode.children();
            while (childRootNodes.hasMoreElements()) {
                TCTreeNode childRootNode = (TCTreeNode)childRootNodes.nextElement();
                JTreeNode childFileRootNode = (JTreeNode)childRootNode.getUserObject();
                if (childFileRootNode.getId().equals(childNode.getId()))
                {
                    this.removeNodeFromParent(childRootNode);
                }
            }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    }
           
    public JTreeNode addTestSuite(String directory) {
        // check first if the directory is already added or its parent
        //logger.trace("Adding '" + directory + "'" + " directory into the test campaign");
        TCTreeNode rootNode = (TCTreeNode)this.getRoot();
        Enumeration<?> childNodes = rootNode.children();
        while (childNodes.hasMoreElements()){
            TCTreeNode childNode = (TCTreeNode)childNodes.nextElement();
            JTreeNode child = (JTreeNode)childNode.getUserObject();
            if (isTestSuite(child, directory)) {
                //logger.trace(directory + "'" + " already defined in the current test campaign, so skip it");
                return getTestSuite(directory);
            }
        }   
       
        // check if the parent dir is already added       
        File testsuiteDirFile = new File(directory);
        if (checkIfParentAdded(testsuiteDirFile)) {
            //logger.trace(directory + "'" + " already defined in another test suite within the current test campaign, so skip it");
            return null;
        }
       
        // check if child of this directory is already added, if yes, remove the previous child
        removeIfChildAdded(directory);
        FileNode childFileNode = new FileNode(testsuiteDirFile, testsuiteDirFile.getName(),TESTUITE_DIR);       
        childFileNode.setShowTestdata(true);
        TCTreeNode testsuiteNode = new TCTreeNode(childFileNode, true);
       
        // add this node to the root node
        // current list
        int currentIndex = testsuiteDir.size();
        testsuiteDir.add(testsuiteNode);
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

   
    public void save(String fileName, String campaignName) {
        //
        logger.trace("Saving the campaign " + campaignName + " into the file" + fileName);
        CampaignWriter campaignWriter = new CampaignWriter();
        TCTreeNode rootNode = (TCTreeNode) this.getRoot();
        for (int i = 1; i < this.getColumnCount(); i++) {
            String testbedName = this.getColumnName(i);
            Enumeration<?> enumRootNodeChildren = rootNode.children();
            while (enumRootNodeChildren.hasMoreElements()) {
                TCTreeNode childNode = (TCTreeNode) enumRootNodeChildren.nextElement();
                JTreeNode childFileNode = (JTreeNode) childNode.getUserObject();
                TristateCheckBox.State state = this.getNodeState(childFileNode, testbedName);
                if (state == TristateCheckBox.SELECTED) {
                  campaignWriter.addCampaign(testbedName, childFileNode.getFile().getPath().replace("\\", "/"));
                } else {
                    saveSelectedTestSuites(campaignWriter, childFileNode, testbedName);
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

        Enumeration<?> childNodesArray = node.children();
        ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>();
        int[] indices = new int[node.getChildCount()];
        int index=0;
        while (childNodesArray.hasMoreElements()) {
            TCTreeNode childNode = (TCTreeNode)childNodesArray.nextElement();
            indices[index]=index;
            childNodes.add(childNode);
            index++;
            if (childNode.getUserObject() instanceof JTreeNode) {
                JTreeNode childFileNode = (JTreeNode)childNode.getUserObject();               
                metaCampaignSelectionList.remove(childFileNode.getId());           
            }
            removeTestSuiteFromModel(childNode);
        }
    }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

        Enumeration<?> childNodesArray = node.children();
        ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>();
        int[] indices = new int[node.getChildCount()];
        int index=0;
        while (childNodesArray.hasMoreElements()) {
            TCTreeNode childNode = (TCTreeNode)childNodesArray.nextElement();
            indices[index]=index;
            childNodes.add(childNode);
            index++;
            if (childNode.getUserObject() instanceof JTreeNode) {
                JTreeNode childFileNode = (JTreeNode)childNode.getUserObject();               
                metaCampaignSelectionList.remove(childFileNode.getId());           
            }
            removeTestSuiteFromModel(childNode);
        }
        node.removeAllChildren();       
        this.fireTreeNodesRemoved(this, this.getPathToRoot(node), indices, childNodes.toArray());
       
        //prevent to delete root node - 'Test Campaign'
        if (!node.isRoot()) {
            TCTreeNode parentNode = (TCTreeNode)node.getParent();
            int nodeIndex = parentNode.getIndex(node);           
            parentNode.remove(node);           
            this.fireTreeNodesRemoved(this, this.getPathToRoot(parentNode), new int[] {nodeIndex}, new TreeNode[]{node});   
        }
    }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

        }
    }
    public void removeAll() {
        metaCampaignSelectionList.clear();
        // fire property change
        TCTreeNode rootNode = (TCTreeNode)this.getRoot();
        Enumeration<?> childNodesArray = rootNode.children();
        ArrayList<TreeNode> childNodes = new ArrayList<TreeNode>();
        int[] indices = new int[rootNode.getChildCount()];
        int index=0;
        while (childNodesArray.hasMoreElements()) {
            TreeNode childNode = (TreeNode)childNodesArray.nextElement();
            indices[index]=index;
            childNodes.add(childNode);
            index++;
        }
        rootNode.removeAllChildren();
       
        this.fireTreeNodesRemoved(this, this.getPathToRoot(rootNode), indices, childNodes.toArray());
      
    }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    public void fireAddTestSuite(TCTreeNode parentNode, Object[] childNodes) {
        for (int i = 0; i < childNodes.length;i++) {
            if (childNodes[i] instanceof FileNode) {
                FileNode childFileNode = (FileNode)childNodes[i];
                childFileNode.setShowTestdata(true);
                TCTreeNode childNode = new TCTreeNode(childFileNode, true);
                parentNode.add(childNode);
                this.fireTreeNodesInserted(this, this.getPathToRoot(parentNode), new int[] {i}, new Object [] {childNode});
                if (childFileNode.getChildren()!=null) {
                    if (childFileNode.getChildren().length>0) {
                        fireAddTestSuite(childNode, childFileNode.getChildren());
                    }
                }
            }
            if (childNodes[i] instanceof TestDataNode) {
                TestDataNode childDataNode = (TestDataNode)childNodes[i];
                TCTreeNode childNode = new TCTreeNode(childDataNode, false);
                childDataNode.setShowTestdata(true);
                parentNode.add(childNode);
                this.fireTreeNodesInserted(this, this.getPathToRoot(parentNode), new int[] {i}, new Object [] {childNode});
               
            }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    public void displayNecessaryColumns() {
        //
        if (tree.getModel() instanceof TestCampaignTreeModel) {
            TestCampaignTreeModel model = (TestCampaignTreeModel) tree.getModel();
            TCTreeNode rootNode = (TCTreeNode) model.getRoot();
            int colcount = this.getColumnCount();
            for (int viewColIndex = 1; viewColIndex < colcount; viewColIndex++) {
                this.removeColumn(getColumnModel().getColumn(1));
            }
            for (int i = 1; i < getModel().getColumnCount(); i++) {
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    }

    public void expandPath(String pathString) {
        //Utils.expandJTree(tree, 10);

        TCTreeNode rootNode = (TCTreeNode) tree.getModel().getRoot();
        Enumeration<?> children = rootNode.children();
        while (children.hasMoreElements()) {
            TCTreeNode childNode = (TCTreeNode) children.nextElement();
            JTreeNode childFileNode = (JTreeNode) childNode.getUserObject();
            if (childFileNode.getFile().getPath().equals(pathString)) {
                TreeNode[] nodes = childNode.getPath();
                TreePath treepath = new TreePath(nodes);
                tree.expandPath(treepath);
            }
        }
    }
View Full Code Here

Examples of com.qspin.qtaste.ui.TCTreeNode

    }

    public void expandSelected() {
     
      DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
        TCTreeNode rootNode = (TCTreeNode) model.getRoot();
        expandSelected(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.