no message

This commit is contained in:
2023-11-23 22:38:21 +03:00
parent b3401bfe1c
commit 509c858b1a
10 changed files with 89 additions and 173 deletions

View File

@@ -1,76 +0,0 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants;
import Common.Current;
import Common.Utils.Files.VDirectoryChooser;
import Common.Utils.Utils;
import ProjectData.Project.db_project_info;
import TestingSystem.Common.Test.Test;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import java.io.File;
public class CreateTestFromDirectory extends Pass_2021<Test> {
db_project_info project = null;
int group_id;
File dir;
VDirectoryChooser directoryChooser = new VDirectoryChooser("Выбор домашней папки теста");
@Override
public String getIconPath() {
return "/icons/CreateProject.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean needsAnimation() {
return true;
}
@Override
protected boolean canStart(Object... args) throws Exception {
group_id = Constants.Nan;
project = null;
dir = null;
target = null;
//-
if (args.length == 0) {
if (!Current.Check(Log, Current.Group))
return false;
group_id = Current.getGroup().id;
dir = directoryChooser.ShowDialog();
} else {
dir = (File) args[0];
group_id = (int) args[1];
}
//-
if (dir == null)
return false;
//--
if (!dir.isDirectory()) {
Log.Writeln_(Utils.Brackets(dir) + "\е является папкой!");
return false;
}
//-
if (dir.getName().equals(Constants.data)) {
Log.Writeln_(Utils.Brackets(dir) + "\nявляется служебной папкой визуализатора!");
return false;
}
return Utils.validateProjectFolder(dir, Log) && Utils.containsSource(dir, true);
}
@Override
protected void performPreparation() throws Exception {
passes.get(PassCode_2021.CloseCurrentProject).Do();
}
@Override
protected void body() throws Exception {
project = new db_project_info(dir);
project.CreateVersionsTree();
project.Open();
project.Close();
}
@Override
protected void performDone() throws Exception {
super.performDone();
passes.get(PassCode_2021.PublishTest).Do(project,group_id);
}
}