Фильтры у групп, и тестов изменены на фильтры по ИЛИ. Отдельные виды фильтров ( например язык тестов и тип тестов, все еще взаимодействут по И)
Добавлена возможность экспорта соответствующих фильтрам задач пакета DVM в Excel. v++
This commit is contained in:
@@ -7,16 +7,19 @@ public class TableFilter<D extends DBObject> {
|
||||
DataSet table;
|
||||
public JMenuItem menuItem; //пункт меню фильтра. ( возможно потом сделать и кнопку)
|
||||
String description;
|
||||
boolean active = false; //включен ли фильтр
|
||||
public boolean active = true; //включен ли фильтр
|
||||
public int count = 0;
|
||||
protected boolean validate(D object) {
|
||||
return true;
|
||||
}
|
||||
public boolean Validate(D object) {
|
||||
boolean valid;
|
||||
if (valid=validate(object))
|
||||
count++;
|
||||
return !active || valid;
|
||||
if (active) {
|
||||
boolean valid = validate(object);
|
||||
if (valid)
|
||||
count++;
|
||||
return valid;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
static String getNotActiveIconPath() {
|
||||
return "/icons/NotPick.png";
|
||||
@@ -24,9 +27,10 @@ public class TableFilter<D extends DBObject> {
|
||||
static String getActiveIconPath() {
|
||||
return "/icons/Pick.png";
|
||||
}
|
||||
public TableFilter(DataSet table_in, String description_in) {
|
||||
public TableFilter(DataSet table_in, String description_in, boolean active_in) {
|
||||
table = table_in;
|
||||
menuItem = new StableMenuItem((description = description_in)+" (0)");
|
||||
active=active_in;
|
||||
menuItem.addActionListener(e -> {
|
||||
active = !active;
|
||||
Mark();
|
||||
@@ -34,6 +38,9 @@ public class TableFilter<D extends DBObject> {
|
||||
});
|
||||
Mark();
|
||||
}
|
||||
public TableFilter(DataSet table_in, String description_in){
|
||||
this(table_in,description_in,true);
|
||||
}
|
||||
public void Mark() {
|
||||
menuItem.setIcon(Utils.getIcon(active ? getActiveIconPath() : getNotActiveIconPath()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user