no message
This commit is contained in:
@@ -2,9 +2,9 @@ package _VisualDVM;
|
||||
import Common.Current_;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Mode;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Loggable;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.GlobalData.Account.AccountRole;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
@@ -77,57 +77,57 @@ public class Global {
|
||||
|
||||
public static void SynschronizeProperties() {
|
||||
try {
|
||||
File new_propertiesFile = new File(CommonUtils.getHomeDirectory(), "properties");
|
||||
File new_propertiesFile = new File(Utils_.getHomeDirectory(), "properties");
|
||||
if (new_propertiesFile.exists())
|
||||
properties = (GlobalProperties) CommonUtils.jsonFromFile(new_propertiesFile, GlobalProperties.class);
|
||||
CommonUtils.jsonToFile(properties, new_propertiesFile);
|
||||
properties = (GlobalProperties) Utils_.jsonFromFile(new_propertiesFile, GlobalProperties.class);
|
||||
Utils_.jsonToFile(properties, new_propertiesFile);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static void CheckVisualiserDirectories() {
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils.CheckDirectory(RepoDirectory = new File(CommonUtils.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils.CheckDirectory(BugReportsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils.CheckDirectory(BackUpsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.BackUpsDirectoryName));
|
||||
Utils.CheckDirectory(ProjectsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ProjectsDirectoryName));
|
||||
Utils.CheckDirectory(CompilationTasksDirectory = new File(CommonUtils.getHomeDirectory(), Constants.CompilationTasksDirectoryName));
|
||||
Utils.CheckDirectory(RunTasksDirectory = new File(CommonUtils.getHomeDirectory(), Constants.RunTasksDirectoryName));
|
||||
Utils.CheckDirectory(StsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.StsDirectoryName));
|
||||
Utils.CheckDirectory(TestsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils.CheckDirectory(PerformanceAnalyzerDirectory = new File(CommonUtils.getHomeDirectory(), Constants.PerformanceAnalyzerDirectoryName));
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
||||
Utils.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils.CheckDirectory(BackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.BackUpsDirectoryName));
|
||||
Utils.CheckDirectory(ProjectsDirectory = new File(Utils_.getHomeDirectory(), Constants.ProjectsDirectoryName));
|
||||
Utils.CheckDirectory(CompilationTasksDirectory = new File(Utils_.getHomeDirectory(), Constants.CompilationTasksDirectoryName));
|
||||
Utils.CheckDirectory(RunTasksDirectory = new File(Utils_.getHomeDirectory(), Constants.RunTasksDirectoryName));
|
||||
Utils.CheckDirectory(StsDirectory = new File(Utils_.getHomeDirectory(), Constants.StsDirectoryName));
|
||||
Utils.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils.CheckDirectory(PerformanceAnalyzerDirectory = new File(Utils_.getHomeDirectory(), Constants.PerformanceAnalyzerDirectoryName));
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
||||
//через пару версий заменить на clean.
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = new File(CommonUtils.getHomeDirectory(), "SapforPackages"));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(CommonUtils.getHomeDirectory(), "Machines"));
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages"));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
|
||||
}
|
||||
public static void CheckServerDirectories() {
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils.CheckDirectory(BugReportsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils.CheckDirectory(DataBackUpsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(CommonUtils.getHomeDirectory(), "Machines"));
|
||||
Utils.CheckDirectory(BugReportsDirectory = new File(Utils_.getHomeDirectory(), Constants.BugsDirectoryName));
|
||||
Utils.CheckDirectory(DataBackUpsDirectory = new File(Utils_.getHomeDirectory(), Constants.DataBackUpsDirectoryName));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
|
||||
}
|
||||
public static void CheckTestingSystemDirectories() {
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
Utils.CheckDirectory(ComponentsDirectory = new File(Utils_.getHomeDirectory(), Constants.ComponentsDirectoryName));
|
||||
Utils.CheckAndCleanDirectory(TempDirectory = new File(Utils_.getHomeDirectory(), Constants.TempDirectoryName));
|
||||
Utils.CheckDirectory(DataDirectory = new File(Utils_.getHomeDirectory(), Constants.DataDirectoryName));
|
||||
//-
|
||||
Utils.CheckDirectory(TestsDirectory = new File(CommonUtils.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils.CheckDirectory(RepoDirectory = new File(CommonUtils.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = new File(CommonUtils.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
||||
Utils.CheckDirectory(SapforsDirectory = new File(CommonUtils.getHomeDirectory(), "Sapfors"));
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = new File(CommonUtils.getHomeDirectory(), "SapforPackages"));
|
||||
Utils.CheckDirectory(TestsDirectory = new File(Utils_.getHomeDirectory(), Constants.TestsDirectoryName));
|
||||
Utils.CheckDirectory(RepoDirectory = new File(Utils_.getHomeDirectory(), Constants.RepoDirectoryName));
|
||||
Utils.CheckDirectory(DVMPackagesDirectory = new File(Utils_.getHomeDirectory(), Constants.DVMPackagesDirectoryName));
|
||||
Utils.CheckDirectory(SapforsDirectory = new File(Utils_.getHomeDirectory(), "Sapfors"));
|
||||
Utils.CheckDirectory(SapforPackagesDirectory = new File(Utils_.getHomeDirectory(), "SapforPackages"));
|
||||
//CheclAndClean через неделю
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(CommonUtils.getHomeDirectory(), "Machines"));
|
||||
Utils.CheckDirectory(MachinesDirectory = new File(Utils_.getHomeDirectory(), "Machines"));
|
||||
}
|
||||
public static void CreateLogAtComponentsPath() {
|
||||
CommonUtils.MainLog = new Loggable() {
|
||||
Utils_.MainLog = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return Paths.get(System.getProperty("user.dir"), "Components").toString();
|
||||
@@ -137,25 +137,25 @@ public class Global {
|
||||
return "VisualDVM";
|
||||
}
|
||||
};
|
||||
CommonUtils.MainLog.ClearLog();
|
||||
Utils_.MainLog.ClearLog();
|
||||
}
|
||||
public static void CreateLogAtHome() {
|
||||
CommonUtils.MainLog = new Loggable() {
|
||||
Utils_.MainLog = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return CommonUtils.getHomePath();
|
||||
return Utils_.getHomePath();
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return mode.toString();
|
||||
}
|
||||
};
|
||||
CommonUtils.MainLog.ClearLog();
|
||||
Utils_.MainLog.ClearLog();
|
||||
}
|
||||
//-
|
||||
public static void FinishApplication() {
|
||||
try {
|
||||
if (CommonUtils.db != null) CommonUtils.db.Disconnect();
|
||||
if (Utils_.db != null) Utils_.db.Disconnect();
|
||||
if (componentsServer.db != null)
|
||||
componentsServer.db.Disconnect();
|
||||
if (testingServer.db != null)
|
||||
@@ -167,8 +167,8 @@ public class Global {
|
||||
if (performanceAnalyzer != null)
|
||||
performanceAnalyzer.Shutdown();
|
||||
} catch (Exception ex) {
|
||||
if (CommonUtils.MainLog != null) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
if (Utils_.MainLog != null) {
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
} else {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
@@ -176,11 +176,11 @@ public class Global {
|
||||
System.exit(0);
|
||||
}
|
||||
public static void ActivateDB() throws Exception {
|
||||
CommonUtils.db = new GlobalDatabase();
|
||||
CommonUtils.db.Connect();
|
||||
CommonUtils.db.CreateAllTables();
|
||||
CommonUtils.db.prepareTablesStatements();
|
||||
CommonUtils.db.Synchronize();
|
||||
Utils_.db = new GlobalDatabase();
|
||||
Utils_.db.Connect();
|
||||
Utils_.db.CreateAllTables();
|
||||
Utils_.db.prepareTablesStatements();
|
||||
Utils_.db.Synchronize();
|
||||
}
|
||||
public static void RefreshUpdatesStatus() {
|
||||
Components.RefreshUI();
|
||||
@@ -225,7 +225,7 @@ public class Global {
|
||||
forbidden.add(SettingName.Precompilation);
|
||||
forbidden.add(SettingName.DVMConvertationOptions);
|
||||
forbidden.add(SettingName.SaveModifications);
|
||||
for (DBSetting setting : ((GlobalDatabase) CommonUtils.db).settings.getSettingsByOwner(ComponentType.SapforOptions)) {
|
||||
for (DBSetting setting : ((GlobalDatabase) Utils_.db).settings.getSettingsByOwner(ComponentType.SapforOptions)) {
|
||||
if (!forbidden.contains(setting.Name))
|
||||
res_.add(setting.Value);
|
||||
}
|
||||
@@ -248,8 +248,8 @@ public class Global {
|
||||
}
|
||||
}
|
||||
public static void NormalMode(int port) throws Exception {
|
||||
CommonUI.active = true;
|
||||
CommonUI.setTheme(new LightSPFEditorTheme());
|
||||
UI_.active = true;
|
||||
UI_.setTheme(new LightSPFEditorTheme());
|
||||
removeOldDatabases();
|
||||
CheckVisualiserDirectories();
|
||||
CreateLogAtComponentsPath();
|
||||
@@ -258,8 +258,8 @@ public class Global {
|
||||
visualizer_2.Connect();
|
||||
visualizer_2.refreshPid();
|
||||
//если делать раньше, то не удастся убить сервер.
|
||||
if (CommonUtils.ContainsCyrillic(CommonUtils.getHomePath())) {
|
||||
CommonUI.Info("В пути к корневой папке " + CommonUtils.DQuotes(CommonUtils.getHomePath()) + "\n" +
|
||||
if (Utils_.ContainsCyrillic(Utils_.getHomePath())) {
|
||||
UI_.Info("В пути к корневой папке " + Utils_.DQuotes(Utils_.getHomePath()) + "\n" +
|
||||
"Найдены русские буквы.\n" +
|
||||
"Визуализатор завершает работу."); //
|
||||
FinishApplication();
|
||||
@@ -270,7 +270,7 @@ public class Global {
|
||||
UI.CreateAll();
|
||||
Pass.CreateAll();
|
||||
//единственное меню до остальных.
|
||||
CommonUI.menuBars.put(ComponentsSet.class, new ComponentsMenuBar());
|
||||
UI_.menuBars.put(ComponentsSet.class, new ComponentsMenuBar());
|
||||
Components = new ComponentsSet();
|
||||
Current_.set(Current.ProjectView, ProjectView.Files);
|
||||
Components.put(ComponentType.Visualiser, visualiser = new Visualiser());
|
||||
@@ -297,10 +297,10 @@ public class Global {
|
||||
do {
|
||||
UI.ShowComponentsWindow();
|
||||
if (flag = (!ValidateComponentsStates())) {
|
||||
if (!CommonUI.Question("Найдено " + bad_state + " некорректных необходимых компонент.Работа визуализатора невозможна.\n" +
|
||||
if (!UI_.Question("Найдено " + bad_state + " некорректных необходимых компонент.Работа визуализатора невозможна.\n" +
|
||||
"Вернуться к окну компонент"
|
||||
)) {
|
||||
CommonUI.Info("Визуализатор завершает работу.");
|
||||
UI_.Info("Визуализатор завершает работу.");
|
||||
FinishApplication();
|
||||
}
|
||||
}
|
||||
@@ -322,10 +322,10 @@ public class Global {
|
||||
testingServer.ActivateDB();
|
||||
//в проперти их!
|
||||
//-- чисто чтобы создать таблицы. соединения на стороне клиента не предвидится.
|
||||
if (((GlobalDatabase) CommonUtils.db).settings.get(SettingName.AutoBugReportsLoad).toBoolean())
|
||||
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.AutoBugReportsLoad).toBoolean())
|
||||
Pass.passes.get(PassCode.SynchronizeBugReports).Do();
|
||||
//--
|
||||
if (((GlobalDatabase) CommonUtils.db).settings.get(SettingName.AutoTestsLoad).toBoolean())
|
||||
if (((GlobalDatabase) Utils_.db).settings.get(SettingName.AutoTestsLoad).toBoolean())
|
||||
Pass.passes.get(PassCode.SynchronizeTests).Do();
|
||||
Pass.CheckAllStats();
|
||||
Current.getSapfor().refreshPid(); //без сапфора сюда это все равно не дойдет.
|
||||
@@ -371,7 +371,7 @@ public class Global {
|
||||
//---
|
||||
public static void Init(String... args) {
|
||||
System.out.println("VisualSapfor.jar started..");
|
||||
System.out.println("home directory is" + CommonUtils.Brackets(CommonUtils.getHomePath()));
|
||||
System.out.println("home directory is" + Utils_.Brackets(Utils_.getHomePath()));
|
||||
//---
|
||||
SynschronizeProperties();
|
||||
mode = properties.Mode;
|
||||
@@ -402,8 +402,8 @@ public class Global {
|
||||
} catch (Exception ex) {
|
||||
System.out.println("VISUALISER FAILED");
|
||||
ex.printStackTrace();
|
||||
if (CommonUtils.MainLog != null)
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
if (Utils_.MainLog != null)
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
FinishApplication();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user