2024-10-09 22:21:57 +03:00
|
|
|
package _VisualDVM.GlobalData.Makefile;
|
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;
|
2024-10-16 20:45:59 +03:00
|
|
|
import Common.Visual.Menus.DataMenuBar;
|
2024-10-14 15:19:13 +03:00
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|
|
|
|
import _VisualDVM.Current;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.GlobalData.Module.Module;
|
|
|
|
|
import _VisualDVM.GlobalData.Module.UI.ModuleAnchestorFields;
|
|
|
|
|
import _VisualDVM.GlobalData.Module.UI.ModuleAnchestorForm;
|
|
|
|
|
import _VisualDVM.GlobalData.Tasks.CompilationTask.CompilationTask;
|
2024-10-16 20:45:59 +03:00
|
|
|
import _VisualDVM.Passes.PassCode;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
public class MakefilesDBTable extends iDBTable<Makefile> {
|
|
|
|
|
public MakefilesDBTable() {
|
|
|
|
|
super(Makefile.class);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getSingleDescription() {
|
|
|
|
|
return "мейкфайл";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getPluralDescription() {
|
|
|
|
|
return "мейкфайлы";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DBObjectDialog<Makefile, ModuleAnchestorFields> getDialog() {
|
|
|
|
|
return new ModuleAnchestorForm<>();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
|
|
|
|
|
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
|
|
|
|
|
res.put(Module.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
|
|
|
|
res.put(CompilationTask.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected DataSetControlForm createUI() {
|
|
|
|
|
return new DataSetControlForm(this) {
|
|
|
|
|
@Override
|
|
|
|
|
protected void AdditionalInitColumns() {
|
|
|
|
|
columns.get(0).setVisible(false);
|
|
|
|
|
}
|
2024-10-16 19:40:55 +03:00
|
|
|
@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(Makefile object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
case 2:
|
2024-10-16 19:40:55 +03:00
|
|
|
return object.getCompilerDescription();
|
2023-09-17 22:13:42 +03:00
|
|
|
case 3:
|
2024-10-16 19:40:55 +03:00
|
|
|
return object.command;
|
|
|
|
|
case 4:
|
2023-09-17 22:13:42 +03:00
|
|
|
return object.flags;
|
|
|
|
|
default:
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Current CurrentName() {
|
|
|
|
|
return Current.Makefile;
|
|
|
|
|
}
|
2024-10-14 20:57:18 +03:00
|
|
|
@Override
|
2024-10-16 20:45:59 +03:00
|
|
|
public DataMenuBar createMenuBar() {
|
|
|
|
|
return new DataMenuBar(getPluralDescription(), PassCode.Compile,
|
|
|
|
|
PassCode.AddMakefile,
|
|
|
|
|
PassCode.EditMakefile,
|
|
|
|
|
PassCode.DeleteMakefile){
|
|
|
|
|
{
|
|
|
|
|
addSeparator();
|
|
|
|
|
addPasses(PassCode.ShowMakefilePreview, PassCode.EditProjectCompilationMaxtime);
|
|
|
|
|
}
|
|
|
|
|
};
|
2024-10-14 20:57:18 +03:00
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|