рефакторинг. переносил текущие объекты в другое место
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package _VisualDVM.Repository.Component.Sapfor;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
@@ -28,8 +29,8 @@ public class MessagesServer {
|
||||
InputStreamReader(client.getInputStream()));
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
if (Current.HasPassForm())
|
||||
Current.getPassForm().Result.ShowSapforMessage(line);
|
||||
if (Global.mainModule.HasPassForm())
|
||||
Global.mainModule.getPassForm().Result.ShowSapforMessage(line);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// UI.Print(DebugPrintLevel.MessagesServer, "соединение сброшено!");
|
||||
|
||||
@@ -311,18 +311,18 @@ public abstract class Sapfor extends OSDComponent {
|
||||
//todo рефакторить. отвязать от текущего проекта.
|
||||
public void UpdateProjectFiles(boolean mode) throws Exception {
|
||||
ResetAllAnalyses();
|
||||
Current.getProject().dropLastModification();
|
||||
Global.mainModule.getProject().dropLastModification();
|
||||
DBProjectFile cuf = null;
|
||||
if (Current.HasFile()) {
|
||||
cuf = Current.getFile();
|
||||
if (Global.mainModule.HasFile()) {
|
||||
cuf = Global.mainModule.getFile();
|
||||
Pass.passes.get(PassCode.CloseCurrentFile).Do();
|
||||
}
|
||||
if (mode) //модификация
|
||||
{
|
||||
OldFiles.clear();
|
||||
for (String name : ModifiedFiles.keySet()) {
|
||||
if (Current.getProject().db.files.Data.containsKey(name)) {
|
||||
File file = Current.getProject().db.files.Data.get(name).file;
|
||||
if (Global.mainModule.getProject().db.files.Data.containsKey(name)) {
|
||||
File file = Global.mainModule.getProject().db.files.Data.get(name).file;
|
||||
OldFiles.put(name, Utils.ReadAllText(file));
|
||||
Utils.WriteToFile(file, ModifiedFiles.get(name));
|
||||
}
|
||||
@@ -332,7 +332,7 @@ public abstract class Sapfor extends OSDComponent {
|
||||
{
|
||||
if (OldFiles.size() > 0) {
|
||||
for (String name : OldFiles.keySet()) {
|
||||
File file = Current.getProject().db.files.Data.get(name).file;
|
||||
File file = Global.mainModule.getProject().db.files.Data.get(name).file;
|
||||
Utils.WriteToFile(file, OldFiles.get(name));
|
||||
}
|
||||
OldFiles.clear();
|
||||
|
||||
Reference in New Issue
Block a user