2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.Passes.All;
|
2024-10-13 22:08:13 +03:00
|
|
|
import Common.Passes.Pass;
|
2024-10-11 00:00:30 +03:00
|
|
|
import Common.Utils.Utils_;
|
2024-10-09 23:37:58 +03:00
|
|
|
import Visual_DVM_2021.Passes.PassCode;
|
2024-10-13 22:08:13 +03:00
|
|
|
import _VisualDVM.Global;
|
|
|
|
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
|
|
|
|
import _VisualDVM.Visual.UI;
|
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() {
|
2024-10-11 00:00:30 +03:00
|
|
|
return Utils_.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 {
|
2024-10-13 22:08:13 +03:00
|
|
|
return (target = Global.mainModule.getFile()) != null;
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void body() throws Exception {
|
|
|
|
|
//действия по закрытию. сохранение и т д.
|
|
|
|
|
target.form.SaveSplitters();
|
|
|
|
|
target.UpdateLastLine(target.form.getEditor().getCurrentLine());
|
2024-10-13 23:55:03 +03:00
|
|
|
Global.mainModule.getPass(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-13 22:08:13 +03:00
|
|
|
Global.mainModule.DropCurrentFile();
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void showDone() throws Exception {
|
|
|
|
|
//отобразить отсутствие файла.
|
|
|
|
|
UI.getMainWindow().getProjectWindow().ShowNoFile();
|
|
|
|
|
}
|
|
|
|
|
}
|