упорядочил папки с кодом.
This commit is contained in:
44
src/Common/Passes/All/AbortSapforTaskPackage.java
Normal file
44
src/Common/Passes/All/AbortSapforTaskPackage.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package Common.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.ServerCode;
|
||||
import Repository.ServerExchangeUnit_2021;
|
||||
import Repository.TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import Repository.TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
|
||||
import Common.Passes.Server.TestingSystemPass;
|
||||
|
||||
import java.util.Vector;
|
||||
public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage> {
|
||||
Vector<TasksPackageToKill> packagesToKill;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.Check(Log, Current.SapforTasksPackage)) {
|
||||
packagesToKill = new Vector<>();
|
||||
target = Current.getSapforTasksPackage();
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
Log.Writeln_("Пакет уже завершен.");
|
||||
break;
|
||||
default:
|
||||
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageName = String.valueOf(target.id);
|
||||
packagesToKill.add(tasksPackageToKill);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
;
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packagesToKill));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user