2024-10-08 00:39:13 +03:00
|
|
|
|
package Common.Visual;
|
2024-10-07 14:22:52 +03:00
|
|
|
|
import Common.CommonConstants;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import Common.Database.Objects.DBObject;
|
2024-10-15 23:01:36 +03:00
|
|
|
|
import Common.Database.Objects.Grid.TableVisualData;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import Common.Database.Tables.DBTable;
|
|
|
|
|
|
import Common.Database.Tables.DataSet;
|
|
|
|
|
|
import Common.Database.Tables.FKBehaviour;
|
2024-10-15 13:35:33 +03:00
|
|
|
|
import Common.MainModule_;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
import Common.Utils.Utils_;
|
2024-10-17 21:24:55 +03:00
|
|
|
|
import Common.Visual.Menus.DataMenuBar;
|
2024-10-09 20:35:18 +03:00
|
|
|
|
import Common.Visual.Menus.TableMenu;
|
|
|
|
|
|
import Common.Visual.Tables.ColumnInfo;
|
2024-10-15 15:13:57 +03:00
|
|
|
|
import Common.Visual.Tables.DBObjectSelectionRenderer;
|
|
|
|
|
|
import Common.Visual.Tables.DBObjectSelector;
|
2024-10-09 20:35:18 +03:00
|
|
|
|
import Common.Visual.Tables.DataTable;
|
|
|
|
|
|
import Common.Visual.Tables.Grid.GridAnchestor;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
import javax.swing.table.TableColumn;
|
|
|
|
|
|
import java.awt.*;
|
2024-10-16 21:58:46 +03:00
|
|
|
|
import java.awt.event.KeyAdapter;
|
|
|
|
|
|
import java.awt.event.KeyEvent;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
import java.awt.event.MouseAdapter;
|
|
|
|
|
|
import java.awt.event.MouseEvent;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import java.util.stream.IntStream;
|
2024-10-17 17:37:59 +03:00
|
|
|
|
public class DataSetControlForm extends ControlForm<DataTable> {
|
2024-10-17 21:24:55 +03:00
|
|
|
|
protected DataSet dataSource; //источник данных
|
|
|
|
|
|
protected DataMenuBar bar = null; //верхняя панель меню
|
|
|
|
|
|
protected int current_row_i; //индекс текущей строки.
|
2023-09-17 22:13:42 +03:00
|
|
|
|
protected boolean events_on = true;
|
|
|
|
|
|
protected String colNamesAndSizes = "";
|
2024-10-17 21:24:55 +03:00
|
|
|
|
protected Vector<ColumnInfo> columns = new Vector<>(); //информация о столбцах и их оформлении
|
2024-10-17 21:49:18 +03:00
|
|
|
|
//фильтры и подсчеты. todo слить с баром (?)
|
|
|
|
|
|
MatchesCounter f_ui = null;
|
|
|
|
|
|
protected Vector<DataSetFiltersMenu> filters = new Vector<>();
|
2024-10-17 20:04:16 +03:00
|
|
|
|
public DataSetControlForm(DataSet dataSource_in, JPanel mountPanel_in) {
|
|
|
|
|
|
super(DataTable.class, mountPanel_in);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
dataSource = dataSource_in;
|
2024-10-17 21:24:55 +03:00
|
|
|
|
//--
|
|
|
|
|
|
if (hasMenuBar()) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
if (!MainModule_.instance.getUI().menuBars.containsKey(dataSource.getClass())) {
|
|
|
|
|
|
bar = createMenuBar();
|
|
|
|
|
|
if (hasCheckBox())
|
|
|
|
|
|
bar.createSelectionButtons(dataSource);
|
|
|
|
|
|
MainModule_.instance.getUI().menuBars.put(dataSource.getClass(), bar);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
bar = MainModule_.instance.getUI().menuBars.get(dataSource.getClass());
|
|
|
|
|
|
}
|
|
|
|
|
|
mountPanel.add(bar, BorderLayout.NORTH);
|
|
|
|
|
|
//--
|
|
|
|
|
|
f_ui = (count -> bar.countLabel.setText(String.valueOf(count)));
|
|
|
|
|
|
//--
|
2024-10-17 21:49:18 +03:00
|
|
|
|
createFilters();
|
|
|
|
|
|
if (!filters.isEmpty()) {
|
|
|
|
|
|
for (DataSetFiltersMenu filter : filters)
|
|
|
|
|
|
bar.addMenus(filter.getMenu());
|
|
|
|
|
|
}
|
2024-10-17 21:24:55 +03:00
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
public void SaveColumns() {
|
2024-10-16 00:40:45 +03:00
|
|
|
|
if (MainModule_.instance.getDb() != null) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
try {
|
2024-10-17 17:37:59 +03:00
|
|
|
|
if (dataSource.CurrentName() != null) {
|
|
|
|
|
|
String tableName = dataSource.CurrentName().toString();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
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);
|
2024-10-08 00:39:13 +03:00
|
|
|
|
TableVisualData tableVisualData;
|
2024-10-16 00:40:45 +03:00
|
|
|
|
if (MainModule_.instance.getDb().tablesVisualData.containsKey(tableName)) {
|
|
|
|
|
|
tableVisualData = MainModule_.instance.getDb().tablesVisualData.get(tableName);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
} else {
|
2024-10-08 00:39:13 +03:00
|
|
|
|
tableVisualData = new TableVisualData(tableName);
|
2024-10-16 00:40:45 +03:00
|
|
|
|
MainModule_.instance.getDb().Insert(tableVisualData);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2024-10-08 00:39:13 +03:00
|
|
|
|
tableVisualData.sizes = packed;
|
2024-10-16 00:40:45 +03:00
|
|
|
|
MainModule_.instance.getDb().Update(tableVisualData);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private Vector<String> getHeaders() {
|
|
|
|
|
|
return columns.stream().map(ColumnInfo::getName).collect(Collectors.toCollection(Vector::new));
|
|
|
|
|
|
}
|
|
|
|
|
|
protected void CreateColumnsInfo() {
|
|
|
|
|
|
columns.clear();
|
2024-10-17 17:37:59 +03:00
|
|
|
|
columns.add(new ColumnInfo(dataSource.getPKName()));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (hasCheckBox()) {
|
2024-10-15 15:13:57 +03:00
|
|
|
|
columns.add(new ColumnInfo("", DBObjectSelectionRenderer.class, DBObjectSelector.class));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
columns.get(1).setMinWidth(25);
|
|
|
|
|
|
columns.get(1).setMaxWidth(25);
|
|
|
|
|
|
}
|
2024-10-17 17:37:59 +03:00
|
|
|
|
Arrays.stream(dataSource.getUIColumnNames()).forEach(name -> columns.add(new ColumnInfo(name)));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
AdditionalInitColumns();
|
|
|
|
|
|
}
|
|
|
|
|
|
protected void AdditionalInitColumns() {
|
|
|
|
|
|
//уточнение инфы по столбцам.
|
|
|
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
|
@Override
|
2024-10-17 20:04:16 +03:00
|
|
|
|
protected void createControl() {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
CreateColumnsInfo();
|
|
|
|
|
|
GridAnchestor table_data_model = new GridAnchestor(getHeaders(), dataSource.getVisibleKeys()) {
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Object getValueAt(int rowIndex, int columnIndex) {
|
|
|
|
|
|
Object key = data.get(rowIndex);
|
|
|
|
|
|
if (columnIndex == 0)
|
|
|
|
|
|
return key;
|
2024-10-17 17:37:59 +03:00
|
|
|
|
DBObject object = dataSource.get((key));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if ((columnIndex == 1) && hasCheckBox())
|
|
|
|
|
|
return object.isSelected();
|
2024-10-17 17:37:59 +03:00
|
|
|
|
return dataSource.getFieldAt(object, columnIndex);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public boolean isCellEditable(int row, int col) {
|
|
|
|
|
|
return columns.get(col).isEditable();
|
|
|
|
|
|
}
|
|
|
|
|
|
//------------------------------------------------------------------------------------
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void setValueAt(Object value, int row, int col) {
|
|
|
|
|
|
fireTableCellUpdated(row, col);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
control = new DataTable(table_data_model) {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public TableMenu CreateMenu() {
|
|
|
|
|
|
return new TableMenu(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
//строго говоря эта штука нужна только для рендереров и едиторов клеток.
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public DBObject getRowObject(int rowIndex) {
|
|
|
|
|
|
//вот так делать НЕЛЬЗЯ. модель только для внутреннего пользования
|
|
|
|
|
|
// Object key = table_data_model.data.get(rowIndex);
|
|
|
|
|
|
//из таблицы можно пользоваться только getValueAt
|
|
|
|
|
|
//иначе сортировка не будет работать.
|
|
|
|
|
|
Object key = getValueAt(rowIndex, 0);
|
2024-10-17 17:37:59 +03:00
|
|
|
|
return dataSource.get(key);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
//-----------------------------NEW-------------------------------------
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void CorrectColumnsSizes() {
|
2024-10-16 00:40:45 +03:00
|
|
|
|
if ((MainModule_.instance.getDb() != null)
|
2024-10-17 17:37:59 +03:00
|
|
|
|
&& dataSource.CurrentName() != null
|
|
|
|
|
|
&& MainModule_.instance.getDb().tablesVisualData.containsKey(dataSource.CurrentName().toString())) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
2024-10-17 17:37:59 +03:00
|
|
|
|
TableVisualData grid = MainModule_.instance.getDb().tablesVisualData.get(dataSource.CurrentName().toString());
|
2023-09-17 22:13:42 +03:00
|
|
|
|
String[] data = grid.sizes.split("\\|");
|
|
|
|
|
|
for (int i = 0; i < columns.size(); ++i) {
|
|
|
|
|
|
if (i <= (data.length - 1)) {
|
|
|
|
|
|
int width = Integer.parseInt(data[i]);
|
|
|
|
|
|
getColumnModel().getColumn(i).setPreferredWidth(width);
|
|
|
|
|
|
getColumnModel().getColumn(i).setWidth(width);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else
|
|
|
|
|
|
super.CorrectColumnsSizes(); //обычный авторазмер.
|
|
|
|
|
|
}
|
|
|
|
|
|
public String getColumnsProfile() {
|
|
|
|
|
|
String res = "";
|
|
|
|
|
|
for (int i = 0; i < getColumnModel().getColumnCount(); i++) {
|
|
|
|
|
|
if (i > 0) res += ",";
|
|
|
|
|
|
TableColumn column = getColumnModel().getColumn(i);
|
|
|
|
|
|
res += column.getHeaderValue();
|
|
|
|
|
|
res += ":";
|
|
|
|
|
|
res += column.getWidth();
|
|
|
|
|
|
}
|
|
|
|
|
|
return res;
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void Init() {
|
|
|
|
|
|
for (int i = 0; i < columns.size(); i++) {
|
|
|
|
|
|
ColumnInfo columnInfo = columns.get(i);
|
|
|
|
|
|
if (columnInfo.isVisible()) {
|
|
|
|
|
|
if (columnInfo.hasRenderer())
|
2024-10-15 15:13:57 +03:00
|
|
|
|
getColumnModel().getColumn(i).setCellRenderer(MainModule_.instance.getUI().getTableRenderer(columnInfo.getRendererClass()));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (columnInfo.hasEditor())
|
2024-10-15 15:13:57 +03:00
|
|
|
|
getColumnModel().getColumn(i).setCellEditor(MainModule_.instance.getUI().getTableEditor(columnInfo.getEditorClass()));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (columnInfo.hasMaxWidth())
|
|
|
|
|
|
getColumnModel().getColumn((i)).setMaxWidth(columnInfo.getMaxWidth());
|
|
|
|
|
|
if (columnInfo.hasMinWidth())
|
|
|
|
|
|
getColumnModel().getColumn((i)).setMinWidth(columnInfo.getMinWidth());
|
|
|
|
|
|
} else {
|
|
|
|
|
|
getColumnModel().getColumn(i).setMinWidth(0);
|
|
|
|
|
|
getColumnModel().getColumn(i).setMaxWidth(0);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//обновление в БД при ручном изменении размера столбиков.--------->>
|
|
|
|
|
|
getTableHeader().addMouseListener(new MouseAdapter() {
|
|
|
|
|
|
public void mouseReleased(MouseEvent arg0) {
|
|
|
|
|
|
String new_colNamesAndSizes = getColumnsProfile();
|
|
|
|
|
|
// check if changed, if yes, persist...
|
|
|
|
|
|
if (!colNamesAndSizes.equals(new_colNamesAndSizes)) {
|
|
|
|
|
|
colNamesAndSizes = new_colNamesAndSizes;
|
|
|
|
|
|
SaveColumns();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
//------------------------->>
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2024-10-17 17:37:59 +03:00
|
|
|
|
if (dataSource.CurrentName() != null) {
|
2024-10-07 14:22:52 +03:00
|
|
|
|
current_row_i = CommonConstants.Nan;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
ListSelectionModel selModel = control.getSelectionModel();
|
|
|
|
|
|
selModel.addListSelectionListener(e -> {
|
|
|
|
|
|
int row = control.getSelectedRow();
|
|
|
|
|
|
if ((row >= 0)) {
|
|
|
|
|
|
if (row != current_row_i) {
|
|
|
|
|
|
current_row_i = row;
|
2024-10-17 17:37:59 +03:00
|
|
|
|
dataSource.setCurrent(control.getRowObject(row));
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (events_on) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
ShowCurrentObject();
|
|
|
|
|
|
} catch (Exception ex) {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog.PrintException(ex);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
2024-10-07 14:22:52 +03:00
|
|
|
|
current_row_i = CommonConstants.Nan;
|
2024-10-17 17:37:59 +03:00
|
|
|
|
dataSource.dropCurrent();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (events_on) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
ShowNoCurrentObject();
|
|
|
|
|
|
} catch (Exception ex) {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog.PrintException(ex);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
//двойной клик мыши.------------------------------------------------------
|
|
|
|
|
|
control.addMouseListener(new MouseAdapter() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
|
if ((e.getClickCount() == 2) && (dataSource.getCurrent() != null)) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
MouseAction2();
|
|
|
|
|
|
} catch (Exception ex) {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog.PrintException(ex);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2024-10-16 21:58:46 +03:00
|
|
|
|
control.addKeyListener(new KeyAdapter() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void keyPressed(KeyEvent e) {
|
|
|
|
|
|
switch (e.getKeyCode()) {
|
|
|
|
|
|
case KeyEvent.VK_DELETE:
|
|
|
|
|
|
if (dataSource.getDeletePassCode() != null) {
|
|
|
|
|
|
MainModule_.instance.getPass(dataSource.getDeletePassCode()).Do();
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case KeyEvent.VK_ENTER:
|
|
|
|
|
|
try {
|
|
|
|
|
|
MouseAction2();
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
Utils_.MainLog.PrintException(ex);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
//при переотображении таблицы скидываем текущий объект!!
|
2024-10-17 17:37:59 +03:00
|
|
|
|
dataSource.dropCurrent();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
try {
|
|
|
|
|
|
ShowNoCurrentObject();
|
|
|
|
|
|
} catch (Exception e) {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
Utils_.MainLog.PrintException(e);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-17 21:24:55 +03:00
|
|
|
|
protected DataMenuBar createMenuBar() {
|
|
|
|
|
|
return new DataMenuBar(dataSource.getPluralDescription());
|
|
|
|
|
|
}
|
2024-10-17 21:49:18 +03:00
|
|
|
|
protected void createFilters() {}
|
|
|
|
|
|
protected boolean applyFiltersMenus(DBObject object){
|
|
|
|
|
|
for (DataSetFiltersMenu filterMenu : filters) {
|
|
|
|
|
|
if (!filterMenu.Validate(object))
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
public boolean ApplyFilters(DBObject object) {
|
|
|
|
|
|
//могут быть и другие фильтры ( например свои/активные). перенести их сюда и обобщить
|
|
|
|
|
|
return applyFiltersMenus(object);
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
@Override
|
2024-10-17 20:04:16 +03:00
|
|
|
|
protected void redrawControl() {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
control.CorrectSizes();
|
|
|
|
|
|
}
|
2024-10-17 21:24:55 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
public void Show() {
|
2024-10-17 21:49:18 +03:00
|
|
|
|
for (DataSetFiltersMenu filterMenu : filters) filterMenu.Drop();
|
2024-10-17 21:24:55 +03:00
|
|
|
|
super.Show();
|
|
|
|
|
|
if (f_ui != null) f_ui.ShowMatchesCount(getRowCount());
|
2024-10-17 21:49:18 +03:00
|
|
|
|
for (DataSetFiltersMenu filterMenu : filters) filterMenu.Refresh();
|
2024-10-17 21:24:55 +03:00
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
public void Show(Object pk) {
|
|
|
|
|
|
Show();
|
|
|
|
|
|
Select(pk);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void Select(Object pk) {
|
|
|
|
|
|
if (isShown())
|
|
|
|
|
|
control.SelectRowByPK(pk);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void ClearSelection() {
|
2024-10-17 21:24:55 +03:00
|
|
|
|
if (isShown()) control.clearSelection(); //строка сбросится сама. благодаря сбросу события выбора
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void Clear() {
|
|
|
|
|
|
super.Clear();
|
|
|
|
|
|
if (f_ui != null) f_ui.ShowNoMatches();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
public int getRowCount() {
|
|
|
|
|
|
return control.getRowCount();
|
|
|
|
|
|
}
|
|
|
|
|
|
public void ShowCurrentObject() throws Exception {
|
|
|
|
|
|
if (dataSource instanceof DBTable) {
|
|
|
|
|
|
DBTable table = (DBTable) dataSource;
|
|
|
|
|
|
for (Class dep : table.getFKDependencies().keySet()) {
|
|
|
|
|
|
FKBehaviour behaviour = table.getFKDependencies().get(dep);
|
|
|
|
|
|
switch (behaviour.ui) {
|
|
|
|
|
|
case ACTIVE:
|
2024-10-17 17:22:33 +03:00
|
|
|
|
table.getDb().getTable(dep).ShowUI();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
break;
|
|
|
|
|
|
case PASSIVE:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public void ShowNoCurrentObject() throws Exception {
|
|
|
|
|
|
if (dataSource instanceof DBTable) {
|
|
|
|
|
|
DBTable table = (DBTable) dataSource;
|
|
|
|
|
|
for (Class dep : table.getFKDependencies().keySet()) {
|
|
|
|
|
|
FKBehaviour behaviour = table.getFKDependencies().get(dep);
|
|
|
|
|
|
switch (behaviour.ui) {
|
|
|
|
|
|
case ACTIVE:
|
2024-10-17 17:22:33 +03:00
|
|
|
|
table.getDb().getTable(dep).ClearUI();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
break;
|
|
|
|
|
|
case PASSIVE:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-17 21:24:55 +03:00
|
|
|
|
public void MouseAction2() throws Exception {
|
|
|
|
|
|
}
|
|
|
|
|
|
//-
|
|
|
|
|
|
public boolean hasCheckBox() {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
public boolean hasMenuBar() {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|