45 lines
1.4 KiB
Java
45 lines
1.4 KiB
Java
package _VisualDVM.Passes.All;
|
|
import Common.Passes.Pass;
|
|
import Common.Utils.Utils_;
|
|
import _VisualDVM.Global;
|
|
import _VisualDVM.Passes.PassCode;
|
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
|
|
|
import javax.swing.*;
|
|
public class CloseCurrentFile extends Pass<DBProjectFile> {
|
|
@Override
|
|
public String getIconPath() {
|
|
return "/Common/icons/Close.png";
|
|
}
|
|
@Override
|
|
public Icon getTabIcon() {
|
|
return Utils_.getIcon("/Common/icons/Close_18.png");
|
|
}
|
|
@Override
|
|
public String getButtonText() {
|
|
return "";
|
|
}
|
|
@Override
|
|
protected boolean canStart(Object... args) throws Exception {
|
|
return (target = Global.mainModule.getFile()) != null;
|
|
}
|
|
@Override
|
|
protected void body() throws Exception {
|
|
//действия по закрытию. сохранение и т д.
|
|
target.form.SaveSplitters();
|
|
target.UpdateLastLine(target.form.getEditor().getCurrentLine());
|
|
Global.mainModule.getPass(PassCode.Save).Do();
|
|
Global.mainModule.getUI().getSearchReplaceWindow().ClearMarkers();
|
|
target.form = null;
|
|
}
|
|
@Override
|
|
protected void performDone() throws Exception {
|
|
Global.mainModule.DropCurrentFile();
|
|
}
|
|
@Override
|
|
protected void showDone() throws Exception {
|
|
//отобразить отсутствие файла.
|
|
Global.mainModule.getUI().getMainWindow().getProjectWindow().ShowNoFile();
|
|
}
|
|
}
|