fix.убрал из общей(в перспективе библиотечной) части ссылки на частные объекты визуализатора
This commit is contained in:
@@ -14,7 +14,6 @@ import Common.Visual.Tables.DBObjectSelectionRenderer;
|
||||
import Common.Visual.Tables.DBObjectSelector;
|
||||
import Common.Visual.Tables.DataTable;
|
||||
import Common.Visual.Tables.Grid.GridAnchestor;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
@@ -64,21 +63,21 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
return getDataSource().CurrentName();
|
||||
}
|
||||
public void SaveColumns() {
|
||||
if (Global.mainModule.getDb() != null) {
|
||||
if (MainModule_.instance.getDb() != null) {
|
||||
try {
|
||||
if ((CurrentName() != null)) {
|
||||
String tableName = CurrentName().toString();
|
||||
Vector<String> widths = IntStream.range(0, columns.size()).mapToObj(i -> String.valueOf(control.getColumnModel().getColumn(i).getWidth())).collect(Collectors.toCollection(Vector::new));
|
||||
String packed = String.join("|", widths);
|
||||
TableVisualData tableVisualData;
|
||||
if (Global.mainModule.getDb().tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = Global.mainModule.getDb().tablesVisualData.get(tableName);
|
||||
if (MainModule_.instance.getDb().tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = MainModule_.instance.getDb().tablesVisualData.get(tableName);
|
||||
} else {
|
||||
tableVisualData = new TableVisualData(tableName);
|
||||
Global.mainModule.getDb().Insert(tableVisualData);
|
||||
MainModule_.instance.getDb().Insert(tableVisualData);
|
||||
}
|
||||
tableVisualData.sizes = packed;
|
||||
Global.mainModule.getDb().Update(tableVisualData);
|
||||
MainModule_.instance.getDb().Update(tableVisualData);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -149,11 +148,11 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
//-----------------------------NEW-------------------------------------
|
||||
@Override
|
||||
public void CorrectColumnsSizes() {
|
||||
if ((Global.mainModule.getDb() != null)
|
||||
if ((MainModule_.instance.getDb() != null)
|
||||
&& CurrentName() != null
|
||||
&& Global.mainModule.getDb().tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
&& MainModule_.instance.getDb().tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
||||
TableVisualData grid = Global.mainModule.getDb().tablesVisualData.get(CurrentName().toString());
|
||||
TableVisualData grid = MainModule_.instance.getDb().tablesVisualData.get(CurrentName().toString());
|
||||
String[] data = grid.sizes.split("\\|");
|
||||
for (int i = 0; i < columns.size(); ++i) {
|
||||
if (i <= (data.length - 1)) {
|
||||
@@ -260,19 +259,6 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
//---
|
||||
/*
|
||||
if (hasCheckBox()) {
|
||||
TableColumn column = control.getColumnModel().getColumn(1)
|
||||
column.setHeaderRenderer(new TableCellRenderer() {
|
||||
@Override
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
return null;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected void refresh() {
|
||||
|
||||
Reference in New Issue
Block a user