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

33 lines
1.2 KiB
Java

package Common.Passes.All;
import Common.UI.UI;
import Common.Utils.Utils;
import Repository.TestingSystem.DVM.TasksPackage.TasksPackageState;
import Repository.TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
import Common.Passes.Server.DeleteServerAccountObject;
public class DeleteSapforTasksPackage extends DeleteServerAccountObject<SapforTasksPackage> {
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());
}
}