package Visual_DVM_2021.Passes.All; import Common.UI.UI; import Common.Utils.Utils; import TestingSystem.DVM.TasksPackage.TasksPackageState; import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage; import Visual_DVM_2021.Passes.Server.DeleteServerAccountObject; public class DeleteSapforTasksPackage extends DeleteServerAccountObject { public DeleteSapforTasksPackage() { super(SapforTasksPackage.class); } public boolean checkActivity() { if (!target.state.equals(TasksPackageState.Done) && !target.state.equals(TasksPackageState.Aborted)) { Log.Writeln_("Нельзя удалить активный пакет!"); return false; } return true; } @Override protected boolean canStart(Object... args) throws Exception { return super.canStart(args) && checkActivity(); } @Override protected void showPreparation() throws Exception { UI.getMainWindow().getTestingWindow().DropSapforComparison(); } @Override protected void performDone() throws Exception { super.performDone(); Utils.delete_with_check(target.getLocalWorkspace()); } }