no message
This commit is contained in:
@@ -20,7 +20,6 @@ import javax.swing.*;
|
||||
import java.util.LinkedHashMap;
|
||||
//-
|
||||
public class GroupsDBTable extends iDBTable<Group> {
|
||||
public static boolean filterMyOnly = false;
|
||||
public GroupsDBTable() {
|
||||
super(Group.class);
|
||||
}
|
||||
|
||||
@@ -2,20 +2,19 @@ package _VisualDVM.TestingSystem.Common.Group.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
import Common.Visual.FilterFlagMenuItem;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.DataSetFiltersMenu;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Tables.HeaderTextFilter;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Group.GroupsDBTable;
|
||||
import _VisualDVM.TestingSystem.Common.Test.TestType;
|
||||
|
||||
import javax.swing.*;
|
||||
public class GroupsForm extends DataSetControlForm<Group> {
|
||||
public static boolean filterMyOnly = false;
|
||||
public GroupsForm(DataSet<?, Group> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@@ -50,7 +49,7 @@ public class GroupsForm extends DataSetControlForm<Group> {
|
||||
@Override
|
||||
public boolean isObjectVisible(Group object) {
|
||||
return super.isObjectVisible(object) &&
|
||||
(!GroupsDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(object.sender_address)) &&
|
||||
(!filterMyOnly || Global.mainModule.getAccount().email.equals(object.sender_address)) &&
|
||||
Global.testingServer.db.groups.getUI().ApplyFilters(object);
|
||||
}
|
||||
@Override
|
||||
@@ -68,13 +67,13 @@ public class GroupsForm extends DataSetControlForm<Group> {
|
||||
setToolTipText("Отображать только группы тестов авторства пользователя");
|
||||
Mark();
|
||||
addActionListener(e -> {
|
||||
GroupsDBTable.filterMyOnly = !GroupsDBTable.filterMyOnly;
|
||||
filterMyOnly = !filterMyOnly;
|
||||
Mark();
|
||||
Global.testingServer.db.groups.ShowUI();
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(Utils_.getIcon(GroupsDBTable.filterMyOnly ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
setIcon(Utils_.getIcon(filterMyOnly ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -86,7 +85,7 @@ public class GroupsForm extends DataSetControlForm<Group> {
|
||||
@Override
|
||||
public void fill() {
|
||||
for (TestType type : TestType.values())
|
||||
field_filters.add(new Common.Visual.DBObjectFilter<Group>(dataSet, type.getDescription()) {
|
||||
field_filters.add(new FilterFlagMenuItem<Group>(dataSet, type.getDescription()) {
|
||||
@Override
|
||||
protected boolean validate(Group object) {
|
||||
return object.type.equals(type);
|
||||
@@ -98,7 +97,7 @@ public class GroupsForm extends DataSetControlForm<Group> {
|
||||
@Override
|
||||
public void fill() {
|
||||
for (LanguageName languageName : LanguageName.values()) {
|
||||
field_filters.add(new DBObjectFilter<Group>(dataSet, languageName.getDescription()) {
|
||||
field_filters.add(new FilterFlagMenuItem<Group>(dataSet, languageName.getDescription()) {
|
||||
@Override
|
||||
protected boolean validate(Group object) {
|
||||
return object.language.equals(languageName);
|
||||
|
||||
Reference in New Issue
Block a user