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

42 lines
1.4 KiB
Java
Raw Normal View History

2023-12-15 02:34:30 +03:00
package Visual_DVM_2021.Passes.All;
import Common.Current;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
import TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
import TestingSystem.DVM.DVMPackage.DVMPackage;
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
public class AbortDVMPackage extends TestingSystemPass<DVMPackage> {
TestingPackageToKill packageToKill = null;
@Override
public String getIconPath() {
return "/icons/Ban.PNG";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
packageToKill = null;
if (Current.Check(Log, Current.DVMPackage)) {
target = Current.getDVMPackage();
switch (target.state) {
case Done:
case Aborted:
Log.Writeln_("Пакет уже завершен.");
break;
default:
packageToKill = new TestingPackageToKill(target);
return true;
}
}
;
return false;
}
@Override
protected void ServerAction() throws Exception {
2023-12-15 15:12:17 +03:00
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, null, packageToKill));
2023-12-15 02:34:30 +03:00
}
}