рефакторинг. вынес в обобщенную часть бд, но еще не все
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package Visual_DVM_2021.UI.Main;
|
||||
import Common.CommonConstants;
|
||||
import Common.CurrentAnchestor;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common_old.Current;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import _VisualDVM.Global;
|
||||
import Common_old.UI.TextField.StyledTextField;
|
||||
import Common_old.UI.UI;
|
||||
@@ -128,9 +130,9 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
SC65.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, sc65Listener);
|
||||
SC66.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, sc66Listener);
|
||||
//-
|
||||
Global.db.machines.mountUI(machinesPanel);
|
||||
Global.db.users.mountUI(usersPanel);
|
||||
Global.db.compilers.mountUI(compilersPanel);
|
||||
((GlobalDatabase)CommonUtils.db).machines.mountUI(machinesPanel);
|
||||
((GlobalDatabase)CommonUtils.db).users.mountUI(usersPanel);
|
||||
((GlobalDatabase)CommonUtils.db).compilers.mountUI(compilersPanel);
|
||||
//-
|
||||
Global.testingServer.db.dvm_configurations.mountUI(configurationsPanel);
|
||||
Global.testingServer.db.dvmPackages.mountUI(dvmPackagesPanel);
|
||||
@@ -148,7 +150,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
//-
|
||||
@Override
|
||||
public void ShowAll() {
|
||||
Global.db.machines.ShowUI();
|
||||
((GlobalDatabase)CommonUtils.db).machines.ShowUI();
|
||||
Global.testingServer.db.dvm_configurations.ShowUI();
|
||||
Global.testingServer.db.dvmPackages.ShowUI();
|
||||
Global.testingServer.db.sapforPackages.ShowUI();
|
||||
@@ -271,33 +273,33 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
public void RestoreLastCredentials() {
|
||||
Credentials credentials = (Credentials) CurrentAnchestor.get(Current.Credentials);
|
||||
if (credentials.machine_id != CommonConstants.Nan) {
|
||||
if (Global.db.machines.containsKey(credentials.machine_id)) {
|
||||
Global.db.machines.ShowUI(credentials.machine_id);
|
||||
if (Global.db.users.containsKey(credentials.user_id)) {
|
||||
Global.db.users.ShowUI(credentials.user_id);
|
||||
if (((GlobalDatabase)CommonUtils.db).machines.containsKey(credentials.machine_id)) {
|
||||
((GlobalDatabase)CommonUtils.db).machines.ShowUI(credentials.machine_id);
|
||||
if (((GlobalDatabase)CommonUtils.db).users.containsKey(credentials.user_id)) {
|
||||
((GlobalDatabase)CommonUtils.db).users.ShowUI(credentials.user_id);
|
||||
} else {
|
||||
credentials.user_id = CommonConstants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
((GlobalDatabase)CommonUtils.db).UpdateCredentials();
|
||||
}
|
||||
if (Global.db.compilers.containsKey(credentials.compiler_id)) {
|
||||
Global.db.compilers.ShowUI(credentials.compiler_id);
|
||||
if (((GlobalDatabase)CommonUtils.db).compilers.containsKey(credentials.compiler_id)) {
|
||||
((GlobalDatabase)CommonUtils.db).compilers.ShowUI(credentials.compiler_id);
|
||||
} else {
|
||||
credentials.compiler_id = CommonConstants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
((GlobalDatabase)CommonUtils.db).UpdateCredentials();
|
||||
}
|
||||
//-
|
||||
if (Global.db.makefiles.containsKey(credentials.makefile_id)) {
|
||||
Global.db.makefiles.ShowUI(credentials.makefile_id);
|
||||
if (((GlobalDatabase)CommonUtils.db).makefiles.containsKey(credentials.makefile_id)) {
|
||||
((GlobalDatabase)CommonUtils.db).makefiles.ShowUI(credentials.makefile_id);
|
||||
} else {
|
||||
credentials.makefile_id = CommonConstants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
((GlobalDatabase)CommonUtils.db).UpdateCredentials();
|
||||
}
|
||||
//-
|
||||
if (Global.db.runConfigurations.containsKey(credentials.runconfiguration_id)) {
|
||||
Global.db.runConfigurations.ShowUI(credentials.runconfiguration_id);
|
||||
if (((GlobalDatabase)CommonUtils.db).runConfigurations.containsKey(credentials.runconfiguration_id)) {
|
||||
((GlobalDatabase)CommonUtils.db).runConfigurations.ShowUI(credentials.runconfiguration_id);
|
||||
} else {
|
||||
credentials.runconfiguration_id = CommonConstants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
((GlobalDatabase)CommonUtils.db).UpdateCredentials();
|
||||
}
|
||||
} else {
|
||||
credentials.machine_id = CommonConstants.Nan;
|
||||
@@ -306,13 +308,13 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
credentials.remotesapfor_id = CommonConstants.Nan;
|
||||
credentials.makefile_id = CommonConstants.Nan;
|
||||
credentials.runconfiguration_id = CommonConstants.Nan;
|
||||
Global.db.UpdateCredentials();
|
||||
((GlobalDatabase)CommonUtils.db).UpdateCredentials();
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void CollapseCredentials() {
|
||||
Global.db.splitters.get("SC71").position = SC71.getDividerLocation();
|
||||
CommonUtils.db.splitters.get("SC71").position = SC71.getDividerLocation();
|
||||
CommonUI.Clear(credentialsPanel);
|
||||
credentialsPanel.add(UI.credentialsBar);
|
||||
SC71.setDividerLocation(30);
|
||||
|
||||
Reference in New Issue
Block a user