package _VisualDVM.TestingSystem.DVM.DVMConfiguration.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
public class DVMConfigurationDialog extends DBObjectDialog<DVMConfiguration, DVMConfigurationFields> {
    public DVMConfigurationDialog() {
        super(DVMConfigurationFields.class);
    }
    @Override
    public int getDefaultHeight() {
        return 300;
    }
    @Override
    public int getDefaultWidth() {
        return 500;
    }
    @Override
    public void fillFields() {
        fields.tfName.setText(Result.description);
        //------->>>>
        fields.sCompilationMaxtime.setValue(Result.c_maxtime);
        fields.sRunMaxtime.setValue(Result.maxtime);
        fields.sKernels.setValue(Result.kernels);
        fields.cbGroupsOnly.setSelected(Result.groupsOnly != 0);
    }
    @Override
    public void ProcessResult() {
        Result.description = fields.tfName.getText();
        Result.c_maxtime = (int) fields.sCompilationMaxtime.getValue();
        Result.maxtime = (int) fields.sRunMaxtime.getValue();
        Result.kernels = (int) fields.sKernels.getValue();
        Result.groupsOnly = fields.cbGroupsOnly.isSelected() ? 1 : 0;
    }
    @Override
    public void SetReadonly() {
        fields.tfName.setEnabled(false);
        fields.sCompilationMaxtime.setEnabled(false);
        fields.sRunMaxtime.setEnabled(false);
        fields.sKernels.setEnabled(false);
        fields.cbGroupsOnly.setEnabled(false);
    }
}
