рефакторинг контролов таблиц. убрал странный и запутанный старый код
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.Current_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.Grid.TableVisualData;
|
||||
import Common.Database.Tables.DBTable;
|
||||
@@ -27,35 +26,15 @@ import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
public class DataSetControlForm extends ControlForm<DataTable> {
|
||||
protected JPanel dataPanel;
|
||||
|
||||
protected DataSet dataSource;
|
||||
protected int current_row_i;
|
||||
protected boolean events_on = true;
|
||||
protected String colNamesAndSizes = "";
|
||||
protected Vector<ColumnInfo> columns = new Vector<>();
|
||||
public DataSetControlForm(DataSet dataSource_in) {
|
||||
this(dataSource_in, DataTable.class);
|
||||
}
|
||||
public DataSetControlForm(DataSet dataSource_in, Class tableClass) {
|
||||
super(tableClass);
|
||||
public DataSetControlForm(DataSet dataSource_in, JPanel mountPanel_in) {
|
||||
super(DataTable.class, mountPanel_in);
|
||||
dataSource = dataSource_in;
|
||||
//---
|
||||
dataPanel = new JPanel(new BorderLayout());
|
||||
content.add(dataPanel, BorderLayout.CENTER);
|
||||
}
|
||||
public JPanel getDataPanel() {
|
||||
return dataPanel;
|
||||
}
|
||||
@Override
|
||||
public void Show() {
|
||||
super.Show();
|
||||
dataPanel.add(scroll);
|
||||
dataPanel.updateUI();
|
||||
}
|
||||
@Override
|
||||
public void Clear() {
|
||||
super.Clear();
|
||||
UI.Clear(dataPanel);
|
||||
}
|
||||
public void SaveColumns() {
|
||||
if (MainModule_.instance.getDb() != null) {
|
||||
@@ -101,7 +80,7 @@ public class DataSetControlForm extends ControlForm<DataTable> {
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void CreateControl() {
|
||||
protected void createControl() {
|
||||
CreateColumnsInfo();
|
||||
GridAnchestor table_data_model = new GridAnchestor(getHeaders(), dataSource.getVisibleKeys()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -276,7 +255,7 @@ public class DataSetControlForm extends ControlForm<DataTable> {
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void refresh() {
|
||||
protected void redrawControl() {
|
||||
control.CorrectSizes();
|
||||
}
|
||||
public void Show(Object pk) {
|
||||
|
||||
Reference in New Issue
Block a user