no message
This commit is contained in:
31
src/_VisualDVM/Passes/All/OpenCurrentFile.java
Normal file
31
src/_VisualDVM/Passes/All/OpenCurrentFile.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.Pass;
|
||||
public class OpenCurrentFile extends Pass<DBProjectFile> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = (args.length > 0) ? (DBProjectFile) args[0] : null;
|
||||
return (target != null) && (!Global.mainModule.HasFile() || (!Global.mainModule.getFile().file.equals(target.file)));
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
//закрыть старый текущий файл.
|
||||
Global.mainModule.getPass(PassCode.CloseCurrentFile).Do();
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
Global.mainModule.set(Current.File, target);
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
//отобразить новый текущий файл.
|
||||
UI.getMainWindow().getProjectWindow().ShowFile();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user