постепенное выведение старой концепции текущих объектов, касаемо табличных лучше держать их в интерфейсе таблиц, чтобы не писать описание объекта дважды и не мучиться с типом. некоторые фиксы
This commit is contained in:
@@ -43,8 +43,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
}
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
if (!Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
||||
Global.mainModule.getBugReport().descriptionAdditionDraft =
|
||||
if (!Global.componentsServer.db.bugReports.getUI().getCurrent().state.equals(BugReportState.draft))
|
||||
Global.componentsServer.db.bugReports.getUI().getCurrent().descriptionAdditionDraft =
|
||||
BugReportDescriptionAddition.getText();
|
||||
}
|
||||
};
|
||||
@@ -57,8 +57,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
}
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
if (!Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
||||
Global.mainModule.getBugReport().commentAdditionDraft = BugReportCommentAddition.getText();
|
||||
if (!Global.componentsServer.db.bugReports.getUI().getCurrent().state.equals(BugReportState.draft))
|
||||
Global.componentsServer.db.bugReports.getUI().getCurrent().commentAdditionDraft = BugReportCommentAddition.getText();
|
||||
}
|
||||
};
|
||||
DocumentListener descriptionListener = new DocumentListener() {
|
||||
@@ -70,10 +70,10 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
}
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
if (Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
||||
Global.mainModule.getBugReport().description =
|
||||
if (Global.componentsServer.db.bugReports.getUI().getCurrent().state.equals(BugReportState.draft))
|
||||
Global.componentsServer.db.bugReports.getUI().getCurrent().description =
|
||||
BugReportDescription.getText();
|
||||
Global.componentsServer.db.bugReports.getUI().Refresh();
|
||||
Global.componentsServer.db.bugReports.getUI().RedrawControl();
|
||||
}
|
||||
};
|
||||
DocumentListener commentListener = new DocumentListener() {
|
||||
@@ -85,8 +85,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
}
|
||||
@Override
|
||||
public void changedUpdate(DocumentEvent e) {
|
||||
if (Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
||||
Global.mainModule.getBugReport().comment = BugReportComment.getText();
|
||||
if (Global.componentsServer.db.bugReports.getUI().getCurrent().state.equals(BugReportState.draft))
|
||||
Global.componentsServer.db.bugReports.getUI().getCurrent().comment = BugReportComment.getText();
|
||||
}
|
||||
};
|
||||
//-------------------------------------------
|
||||
@@ -507,7 +507,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
public void ShowCurrentBugReport() {
|
||||
SwitchListeners(false);
|
||||
// currentBugReportTabs.setSelectedIndex(0);
|
||||
BugReport target = Global.mainModule.getBugReport();
|
||||
BugReport target = Global.componentsServer.db.bugReports.getUI().getCurrent();
|
||||
target.CheckSubscribers();
|
||||
Global.componentsServer.db.subscribers.ShowUI();
|
||||
//-
|
||||
|
||||
@@ -2,13 +2,10 @@ package _VisualDVM.Visual.Windows;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.ShortLabel;
|
||||
import Common.Visual.Menus.VisualiserMenuBar;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.Files.UI.Editor.SPFEditor;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Visual.Editor.BaseEditor;
|
||||
@@ -135,24 +132,14 @@ public abstract class ComparisonForm<T> {
|
||||
removeObject();
|
||||
showNoObject();
|
||||
ClearText();
|
||||
/*
|
||||
if (isMaster())
|
||||
slave.ClearText();
|
||||
else if (isSlave())
|
||||
master.ClearText();
|
||||
*/
|
||||
}
|
||||
public abstract Object getDefaultCurrentObject();
|
||||
public void ApplyObject() {
|
||||
RemoveObject();
|
||||
TextLog log = new TextLog();
|
||||
if (Global.mainModule.Check(log, getCurrentObjectName())) {
|
||||
object = (T) Global.mainModule.get(getCurrentObjectName());
|
||||
applyObject();
|
||||
showObject();
|
||||
} else
|
||||
UI.Info(log.toString());
|
||||
if (getDefaultCurrentObject()!=null)
|
||||
ApplyObject(getDefaultCurrentObject());
|
||||
else UI.Info("Текущий объект для сравнения не назначен!");
|
||||
}
|
||||
public void ApplyObject(DBObject object_in) {
|
||||
public void ApplyObject(Object object_in) {
|
||||
RemoveObject();
|
||||
object = (T) object_in;
|
||||
applyObject();
|
||||
@@ -272,7 +259,6 @@ public abstract class ComparisonForm<T> {
|
||||
}
|
||||
//Перегружаемые методы.
|
||||
//--->>
|
||||
protected abstract Current getCurrentObjectName();
|
||||
protected void showNoObject() {
|
||||
lObjectName.setText("?");
|
||||
lObjectName.setToolTipText("Объект не назначен.");
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
public class CompilationTasksComparisonForm extends TasksComparisonForm<CompilationTask> {
|
||||
public CompilationTasksComparisonForm(ComparisonForm<CompilationTask> slave_in) {
|
||||
super(CompilationTask.class, slave_in);
|
||||
}
|
||||
@Override
|
||||
protected Current getCurrentObjectName() {
|
||||
return Current.CompilationTask;
|
||||
public Object getDefaultCurrentObject() {
|
||||
return Global.mainModule.getDb().compilationTasks.getUI().getCurrent();
|
||||
}
|
||||
@Override
|
||||
protected String getTextByTab() {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
public class DVMRunTasksComparisonForm extends TasksComparisonForm<DVMRunTask> {
|
||||
public DVMRunTasksComparisonForm(ComparisonForm<DVMRunTask> slave_in) {
|
||||
super(DVMRunTask.class, slave_in);
|
||||
}
|
||||
@Override
|
||||
protected Current getCurrentObjectName() {
|
||||
return Current.DVMRunTask;
|
||||
public Object getDefaultCurrentObject() {
|
||||
return Global.testingServer.db.dvmRunTasks.getUI().getCurrent();
|
||||
}
|
||||
@Override
|
||||
protected String getTextByTab() {
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ProjectForm implements FormWithSplitters, ProjectWindow {
|
||||
}
|
||||
@Override
|
||||
public void RefreshProjectFiles() {
|
||||
filesForm.Refresh();
|
||||
filesForm.RedrawControl();
|
||||
}
|
||||
@Override
|
||||
public void ShowSelectedDirectory() {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.RunTask.RunTask;
|
||||
public class RunTasksComparisonForm extends TasksComparisonForm<RunTask> {
|
||||
public RunTasksComparisonForm(ComparisonForm<RunTask> slave_in) {
|
||||
super(RunTask.class, slave_in);
|
||||
}
|
||||
@Override
|
||||
protected Current getCurrentObjectName() {
|
||||
return Current.RunTask;
|
||||
public Object getDefaultCurrentObject() {
|
||||
return Global.mainModule.getDb().runTasks.getUI().getCurrent();
|
||||
}
|
||||
@Override
|
||||
protected TasksComparisonState getFirstState() {
|
||||
|
||||
@@ -96,8 +96,8 @@ public class SapforPackagesComparisonForm {
|
||||
RemoveObject();
|
||||
//---
|
||||
TextLog log = new TextLog();
|
||||
if (Global.mainModule.Check(log, Current.SapforPackage)) {
|
||||
object = Global.mainModule.getSapforPackage();
|
||||
if (Global.testingServer.db.sapforPackages.getUI().Check(log)) {
|
||||
object = Global.testingServer.db.sapforPackages.getUI().getCurrent();
|
||||
if (object.isLoaded() || (Global.mainModule.getPass(PassCode.DownloadSapforPackage).Do(object))) {
|
||||
showObject();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Constants;
|
||||
@@ -96,10 +97,6 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected Current getCurrentObjectName() {
|
||||
return current;
|
||||
}
|
||||
@Override
|
||||
protected String getText() {
|
||||
return isReady() ?
|
||||
(file.file.exists() ? Utils.ReadAllText(file.file) : "файл не найден")
|
||||
@@ -110,6 +107,10 @@ public class SapforVersionsComparisonForm extends ComparisonForm<SapforVersion_j
|
||||
return super.isReady() && file != null;
|
||||
}
|
||||
@Override
|
||||
public Object getDefaultCurrentObject() {
|
||||
return Global.mainModule.get(current);
|
||||
}
|
||||
@Override
|
||||
protected void showObject() {
|
||||
lObjectName.setText(object.toString());
|
||||
lObjectName.setToolTipText(object.Home.getName() + " : " + Utils_.Brackets(object.description));
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import Common.CommonConstants;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.FormWithSplitters;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Compiler.CompilerType;
|
||||
import _VisualDVM.GlobalData.Credentials.Credentials;
|
||||
import _VisualDVM.TestingSystem.Common.TestingServer;
|
||||
@@ -221,13 +223,14 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentCompiler() {
|
||||
String title = (Global.mainModule.HasCompiler() && Global.mainModule.getCompiler().type.equals(CompilerType.dvm)) ?
|
||||
"DVM система: " + Global.mainModule.getCompiler().description : "DVM система: ?";
|
||||
Compiler compiler = (MainModule_.instance.getDb().getTable(Compiler.class).getUI().getCurrent());
|
||||
String title = (compiler!=null)&& (compiler.type.equals(CompilerType.dvm)) ?
|
||||
"DVM система: " + compiler.description : "DVM система: ?";
|
||||
testingTabs.setTitleAt(0, title);
|
||||
}
|
||||
@Override
|
||||
public void ShowCurrentServerSapfor() {
|
||||
testingTabs.setTitleAt(2, "SAPFOR: " + Global.mainModule.getServerSapfor().version);
|
||||
testingTabs.setTitleAt(2, "SAPFOR: " + Global.testingServer.db.serverSapfors.getUI().getCurrent().version);
|
||||
}
|
||||
@Override
|
||||
public void ShowNoServerSapfor() {
|
||||
@@ -267,7 +270,8 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
testingTabs.setSelectedIndex(3);
|
||||
}
|
||||
public void RestoreLastCredentials() {
|
||||
Credentials credentials = Global.mainModule.getCredentials();
|
||||
/*
|
||||
Credentials credentials = MainModule_.instance.getDb().getTable(Credentials.class).get;
|
||||
if (credentials.machine_id != CommonConstants.Nan) {
|
||||
if (Global.mainModule.getDb().machines.containsKey(credentials.machine_id)) {
|
||||
(Global.mainModule.getDb()).machines.ShowUI(credentials.machine_id);
|
||||
@@ -307,6 +311,7 @@ public class TestingForm implements FormWithSplitters, TestingWindow {
|
||||
(Global.mainModule.getDb()).UpdateCredentials();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
public void CollapseCredentials() {
|
||||
|
||||
@@ -90,7 +90,7 @@ public class VariantsForm implements VariantsWindow {
|
||||
}
|
||||
@Override
|
||||
public void RefreshVariants() {
|
||||
Global.mainModule.getProject().parallelVariants.getUI().Refresh();
|
||||
Global.mainModule.getProject().parallelVariants.getUI().RedrawControl();
|
||||
}
|
||||
@Override
|
||||
public void ShowNoVariants() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Settings.SettingName;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
@@ -51,8 +50,8 @@ public class VersionsComparisonForm extends ComparisonForm<db_project_info> {
|
||||
return (VersionsComparisonForm) slave;
|
||||
}
|
||||
@Override
|
||||
protected Current getCurrentObjectName() {
|
||||
return Current.Version;
|
||||
public Object getDefaultCurrentObject() {
|
||||
return Global.mainModule.getVersion();
|
||||
}
|
||||
@Override
|
||||
protected String getText() {
|
||||
|
||||
Reference in New Issue
Block a user