no message

This commit is contained in:
2023-10-30 22:37:03 +03:00
parent 9d491999a3
commit 2ec1303c88
13 changed files with 156 additions and 65 deletions

View File

@@ -52,13 +52,14 @@ public class SapforTasksPackageInterface {
res.add(flagsNode);
return res;
}
public static DefaultMutableTreeNode getTaskVersionsTree(SapforTask task) {
public static DefaultMutableTreeNode getTaskVersionsTree(File configurationRoot, SapforTask task) {
DefaultMutableTreeNode root = null;
DefaultMutableTreeNode child = null;
DefaultMutableTreeNode parent = null;
//--
for (SapforVersion_json version_json : task.versions) {
child = new DefaultMutableTreeNode(version_json.description);
version_json.initHome(configurationRoot);
child = new DefaultMutableTreeNode(version_json);
if (parent == null) {
root = child;
parent = child;
@@ -69,13 +70,15 @@ public class SapforTasksPackageInterface {
}
if (parent != null) {
for (SapforVersion_json version_json : task.variants) {
parent.add(new DefaultMutableTreeNode(version_json.description));
version_json.initHome(configurationRoot);
parent.add(new DefaultMutableTreeNode(version_json));
}
}
//--
return root;
}
public static DefaultMutableTreeNode getTreeRoot(SapforTasksPackage package_in) {
SapforTasksResults_json results_json = getLocalResults(package_in);
//-- флаги группы
LinkedHashMap<String, LinkedHashMap<String, Vector<SapforTask>>> tasksByConfigurations = results_json.sortTasksByConfigurationsAndGroups();
@@ -97,7 +100,8 @@ public class SapforTasksPackageInterface {
*/
DefaultMutableTreeNode taskNode = new DefaultMutableTreeNode(task.test_description);
//--
taskNode.add(getTaskVersionsTree(task));
taskNode.add(getTaskVersionsTree(
new File(getLocalWorkspace(package_in), configuration_id), task));
//--
groupNode.add(taskNode);
}

View File

@@ -1,23 +1,47 @@
package SapforTestingSystem.SapforTasksPackage;
import Common.Current;
import Common.UI.Trees.DataTree;
import Common.UI.UI;
import ProjectData.Files.DBProjectFile;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
import java.io.File;
public class SapforTasksPackageTree extends DataTree {
public SapforTasksPackageTree(DefaultMutableTreeNode root_in) {
Current current;
public SapforTasksPackageTree(DefaultMutableTreeNode root_in, Current current_in) {
super(root_in);
// setRootVisible(false);
// CollapseAll();
current = current_in;
// setRootVisible(false);
// CollapseAll();
}
@Override
protected int getStartLine() {
return 1;
}
@Override
public void SelectionAction(TreePath path) {}
@Override
public void LeftMouseAction2() {
}
@Override
public Current getCurrent() {
return current;
}
@Override
public void SelectionAction(TreePath e) {
System.out.println("Select");
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.getLastPathComponent();
Current.set(Current.ProjectNode, node);
Object o = node.getUserObject();
if (o instanceof File) {
Current.set(Current.SelectedDirectory, o);
Current.set(Current.SelectedFile, null);
UI.getMainWindow().getProjectWindow().ShowNoSelectedFile();
} else if (o instanceof DBProjectFile) {
Current.set(Current.SelectedFile, o);
File file = ((DBProjectFile) o).file;
Current.set(Current.SelectedDirectory, file.getParentFile());
UI.getMainWindow().getProjectWindow().ShowSelectedFile();
}
UI.getMainWindow().getProjectWindow().ShowSelectedDirectory();
}
}