2024-10-09 22:21:57 +03:00
|
|
|
package _VisualDVM.GlobalData.SapforProfile;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common.Database.Objects.DBObject;
|
|
|
|
|
import Common.Database.Tables.FKBehaviour;
|
|
|
|
|
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
|
|
|
|
import Common.Database.Tables.FKDataBehaviour;
|
|
|
|
|
import Common.Database.Tables.iDBTable;
|
2024-10-14 15:19:13 +03:00
|
|
|
import Common.Visual.DataSetControlForm;
|
|
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|
|
|
|
import _VisualDVM.Current;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.GlobalData.SapforProfile.UI.SapforProfileFields;
|
|
|
|
|
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
public class SapforProfilesDBTable extends iDBTable<SapforProfile> {
|
|
|
|
|
public SapforProfilesDBTable() {
|
|
|
|
|
super(SapforProfile.class);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected DataSetControlForm createUI() {
|
2024-10-16 19:52:16 +03:00
|
|
|
return new DataSetControlForm(this){
|
|
|
|
|
@Override
|
|
|
|
|
public boolean hasCheckBox() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
return new String[]{
|
|
|
|
|
"Описание",
|
|
|
|
|
"Дата создания"
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Object getFieldAt(SapforProfile object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
case 2:
|
2024-10-16 19:52:16 +03:00
|
|
|
return object.description;
|
|
|
|
|
case 3:
|
2023-09-17 22:13:42 +03:00
|
|
|
return new Date(object.creationDate);
|
|
|
|
|
default:
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Current CurrentName() {
|
|
|
|
|
return Current.SapforProfile;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DBObjectDialog<SapforProfile, SapforProfileFields> getDialog() {
|
|
|
|
|
return new DBObjectDialog<SapforProfile, SapforProfileFields>(SapforProfileFields.class) {
|
|
|
|
|
@Override
|
|
|
|
|
public int getDefaultHeight() {
|
|
|
|
|
return 250;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void fillFields() {
|
|
|
|
|
fields.tfDescription.setText(edit ? Result.description : "По умолчанию");
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public void ProcessResult() {
|
|
|
|
|
Result.description = fields.tfDescription.getText();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
|
|
|
|
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
|
|
|
|
res.put(SapforProfileSetting.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
|
|
|
|
return res;
|
|
|
|
|
}
|
2024-10-14 20:57:18 +03:00
|
|
|
@Override
|
|
|
|
|
public Class getMenuBarClass() {
|
|
|
|
|
return SapforProfilesMenuBar.class;
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|