no message
This commit is contained in:
@@ -26,7 +26,7 @@ import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTable> {
|
||||
protected DataSet dataSource; //источник данных
|
||||
protected DataSet<?, D> dataSource; //источник данных
|
||||
protected DataMenuBar bar = null; //верхняя панель меню
|
||||
protected int current_row_i; //индекс текущей строки.
|
||||
protected boolean events_on = true;
|
||||
@@ -112,22 +112,25 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
protected void AdditionalInitColumns() {
|
||||
//уточнение инфы по столбцам.
|
||||
}
|
||||
public Comparator getDefaultComparator() {
|
||||
protected Comparator getDefaultComparator() {
|
||||
return null;
|
||||
}
|
||||
public boolean isObjectVisible(D object){
|
||||
return true;
|
||||
}
|
||||
Vector<Object> getVisibleKeys() {
|
||||
Comparator comparator = getDefaultComparator();
|
||||
Vector<Object> res_keys = new Vector<>();
|
||||
if (comparator == null) {
|
||||
for (Object key : dataSource.Data.keySet())
|
||||
if (dataSource.get(key).isVisible())
|
||||
res_keys.add(key);
|
||||
for (D object: dataSource.Data.values()){
|
||||
if (isObjectVisible(object))
|
||||
res_keys.add(object.getPK());
|
||||
}
|
||||
} else {
|
||||
Vector<D> raw = new Vector<>();
|
||||
for (Object object : dataSource.Data.values()) {
|
||||
D object1 = (D) object;
|
||||
if (object1.isVisible())
|
||||
raw.add(object1);
|
||||
for (D object : dataSource.Data.values()) {
|
||||
if (isObjectVisible(object))
|
||||
raw.add(object);
|
||||
}
|
||||
raw.sort(comparator);
|
||||
for (D object : raw)
|
||||
@@ -247,7 +250,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
if ((row >= 0)) {
|
||||
if (row != current_row_i) {
|
||||
current_row_i = row;
|
||||
dataSource.setCurrent(control.getRowObject(row));
|
||||
dataSource.setCurrent((D) control.getRowObject(row));
|
||||
if (events_on) {
|
||||
try {
|
||||
ShowCurrentObject();
|
||||
@@ -330,15 +333,6 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
//могут быть и другие фильтры ( например свои/активные). перенести их сюда и обобщить
|
||||
return applyFiltersMenus(object);
|
||||
}
|
||||
/*
|
||||
//todo упразднить.
|
||||
// применить значение фильтра к фильру объекта напирмер Message.filterValue = text;
|
||||
public void changeHeaderFilterValue(int columnIndex, String text) {
|
||||
}
|
||||
public Object getHeaderFilterValue(int columnIndex) {
|
||||
return "";
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
protected void redrawControl() {
|
||||
control.CorrectSizes();
|
||||
@@ -415,7 +409,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
if ((dataSource.CurrentName() != null) && (dataSource.getCurrent() != null)) {
|
||||
savedCurrentKey = dataSource.getCurrent().getPK();
|
||||
}
|
||||
savedSelectedKeys = dataSource.getSelectedKeys();
|
||||
savedSelectedKeys = (Vector<Object>) dataSource.getSelectedKeys();
|
||||
}
|
||||
public void RestoreLastCurrent() {
|
||||
for (Object key : savedSelectedKeys) {
|
||||
@@ -426,13 +420,4 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
SetCurrentByPK(savedCurrentKey);
|
||||
}
|
||||
}
|
||||
/*
|
||||
List<RowSorter.SortKey> sortKeys = new ArrayList<>();
|
||||
for (int i = 0; i < 6; ++i)
|
||||
sorter.setSortable(i, false);
|
||||
sortKeys.add(new RowSorter.SortKey(6, SortOrder.DESCENDING));
|
||||
sortKeys.add(new RowSorter.SortKey(7, SortOrder.DESCENDING));
|
||||
// sorter.setSortKeys(sortKeys);
|
||||
// sorter.sort();
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user