вывод диалоговых форм для объектов в отдельный класс
This commit is contained in:
@@ -2,11 +2,8 @@ package _VisualDVM.TestingSystem.Common.Test;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.TestFields;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.TestsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -19,42 +16,6 @@ public class TestDBTable extends iDBTable<Test> {
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new TestsForm(this, mountPanel);
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<Test, TestFields> getDialog() {
|
||||
return new DBObjectDialog<Test, TestFields>(TestFields.class) {
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 200;
|
||||
}
|
||||
@Override
|
||||
public int getDefaultWidth() {
|
||||
return 400;
|
||||
}
|
||||
@Override
|
||||
public void validateFields() {
|
||||
if (!edit) {
|
||||
if (!Global.mainModule.getGroup().language.equals(Global.mainModule.getProject().languageName))
|
||||
Log.Writeln_("В текущую группу могут войти только тесты на языке " + Global.mainModule.getGroup().language);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void fillFields() {
|
||||
fields.tfName.setText(Result.description);
|
||||
fields.sMinDim.setValue(Result.min_dim);
|
||||
fields.sMaxDim.setValue(Result.max_dim);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.description = fields.tfName.getText();
|
||||
Result.min_dim = (int) fields.sMinDim.getValue();
|
||||
Result.max_dim = (int) fields.sMaxDim.getValue();
|
||||
if (!edit) {
|
||||
Result.sender_name = Global.mainModule.getAccount().name;
|
||||
Result.sender_address = Global.mainModule.getAccount().email;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
public boolean containsTestWithDescription(String description_in) {
|
||||
for (Test test : Data.values()) {
|
||||
if (test.description.equalsIgnoreCase(description_in))
|
||||
|
||||
Reference in New Issue
Block a user