52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
package Common.Passes.All;
|
|
import Common.Current;
|
|
import Common.UI.UI;
|
|
import Common.Utils.Utils;
|
|
import ProjectData.Files.DBProjectFile;
|
|
import Common.Passes.PassCode_2021;
|
|
import Common.Passes.Pass_2021;
|
|
|
|
import javax.swing.*;
|
|
public class CloseCurrentFile extends Pass_2021<DBProjectFile> {
|
|
@Override
|
|
public String getIconPath() {
|
|
return "/icons/Close.png";
|
|
}
|
|
@Override
|
|
public Icon getTabIcon() {
|
|
return Utils.getIcon("/icons/Close_18.png");
|
|
}
|
|
@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());
|
|
passes.get(PassCode_2021.Save).Do();
|
|
UI.getSearchReplaceForm().ClearMarkers();
|
|
target.form = null;
|
|
}
|
|
@Override
|
|
protected void performDone() throws Exception {
|
|
Current.set(Current.File, null);
|
|
Current.set(Current.FileGraphElement, null);
|
|
//-
|
|
Current.set(Current.Notes, null);
|
|
Current.set(Current.Warnings, null);
|
|
Current.set(Current.Errors, null);
|
|
//-
|
|
}
|
|
@Override
|
|
protected void showDone() throws Exception {
|
|
//отобразить отсутствие файла.
|
|
UI.getMainWindow().getProjectWindow().ShowNoFile();
|
|
}
|
|
}
|