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

53 lines
1.6 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.Visual.UI;
2024-10-09 22:21:57 +03:00
import _VisualDVM.ProjectData.Files.DBProjectFile;
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 CloseCurrentFile extends Pass<DBProjectFile> {
2023-09-17 22:13:42 +03:00
@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
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
return (target = Current.getFile()) != null;
}
@Override
protected void body() throws Exception {
//действия по закрытию. сохранение и т д.
target.form.SaveSplitters();
target.UpdateLastLine(target.form.getEditor().getCurrentLine());
2024-10-09 23:37:58 +03:00
passes.get(PassCode.Save).Do();
2024-10-08 23:21:47 +03:00
UI.getSearchReplaceWindow().ClearMarkers();
2023-09-17 22:13:42 +03:00
target.form = null;
}
@Override
protected void performDone() throws Exception {
2024-10-09 23:37:58 +03:00
Current_.set(Current.File, null);
Current_.set(Current.FileGraphElement, null);
2023-09-17 22:13:42 +03:00
//-
2024-10-09 23:37:58 +03:00
Current_.set(Current.Notes, null);
Current_.set(Current.Warnings, null);
Current_.set(Current.Errors, null);
2023-09-17 22:13:42 +03:00
//-
}
@Override
protected void showDone() throws Exception {
//отобразить отсутствие файла.
UI.getMainWindow().getProjectWindow().ShowNoFile();
}
}