Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/CloseCurrentProject.java

67 lines
2.1 KiB
Java
Raw Normal View History

package Visual_DVM_2021.Passes.All;
2024-10-09 23:37:58 +03:00
import Common.Current_;
import Common.Utils.CommonUtils;
2024-10-09 22:01:19 +03:00
import _VisualDVM.Current;
import _VisualDVM.Global;
2024-10-09 22:01:19 +03:00
import _VisualDVM.Visual.UI;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.Project.db_project_info;
2024-10-09 23:37:58 +03:00
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.Pass;
2023-09-17 22:13:42 +03:00
import javax.swing.*;
2024-10-09 23:37:58 +03:00
public class CloseCurrentProject extends Pass<db_project_info> {
2023-09-17 22:13:42 +03:00
@Override
public String getButtonText() {
return "";
}
@Override
public String getIconPath() {
return "/icons/Close.png";
}
@Override
public Icon getTabIcon() {
return CommonUtils.getIcon("/icons/Close_18.png");
2023-09-17 22:13:42 +03:00
}
@Override
protected boolean canStart(Object... args) throws Exception {
return (target = Current.getProject()) != null;
}
@Override
protected void performPreparation() throws Exception {
2024-10-09 23:37:58 +03:00
passes.get(PassCode.CloseCurrentFile).Do();
2023-09-17 22:13:42 +03:00
}
@Override
protected void body() throws Exception {
target.Close();
UI.HideSearchForm();
}
@Override
protected void performDone() throws Exception {
Global.files_multiselection = false;
//--
Current.getSapfor().ResetAllAnalyses();
2024-10-08 22:33:49 +03:00
Current.getSapfor().cd(CommonUtils.getHomeDirectory());
2024-10-09 23:37:58 +03:00
Current_.set(Current.Project, null);
Current_.set(Current.File, null);
Current_.set(Current.Function, null);
Current_.set(Current.SelectedFunction,null);
Current_.set(Current.ProjectNode, null);
Current_.set(Current.SelectedFile, null);
Current_.set(Current.SelectedDirectory, null);
2023-09-17 22:13:42 +03:00
//-мб перестраховка. мб и нет.
2024-10-09 23:37:58 +03:00
Current_.set(Current.ParallelVariant, null);
Current_.set(Current.Dimensions, null);
Current_.set(Current.Array, null);
Current_.set(Current.DBArray, null);
2023-09-17 22:13:42 +03:00
//-
}
@Override
protected void showDone() throws Exception {
if (UI.HasMainWindow()) {
2023-09-17 22:13:42 +03:00
UI.getMainWindow().ShowNoProject();
UI.getVersionsWindow().ShowNoProjectVariants();
UI.getVersionsWindow().BlockVariants();
}
}
}