Package com.qspin.qtaste.ui.tools

Examples of com.qspin.qtaste.ui.tools.FileNode


    }

    protected boolean isTestcaseDir()
    {
        if (getUserObject() instanceof FileNode) {
            FileNode fn = (FileNode)getUserObject();
            return !fn.isTestcaseDir() && getParent() != null;
        }
        else return false;
       
    }
View Full Code Here


       
    }
   
    public boolean isLeaf() {
        if (getUserObject() instanceof FileNode) {
            FileNode fn = (FileNode)getUserObject();
            return fn.isTestcaseDir() && getParent() != null && (fn.isTestcaseDir() && !fn.isShowTestData() || fn.getChildren()== null || fn.getChildren().length==0);
        }
        else if (getUserObject() instanceof TestDataNode) {
            return true;
        }
        else return false;
View Full Code Here

            System.out.println("Too many Listeners");
        }
       
        this.setCellRenderer(new TestCaseTreeCellRenderer());

        FileNode rootFileNode = createRootFileNode();

        TCTreeNode rootNode = new TCTreeNode(rootFileNode, true);
        DefaultTreeModel tm = new DefaultTreeModel(rootNode);
        setModel(tm);
        generateScriptsTree(rootFileNode);
View Full Code Here

        return rootNode;
    }

    protected FileNode createRootFileNode() {
        String scriptDir = TESTUITE_DIR;
        FileNode tcFn = new FileNode(new File(scriptDir), "Test Cases",TESTUITE_DIR);
        return tcFn;
    }
View Full Code Here

    protected boolean checkIfDirectoryContainsTestScriptFile(File file) {
        File[] childFiles = FileUtilities.listSortedFiles(file);
        for (int i = 0; i < childFiles.length; i++) {
            if (childFiles[i].isDirectory()) {
                FileNode childNode = new FileNode(childFiles[i], childFiles[i].getName(),TESTUITE_DIR);
                if (childNode.isTestcaseDir()) {
                    return true;
                } else {
                    // go recursively into its directory
                    boolean result = checkIfDirectoryContainsTestScriptFile(childFiles[i]);
                    if (result) {
View Full Code Here

    protected void addChildToTree(File file, DefaultMutableTreeNode parent) {
        if (!file.isDirectory()) {
            return;
        }
        FileNode fn = new FileNode(file, file.getName(),TESTUITE_DIR);
        // check if the directory is the child one containing data files
        boolean nodeToAdd = fn.isTestcaseDir();
        if (!fn.isTestcaseDir()) {
            // go recursilvely to its child and check if it must be added
            nodeToAdd = checkIfDirectoryContainsTestScriptFile(file);
        }
        if (!nodeToAdd) {
            return;
        }
        TCTreeNode node = new TCTreeNode(fn, !fn.isTestcaseDir());
        final int NON_EXISTENT = -1;
        if (parent.getIndex(node) == NON_EXISTENT &&
                !file.isHidden()) {
            parent.add(node);
        }
View Full Code Here

        }

        protected void addNodesToDir(TreePath path) {
            TCTreeNode tn = getTreeNode(path);
            if (tn != null) {
                FileNode fn = (FileNode) tn.getUserObject();
                if (fn.isDir()) {
                    tn.removeAllChildren();
                    addTreeToDir(fn.getFile(), tn);
                    ((DefaultTreeModel) getModel()).reload(tn);
                }
            }
        }
View Full Code Here

                Action renameTestAction = null;
                TreePath selectedPath = getSelectionPath();
                if (selectedPath == null) {
                    return;
                }
                FileNode fn = getFileNode(selectedPath);
                if (fn != null) {
                    if (fn.isTestcaseDir()) {
                        createTestAction.putValue(Action.NAME, "Copy TestScript...");
                        removeTestAction = new RemoveTestScript();
                        renameTestAction = new RenameTestScript();
                        renameTestAction.putValue(Action.NAME, "Rename TestScript...");
                        removeTestAction.putValue(Action.NAME, "Remove TestScript...");
View Full Code Here

                                selectedText = selectedText.replace(".", File.separator);
                                if (mTcPane != null) {
                                    fileSearch.addSearchPath(new File(getFileName()).getParent());
                                    fileSearch.addSearchPath(mTcPane.getCurrentSelectedTestsuite());
                                    FileNode selectedNode = mTcPane.getCurrentSelectedFileNode();
                                    if (selectedNode != null) {
                                        if (selectedNode.isTestcaseDir()) {
                                            fileSearch.addSearchPath(selectedNode.getFile().getParent());
                                        }
                                    }
                                    for (String dir : pythonLibPath) {
                                        fileSearch.addSearchPath(dir);
                                    }
View Full Code Here

        public TestGenerateDocAction() {
            super("Generate documentation");
        }

        public void actionPerformed(ActionEvent e) {
            FileNode fn = getSelectedFileNode();
            if (fn==null) return;
            if (fn.getPythonTestScript()==null) return;
            testCasePane.parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            File testcaseDoc = fn.getPythonTestScript().generateDoc();
            testCasePane.parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            // refresh the test case window
            setTestCaseDoc(testcaseDoc, true);
        }
View Full Code Here

TOP

Related Classes of com.qspin.qtaste.ui.tools.FileNode

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.