package _VisualDVM.GlobalData.Compiler.UI; import Common.Database.Tables.DataSet; import Common.Visual.DataSetControlForm; import Common.Visual.Menus.DataMenuBar; import Common.Visual.Tables.ColumnInfo; import Common.Visual.Windows.Dialog.DBObjectDialog; import _VisualDVM.Global; import _VisualDVM.GlobalData.Compiler.Compiler; import _VisualDVM.GlobalData.Machine.Machine; import _VisualDVM.Passes.PassCode; import javax.swing.*; public class CompilersForm extends DataSetControlForm { public CompilersForm(DataSet dataSource_in, JPanel mountPanel_in) { super(dataSource_in, mountPanel_in); } @Override protected void createColumns() { AddColumns( new ColumnInfo("описание") { @Override public Object getFieldAt(Compiler object) { return object.description; } }, new ColumnInfo("команда вызова") { @Override public Object getFieldAt(Compiler object) { return object.call_command; } }, new ColumnInfo("версия") { @Override public Object getFieldAt(Compiler object) { return object.version; } }, new ColumnInfo("ревизия") { @Override public Object getFieldAt(Compiler object) { return object.revision; } } ); } @Override protected void ShowCurrentObject() throws Exception { super.ShowCurrentObject(); Global.mainModule.getUI().getMainWindow().getTestingWindow().ShowCurrentCompiler(); } @Override protected void ShowNoCurrentObject() throws Exception { super.ShowNoCurrentObject(); Global.mainModule.getUI().getMainWindow().getTestingWindow().ShowCurrentCompiler(); } @Override public DataMenuBar createMenuBar() { return new DataMenuBar(dataSource.getPluralDescription(), PassCode.AddCompiler, PassCode.EditCompiler, PassCode.DeleteCompiler, PassCode.ShowCompilerVersion, PassCode.ShowCompilerHelp); } @Override public boolean isObjectVisible(Compiler object) { return super.isObjectVisible(object) && Global.mainModule.getDb().getTable(Machine.class).getUI().matchCurrentID(object.machine_id); } @Override protected DBObjectDialog getDialog() { return new CompilerDialog(); } }