2023-09-17 22:13:42 +03:00
|
|
|
package GlobalData.Module;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common_old.Current;
|
|
|
|
|
import Common.Database.Tables.iDBTable;
|
2024-10-08 00:39:13 +03:00
|
|
|
import Common.Visual.DataSetControlForm;
|
2024-10-08 22:33:49 +03:00
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|
|
|
|
import Common.Visual.Windows.Dialog.DialogFields;
|
2023-09-17 22:13:42 +03:00
|
|
|
import GlobalData.Module.UI.ModuleAnchestorForm;
|
|
|
|
|
public class ModulesDBTable extends iDBTable<Module> {
|
|
|
|
|
public ModulesDBTable() {
|
|
|
|
|
super(Module.class);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getSingleDescription() {
|
|
|
|
|
return "языковой модуль";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getPluralDescription() {
|
|
|
|
|
return "языковые модули";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DBObjectDialog<Module, ? extends DialogFields> getDialog() {
|
|
|
|
|
return new ModuleAnchestorForm<>();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected DataSetControlForm createUI() {
|
|
|
|
|
return new DataSetControlForm(this) {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean hasCheckBox() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void AdditionalInitColumns() {
|
|
|
|
|
columns.get(0).setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Object getFieldAt(Module object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
case 2:
|
|
|
|
|
return object.language.getDescription();
|
|
|
|
|
case 3:
|
|
|
|
|
return object.getCompilerDescription();
|
|
|
|
|
case 4:
|
|
|
|
|
return object.command;
|
|
|
|
|
case 5:
|
|
|
|
|
return object.flags;
|
|
|
|
|
default:
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
return new String[]{
|
|
|
|
|
"Язык",
|
|
|
|
|
"Компилятор",
|
|
|
|
|
"Команда",
|
|
|
|
|
"Флаги"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Current CurrentName() {
|
|
|
|
|
return Current.Module;
|
|
|
|
|
}
|
|
|
|
|
}
|