Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/DeleteSapforTasksPackage.java

53 lines
1.7 KiB
Java
Raw Normal View History

2023-09-17 22:13:42 +03:00
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.UI.UI;
2023-10-29 01:03:37 +03:00
import Common.Utils.Utils;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import TestingSystem.TasksPackage.TasksPackageState;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
public class DeleteSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
@Override
public String getIconPath() {
return "/icons/Delete.png";
2023-09-17 22:13:42 +03:00
}
@Override
public String getButtonText() {
return "";
2023-09-17 22:13:42 +03:00
}
@Override
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;
2023-09-17 22:13:42 +03:00
}
return false;
2023-09-17 22:13:42 +03:00
}
@Override
protected void showPreparation() throws Exception {
UI.getMainWindow().getTestingWindow().DropSapforComparison();
}
@Override
protected void ServerAction() throws Exception {
DeleteAccountObject(target);
2023-09-17 22:13:42 +03:00
}
2023-10-06 21:01:52 +03:00
@Override
protected void performDone() throws Exception {
super.performDone();
2023-11-08 23:38:07 +03:00
Utils.delete_with_check(target.getLocalWorkspace());
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
2023-10-06 21:01:52 +03:00
}
2023-09-17 22:13:42 +03:00
}
/*
@Override
protected void performPreparation() throws Exception {
if (Current.hasUI()&&Current.HasSapforTasksPackage()) {
UI.getMainWindow().getTestingWindow().RemoveSapforPackageFromComparison();
}
*/