no message
This commit is contained in:
45
src/_VisualDVM/Passes/All/CloseCurrentFile.java
Normal file
45
src/_VisualDVM/Passes/All/CloseCurrentFile.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
import javax.swing.*;
|
||||
public class CloseCurrentFile extends Pass<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 = 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();
|
||||
UI.getSearchReplaceWindow().ClearMarkers();
|
||||
target.form = null;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Global.mainModule.DropCurrentFile();
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
//отобразить отсутствие файла.
|
||||
UI.getMainWindow().getProjectWindow().ShowNoFile();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user