2024-10-20 17:27:58 +03:00
|
|
|
package _VisualDVM.GlobalData.Compiler.UI;
|
|
|
|
|
import Common.Database.Tables.DataSet;
|
|
|
|
|
import Common.Visual.DataSetControlForm;
|
|
|
|
|
import Common.Visual.Menus.DataMenuBar;
|
2024-10-22 16:44:13 +03:00
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
2024-10-20 17:27:58 +03:00
|
|
|
import _VisualDVM.Global;
|
|
|
|
|
import _VisualDVM.GlobalData.Compiler.Compiler;
|
2024-10-24 23:40:24 +03:00
|
|
|
import _VisualDVM.GlobalData.Machine.Machine;
|
2024-10-20 17:27:58 +03:00
|
|
|
import _VisualDVM.Passes.PassCode;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
public class CompilersForm extends DataSetControlForm<Compiler> {
|
|
|
|
|
public CompilersForm(DataSet<?, Compiler> dataSource_in, JPanel mountPanel_in) {
|
|
|
|
|
super(dataSource_in, mountPanel_in);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
return new String[]{
|
|
|
|
|
"описание",
|
|
|
|
|
"команда вызова",
|
|
|
|
|
"версия",
|
|
|
|
|
"ревизия"};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 16:44:13 +03:00
|
|
|
public Object getFieldAt(Compiler object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
case 2:
|
|
|
|
|
return object.description;
|
|
|
|
|
case 3:
|
|
|
|
|
return object.call_command;
|
|
|
|
|
case 4:
|
|
|
|
|
return object.version;
|
|
|
|
|
case 5:
|
|
|
|
|
return object.revision;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-20 17:27:58 +03:00
|
|
|
protected void AdditionalInitColumns() {
|
|
|
|
|
columns.get(0).setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected void ShowCurrentObject() throws Exception {
|
2024-10-20 17:27:58 +03:00
|
|
|
super.ShowCurrentObject();
|
|
|
|
|
Global.mainModule.getUI().getMainWindow().getTestingWindow().ShowCurrentCompiler();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected void ShowNoCurrentObject() throws Exception {
|
2024-10-20 17:27:58 +03:00
|
|
|
super.ShowNoCurrentObject();
|
|
|
|
|
Global.mainModule.getUI().getMainWindow().getTestingWindow().ShowCurrentCompiler();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DataMenuBar createMenuBar() {
|
2024-10-22 19:17:01 +03:00
|
|
|
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.AddCompiler,
|
2024-10-20 17:27:58 +03:00
|
|
|
PassCode.EditCompiler,
|
|
|
|
|
PassCode.DeleteCompiler,
|
|
|
|
|
PassCode.ShowCompilerVersion,
|
|
|
|
|
PassCode.ShowCompilerHelp);
|
|
|
|
|
}
|
2024-10-20 20:51:23 +03:00
|
|
|
@Override
|
|
|
|
|
public boolean isObjectVisible(Compiler object) {
|
2024-10-24 23:40:24 +03:00
|
|
|
return super.isObjectVisible(object) &&
|
|
|
|
|
Global.mainModule.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id);
|
2024-10-20 21:59:39 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected DBObjectDialog getDialog() {
|
2024-10-22 16:44:13 +03:00
|
|
|
return new CompilerDialog();
|
2024-10-20 20:51:23 +03:00
|
|
|
}
|
2024-10-20 17:27:58 +03:00
|
|
|
}
|