fix
This commit is contained in:
41
src/Visual_DVM_2021/Passes/All/AbortDVMPackage.java
Normal file
41
src/Visual_DVM_2021/Passes/All/AbortDVMPackage.java
Normal file
@@ -0,0 +1,41 @@
|
||||
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 {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", packageToKill));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user