кнопка удаления пакетов SAPFOR и их результатов.
This commit is contained in:
@@ -25,6 +25,7 @@ public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
Log.Writeln_("Пакет уже завершен.");
|
||||
break;
|
||||
default:
|
||||
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
|
||||
|
||||
@@ -1,54 +1,51 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||
import Visual_DVM_2021.Passes.DeleteObjectPass;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
import TestingSystem.TasksPackage.TasksPackageState;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||
|
||||
import java.io.File;
|
||||
public class DeleteSapforTasksPackage extends DeleteObjectPass<SapforTasksPackage> {
|
||||
public DeleteSapforTasksPackage() {
|
||||
super(SapforTasksPackage.class);
|
||||
import java.util.Vector;
|
||||
public class DeleteSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.testingServer.db;
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
/*
|
||||
if (Current.hasUI()&&Current.HasSapforTasksPackage()) {
|
||||
UI.getMainWindow().getTestingWindow().RemoveSapforPackageFromComparison();
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.SapforTasksPackage)) {
|
||||
target = Current.getSapforTasksPackage();
|
||||
if (!target.state.equals(TasksPackageState.Done) && !target.state.equals(TasksPackageState.Aborted)) {
|
||||
Log.Writeln_("Нельзя удалить активный пакет!");
|
||||
} else
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
super.body();
|
||||
Utils.delete_with_check(new File(target.workspace));
|
||||
protected void ServerAction() throws Exception {
|
||||
Vector<SapforTasksPackage> vector = new Vector<>();
|
||||
vector.add(target);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DeleteAccountObjects, Current.getAccount().email, vector));
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
super.performDone();
|
||||
Pass_2021 serverPass = new TestingSystemPass<SapforTasksPackage>() {
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Удаление пакета задач SAPFOR с сервера";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (SapforTasksPackage) args[0];
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject, "", target));
|
||||
}
|
||||
};
|
||||
serverPass.Do(target);
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
if (Current.hasUI()&&Current.HasSapforTasksPackage()) {
|
||||
UI.getMainWindow().getTestingWindow().RemoveSapforPackageFromComparison();
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user