no message
This commit is contained in:
49
src/_VisualDVM/Passes/Testing/AbortTestingPackage.java
Normal file
49
src/_VisualDVM/Passes/Testing/AbortTestingPackage.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package _VisualDVM.Passes.Testing;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
import _VisualDVM.TestingSystem.Common.TestingPackage.TestingPackage;
|
||||
import _VisualDVM.TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
|
||||
import _VisualDVM.Passes.Server.TestingSystemPass;
|
||||
public abstract class AbortTestingPackage extends TestingSystemPass<TestingPackage> {
|
||||
TestingPackageToKill packageToKill = null;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
public abstract Current currentName();
|
||||
public abstract int getAbortType();
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
packageToKill = null;
|
||||
if (Global.mainModule.Check(Log, currentName())) {
|
||||
target = (TestingPackage) Global.mainModule.get(currentName());
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
case DoneWithErrors:
|
||||
Log.Writeln_("Пакет уже завершен.");
|
||||
break;
|
||||
case Inactive:
|
||||
Log.Writeln_("Пакет неактивен.");
|
||||
break;
|
||||
default:
|
||||
packageToKill = new TestingPackageToKill();
|
||||
packageToKill.packageId = target.id;
|
||||
packageToKill.type = getAbortType();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
;
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, null, packageToKill));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user