no message
This commit is contained in:
@@ -6,6 +6,7 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import Common.Visual.Menus.TableMenu;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
@@ -64,21 +65,21 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
return getDataSource().CurrentName();
|
||||
}
|
||||
public void SaveColumns() {
|
||||
if (Utils_.db != null) {
|
||||
if (Global.mainModule.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 (Utils_.db.tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = Utils_.db.tablesVisualData.get(tableName);
|
||||
if (Global.mainModule.getDb().tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = Global.mainModule.getDb().tablesVisualData.get(tableName);
|
||||
} else {
|
||||
tableVisualData = new TableVisualData(tableName);
|
||||
Utils_.db.Insert(tableVisualData);
|
||||
Global.mainModule.getDb().Insert(tableVisualData);
|
||||
}
|
||||
tableVisualData.sizes = packed;
|
||||
Utils_.db.Update(tableVisualData);
|
||||
Global.mainModule.getDb().Update(tableVisualData);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -149,9 +150,11 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
//-----------------------------NEW-------------------------------------
|
||||
@Override
|
||||
public void CorrectColumnsSizes() {
|
||||
if ((Utils_.db != null) && CurrentName() != null && Utils_.db.tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if ((Global.mainModule.getDb() != null)
|
||||
&& CurrentName() != null
|
||||
&& Global.mainModule.getDb().tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
||||
TableVisualData grid = Utils_.db.tablesVisualData.get(CurrentName().toString());
|
||||
TableVisualData grid = Global.mainModule.getDb().tablesVisualData.get(CurrentName().toString());
|
||||
String[] data = grid.sizes.split("\\|");
|
||||
for (int i = 0; i < columns.size(); ++i) {
|
||||
if (i <= (data.length - 1)) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package Common.Visual.Windows;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Database.Objects.DBForm.DBForm;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -73,8 +74,8 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
}
|
||||
public void LoadWindowParameters() throws Exception {
|
||||
if (getFormKey()!=null)
|
||||
if (Utils_.db.forms.Data.containsKey(getFormKey())) {
|
||||
dbInfo = Utils_.db.forms.Data.get(getFormKey());
|
||||
if (Global.mainModule.getDb().forms.Data.containsKey(getFormKey())) {
|
||||
dbInfo = Global.mainModule.getDb().forms.Data.get(getFormKey());
|
||||
dbInfo.Apply(this);
|
||||
return;
|
||||
}
|
||||
@@ -85,9 +86,9 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
if (getFormKey()!=null) {
|
||||
if (dbInfo != null) {
|
||||
dbInfo.Init(this);
|
||||
Utils_.db.Update(dbInfo);
|
||||
Global.mainModule.getDb().Update(dbInfo);
|
||||
} else
|
||||
Utils_.db.Insert(new DBForm(getFormKey(), this));
|
||||
Global.mainModule.getDb().Insert(new DBForm(getFormKey(), this));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user