приведение фильтров к объекту интерфейса таблицы
This commit is contained in:
@@ -72,7 +72,7 @@ public class Group extends riDBObject {
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!GroupsDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(sender_address)) &&
|
||||
Global.testingServer.db.groups.applyFilters(this);
|
||||
Global.testingServer.db.groups.getUI().ApplyFilters(this);
|
||||
}
|
||||
public String getSummary() {
|
||||
return description + " " + language.getDescription();
|
||||
|
||||
@@ -9,7 +9,7 @@ import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import Common.Visual.DataSetFiltersMenu;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.UI;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
@@ -33,34 +33,6 @@ public class GroupsDBTable extends iDBTable<Group> {
|
||||
}
|
||||
//------------------------------------------------>>>
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
filters.add(new Common.Visual.DataSetFilter<Group>("Тип", this) {
|
||||
@Override
|
||||
public void fill() {
|
||||
for (TestType type : TestType.values())
|
||||
field_filters.add(new Common.Visual.DBObjectFilter<Group>(dataSet, type.getDescription()) {
|
||||
@Override
|
||||
protected boolean validate(Group object) {
|
||||
return object.type.equals(type);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
filters.add(new DataSetFilter<Group>("Язык", this) {
|
||||
@Override
|
||||
public void fill() {
|
||||
for (LanguageName languageName : LanguageName.values()) {
|
||||
field_filters.add(new DBObjectFilter<Group>(dataSet, languageName.getDescription()) {
|
||||
@Override
|
||||
protected boolean validate(Group object) {
|
||||
return object.language.equals(languageName);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "группа тестов";
|
||||
}
|
||||
@@ -108,6 +80,34 @@ public class GroupsDBTable extends iDBTable<Group> {
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
filters.add(new DataSetFiltersMenu<Group>("Тип", dataSource) {
|
||||
@Override
|
||||
public void fill() {
|
||||
for (TestType type : TestType.values())
|
||||
field_filters.add(new Common.Visual.DBObjectFilter<Group>(dataSet, type.getDescription()) {
|
||||
@Override
|
||||
protected boolean validate(Group object) {
|
||||
return object.type.equals(type);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
filters.add(new DataSetFiltersMenu<Group>("Язык", dataSource) {
|
||||
@Override
|
||||
public void fill() {
|
||||
for (LanguageName languageName : LanguageName.values()) {
|
||||
field_filters.add(new DBObjectFilter<Group>(dataSet, languageName.getDescription()) {
|
||||
@Override
|
||||
protected boolean validate(Group object) {
|
||||
return object.language.equals(languageName);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user