no message
This commit is contained in:
@@ -127,26 +127,7 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
return Data.containsKey(key);
|
||||
}
|
||||
//-
|
||||
public Vector<K> getVisibleKeys() {
|
||||
Comparator<D> comparator = getComparator();
|
||||
Vector<K> res = new Vector<>();
|
||||
if (comparator == null) {
|
||||
for (K key : Data.keySet())
|
||||
if (Data.get(key).isVisible())
|
||||
res.add(key);
|
||||
} else {
|
||||
Vector<D> raw = new Vector<>();
|
||||
for (D object : Data.values()) {
|
||||
if (object.isVisible())
|
||||
raw.add(object);
|
||||
}
|
||||
raw.sort(comparator);
|
||||
for (D object : raw)
|
||||
res.add((K) object.getPK());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
protected Comparator<D> getComparator() {
|
||||
public Comparator<D> getComparator() {
|
||||
return null;
|
||||
}
|
||||
public int getSelectedCount() {
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -111,11 +112,30 @@ public class DataSetControlForm extends ControlForm<DataTable> {
|
||||
protected void AdditionalInitColumns() {
|
||||
//уточнение инфы по столбцам.
|
||||
}
|
||||
Vector<Object> getVisibleKeys() {
|
||||
Comparator comparator = dataSource.getComparator();
|
||||
Vector<Object> res = new Vector<>();
|
||||
if (comparator == null) {
|
||||
for (Object key : dataSource.Data.keySet())
|
||||
if (dataSource.get(key).isVisible())
|
||||
res.add(key);
|
||||
} else {
|
||||
Vector<Object> raw = new Vector<>();
|
||||
for (Object object : dataSource.Data.values()) {
|
||||
if (((DBObject)object).isVisible())
|
||||
raw.add(object);
|
||||
}
|
||||
raw.sort(comparator);
|
||||
for (Object object : raw)
|
||||
res.add(((DBObject)object).getPK());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void createControl() {
|
||||
CreateColumnsInfo();
|
||||
GridAnchestor table_data_model = new GridAnchestor(getHeaders(), dataSource.getVisibleKeys()) {
|
||||
GridAnchestor table_data_model = new GridAnchestor(getHeaders(), getVisibleKeys()) {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
@@ -345,6 +365,7 @@ public class DataSetControlForm extends ControlForm<DataTable> {
|
||||
public int getRowCount() {
|
||||
return control.getRowCount();
|
||||
}
|
||||
|
||||
public void ShowCurrentObject() throws Exception {
|
||||
if (dataSource instanceof DBTable) {
|
||||
DBTable table = (DBTable) dataSource;
|
||||
|
||||
@@ -176,22 +176,22 @@ public class FileForm implements FileWindow, FormWithSplitters {
|
||||
@Override
|
||||
public void ShowWarningsCount() {
|
||||
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
|
||||
messagesTabs.setTitleAt(1, (flag ? "Предупреждения: " : "") + file.father.db.warnings.getVisibleKeys().size());
|
||||
messagesTabs.setTitleAt(1, (flag ? "Предупреждения: " : "") + file.father.db.warnings.getUI().getRowCount());
|
||||
}
|
||||
@Override
|
||||
public void ShowErrorsCount() {
|
||||
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
|
||||
messagesTabs.setTitleAt(2, (flag ? "Ошибки: " : "") + file.father.db.errors.getVisibleKeys().size());
|
||||
messagesTabs.setTitleAt(2, (flag ? "Ошибки: " : "") + file.father.db.errors.getUI().getRowCount());
|
||||
}
|
||||
@Override
|
||||
public void ShowNotesCount() {
|
||||
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
|
||||
messagesTabs.setTitleAt(0, (flag ? "Примечания: " : "") + file.father.db.notes.getVisibleKeys().size());
|
||||
messagesTabs.setTitleAt(0, (flag ? "Примечания: " : "") + file.father.db.notes.getUI().getRowCount());
|
||||
}
|
||||
@Override
|
||||
public void ShowRecommendationsCount() {
|
||||
boolean flag = (Global.mainModule.getDb()).settings.get(SettingName.ShowFullTabsNames).toBoolean();
|
||||
messagesTabs.setTitleAt(3, (flag ? "Рекомендации: " : "") + file.father.db.recommendations.getVisibleKeys().size());
|
||||
messagesTabs.setTitleAt(3, (flag ? "Рекомендации: " : "") + file.father.db.recommendations.getUI().getRowCount());
|
||||
}
|
||||
//---
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user