рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -3,6 +3,7 @@ import Common.Current_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
@@ -19,12 +20,12 @@ public class DeleteVersion extends Pass<db_project_info> {
|
||||
protected boolean canStart(Object... args) {
|
||||
if (args.length > 0) {
|
||||
target = (db_project_info) args[0];
|
||||
current = (Current.getVersion() != null) && Current.getVersion().Home.equals(target.Home);
|
||||
current = (Global.mainModule.getVersion() != null) && Global.mainModule.getVersion().Home.equals(target.Home);
|
||||
return true;
|
||||
} else {
|
||||
if (((target = Current.getVersion()) != null) && (!UI_.isActive() ||
|
||||
if (((target = Global.mainModule.getVersion()) != null) && (!UI_.isActive() ||
|
||||
UI_.Warning("Удалить " +
|
||||
((Current.HasProject() && target.Home.equals(Current.getProject().Home)) ? "текущий проект" : "версию ")
|
||||
((Global.mainModule.HasProject() && target.Home.equals(Global.mainModule.getProject().Home)) ? "текущий проект" : "версию ")
|
||||
+ Utils_.Brackets(target.name)))) {
|
||||
current = true;
|
||||
return true;
|
||||
@@ -36,8 +37,8 @@ public class DeleteVersion extends Pass<db_project_info> {
|
||||
protected void performPreparation() throws Exception {
|
||||
if (target.parent != null)
|
||||
target.parent.checkLastModification(target);
|
||||
if (Current.HasProject()) {
|
||||
if ((Current.getProject().Home.getAbsolutePath().startsWith(target.Home.getAbsolutePath())))
|
||||
if (Global.mainModule.HasProject()) {
|
||||
if ((Global.mainModule.getProject().Home.getAbsolutePath().startsWith(target.Home.getAbsolutePath())))
|
||||
passes.get(PassCode.CloseCurrentProject).Do();
|
||||
}
|
||||
if (UI_.isActive()) {
|
||||
@@ -52,11 +53,11 @@ public class DeleteVersion extends Pass<db_project_info> {
|
||||
protected void performDone() throws Exception {
|
||||
parent = target.parent;
|
||||
if (current)
|
||||
Current_.set(Current.Version, null);
|
||||
Global.mainModule.set(Current.Version, null);
|
||||
if (parent != null) {
|
||||
UI.getVersionsWindow().getVersionsForm().getTree().RemoveNode(target.node);
|
||||
parent.versions.remove(target.name);
|
||||
} else
|
||||
Current_.set(Current.Root, null);
|
||||
Global.mainModule.set(Current.Root, null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user