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

@@ -1,7 +1,11 @@
package SapforTestingSystem.Json;
import Common.Global;
import Common.Utils.Utils;
import com.google.gson.annotations.Expose;
import java.io.File;
import java.io.Serializable;
import java.nio.file.Paths;
public class SapforVersion_json implements Serializable {
@Expose
public String version = "";
@@ -15,4 +19,13 @@ public class SapforVersion_json implements Serializable {
version = version_in.substring(root_in.length() + 1);
description = description_in;
}
@Override
public String toString() {
return Home.getName()+ " : "+ Utils.Brackets(description);
}
public File Home = null;
public void initHome(File configurationRoot) {
String relativePath = Global.isWindows ? Utils.toW(version) : version;
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
}
}

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();
}
}