no message
This commit is contained in:
20
src/_VisualDVM/Passes/All/DeleteCompilationTasks.java
Normal file
20
src/_VisualDVM/Passes/All/DeleteCompilationTasks.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.DeleteObjectsPass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
public class DeleteCompilationTasks extends DeleteObjectsPass<CompilationTask> {
|
||||
public DeleteCompilationTasks() {
|
||||
super(CompilationTask.class);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
super.body();
|
||||
for (CompilationTask task : target) {
|
||||
for (RunTask runTask : task.getRunTasks().values()) {
|
||||
Utils_.forceDeleteWithCheck(runTask.getLocalWorkspace());
|
||||
}
|
||||
Utils_.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.DeleteObjectPass;
|
||||
import Common.Passes.DeleteObjectsPass;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
public class DeleteCompiler extends DeleteObjectPass<Compiler> {
|
||||
public class DeleteCompiler extends DeleteObjectsPass<Compiler> {
|
||||
public DeleteCompiler() {
|
||||
super(Compiler.class);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.DeleteObjectPass;
|
||||
import Common.Passes.DeleteObjectsPass;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
public class DeleteMachine extends DeleteObjectPass<Machine> {
|
||||
public class DeleteMachine extends DeleteObjectsPass<Machine> {
|
||||
public DeleteMachine() {
|
||||
super(Machine.class);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.DeleteObjectPass;
|
||||
import Common.Passes.DeleteObjectsPass;
|
||||
import _VisualDVM.GlobalData.Makefile.Makefile;
|
||||
public class DeleteMakefile extends DeleteObjectPass<Makefile> {
|
||||
public class DeleteMakefile extends DeleteObjectsPass<Makefile> {
|
||||
public DeleteMakefile() {
|
||||
super(Makefile.class);
|
||||
}
|
||||
|
||||
20
src/_VisualDVM/Passes/All/DeleteRunTasks.java
Normal file
20
src/_VisualDVM/Passes/All/DeleteRunTasks.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.DeleteObjectsPass;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteRunTasks extends DeleteObjectsPass<RunTask> {
|
||||
public DeleteRunTasks() {
|
||||
super(RunTask.class);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
super.body();
|
||||
for (RunTask task : target) {
|
||||
Utils_.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSelectedCompilationTasks extends Pass<Vector<CompilationTask>> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
Global.mainModule.getDb().compilationTasks.Data.values().stream().filter(task -> task.isVisible() && task.isSelected() && task.isPassive()).forEach(task -> target.add(task));
|
||||
if (target.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одной задачи для удаления.");
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.mainModule.getDb().compilationTasks.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (CompilationTask task : target) {
|
||||
for (RunTask runTask : task.getRunTasks().values()) {
|
||||
Global.mainModule.getDb().Delete(runTask);
|
||||
Utils_.forceDeleteWithCheck(runTask.getLocalWorkspace());
|
||||
}
|
||||
Global.mainModule.getDb().Delete(task);
|
||||
Utils_.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
Global.mainModule.getDb().compilationTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
|
||||
import java.util.Vector;
|
||||
public class DeleteSelectedRunTasks extends Pass<Vector<RunTask>> {
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Delete.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = new Vector<>();
|
||||
(Global.mainModule.getDb()).runTasks.Data.values().stream().filter(task -> task.isVisible() && task.isSelected() && task.isPassive()).forEach(task -> target.add(task));
|
||||
if (target.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одной задачи для удаления.");
|
||||
return false;
|
||||
} else return true;
|
||||
}
|
||||
@Override
|
||||
protected void showPreparation() throws Exception {
|
||||
Global.mainModule.getDb().runTasks.ClearUI();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
for (RunTask task : target) {
|
||||
Global.mainModule.getDb().Delete(task);
|
||||
Utils_.forceDeleteWithCheck(task.getLocalWorkspace());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void showFinish() throws Exception {
|
||||
Global.mainModule.getDb().runTasks.ShowUI();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.DeleteObjectPass;
|
||||
import Common.Passes.DeleteObjectsPass;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
public class DeleteUser extends DeleteObjectPass<User> {
|
||||
public class DeleteUser extends DeleteObjectsPass<User> {
|
||||
public DeleteUser() {
|
||||
super(User.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user