package _VisualDVM.TestingSystem.Common.Group.UI;
import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.ProjectData.LanguageName;
import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.Test.TestType;
public class GroupDialog extends DBObjectDialog<Group, GroupFields> {
    public GroupDialog() {
        super(GroupFields.class);
    }
    @Override
    public int getDefaultHeight() {
        return 250;
    }
    @Override
    public int getDefaultWidth() {
        return 400;
    }
    @Override
    public void validateFields() {
    }
    @Override
    public void fillFields() {
        fields.tfName.setText(Result.description);
        UI.TrySelect(fields.cbType, Result.type);
        UI.TrySelect(fields.cbLanguage, Result.language);
    }
    @Override
    public void ProcessResult() {
        Result.description = fields.tfName.getText();
        Result.type = (TestType) fields.cbType.getSelectedItem();
        Result.language = (LanguageName) fields.cbLanguage.getSelectedItem();
    }
    @Override
    public void SetReadonly() {
        fields.tfName.setEnabled(false);
        fields.cbType.setEnabled(false);
        ;
        fields.cbLanguage.setEnabled(false);
        ;
    }
}
