no message
This commit is contained in:
@@ -69,11 +69,6 @@ public class Group extends riDBObject {
|
||||
}
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!GroupsDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(sender_address)) &&
|
||||
Global.testingServer.db.groups.getUI().ApplyFilters(this);
|
||||
}
|
||||
public String getSummary() {
|
||||
return description + " " + language.getDescription();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.AddGroupMenu;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.EditGroupMenu;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.GroupFields;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.GroupsForm;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.Common.Test.TestType;
|
||||
|
||||
@@ -48,76 +49,7 @@ public class GroupsDBTable extends iDBTable<Group> {
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new DataSetControlForm(this, mountPanel) {
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"тип",
|
||||
"язык"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(getPluralDescription(),
|
||||
PassCode.SynchronizeTests,
|
||||
PassCode.ConvertCorrectnessTests) {
|
||||
{
|
||||
addMenus(new AddGroupMenu(), new EditGroupMenu());
|
||||
addPasses(PassCode.DeleteGroup);
|
||||
add(new JSeparator());
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setText("Свои");
|
||||
setToolTipText("Отображать только группы тестов авторства пользователя");
|
||||
Mark();
|
||||
addActionListener(e -> {
|
||||
GroupsDBTable.filterMyOnly = !GroupsDBTable.filterMyOnly;
|
||||
Mark();
|
||||
Global.testingServer.db.groups.ShowUI();
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(Utils_.getIcon(GroupsDBTable.filterMyOnly ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
filtersMenus.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
filtersMenus.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return new GroupsForm(this, mountPanel);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
|
||||
94
src/_VisualDVM/TestingSystem/Common/Group/UI/GroupsForm.java
Normal file
94
src/_VisualDVM/TestingSystem/Common/Group/UI/GroupsForm.java
Normal file
@@ -0,0 +1,94 @@
|
||||
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.DataSetControlForm;
|
||||
import Common.Visual.DataSetFiltersMenu;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
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 GroupsForm(DataSet<?, Group> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"автор",
|
||||
"тип",
|
||||
"язык"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(Group object) {
|
||||
return (!GroupsDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(object.sender_address)) &&
|
||||
Global.testingServer.db.groups.getUI().ApplyFilters(object);
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription(),
|
||||
PassCode.SynchronizeTests,
|
||||
PassCode.ConvertCorrectnessTests) {
|
||||
{
|
||||
addMenus(new AddGroupMenu(), new EditGroupMenu());
|
||||
addPasses(PassCode.DeleteGroup);
|
||||
add(new JSeparator());
|
||||
add(new MenuBarButton() {
|
||||
{
|
||||
setText("Свои");
|
||||
setToolTipText("Отображать только группы тестов авторства пользователя");
|
||||
Mark();
|
||||
addActionListener(e -> {
|
||||
GroupsDBTable.filterMyOnly = !GroupsDBTable.filterMyOnly;
|
||||
Mark();
|
||||
Global.testingServer.db.groups.ShowUI();
|
||||
});
|
||||
}
|
||||
public void Mark() {
|
||||
setIcon(Utils_.getIcon(GroupsDBTable.filterMyOnly ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
filtersMenus.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
filtersMenus.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -56,11 +56,6 @@ public class Test extends riDBObject {
|
||||
if (UI.isActive())
|
||||
Global.mainModule.getUI().getMainWindow().ShowCheckedTestsCount();
|
||||
}
|
||||
//---
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Global.mainModule.matchCurrentID(Current.Group, group_id);
|
||||
}
|
||||
//-
|
||||
public File getArchive() {
|
||||
return new File(Global.TestsDirectory, id + ".zip");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.MainModule_;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
@@ -11,6 +12,7 @@ import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.AddTestMenu;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.EditTestMenu;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.TestFields;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.TestsForm;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Vector;
|
||||
@@ -28,33 +30,8 @@ public class TestDBTable extends iDBTable<Test> {
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new DataSetControlForm(this, mountPanel) {
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"min_dim",
|
||||
"max_dim",
|
||||
"файлы"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(getPluralDescription()) {
|
||||
{
|
||||
addMenus(new AddTestMenu(), new EditTestMenu());
|
||||
addPasses(PassCode.DownloadTest, PassCode.DeleteTest);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return new TestsForm(this, mountPanel);
|
||||
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
|
||||
45
src/_VisualDVM/TestingSystem/Common/Test/UI/TestsForm.java
Normal file
45
src/_VisualDVM/TestingSystem/Common/Test/UI/TestsForm.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test.UI;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
|
||||
import javax.swing.*;
|
||||
public class TestsForm extends DataSetControlForm<Test> {
|
||||
public TestsForm(DataSet<?, Test> dataSource_in, JPanel mountPanel_in) {
|
||||
super(dataSource_in, mountPanel_in);
|
||||
}
|
||||
@Override
|
||||
public boolean hasCheckBox() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{
|
||||
"имя",
|
||||
"min_dim",
|
||||
"max_dim",
|
||||
"файлы"
|
||||
};
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
}
|
||||
@Override
|
||||
public DataMenuBar createMenuBar() {
|
||||
return new DataMenuBar(dataSource.getPluralDescription()) {
|
||||
{
|
||||
addMenus(new AddTestMenu(), new EditTestMenu());
|
||||
addPasses(PassCode.DownloadTest, PassCode.DeleteTest);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(Test object) {
|
||||
return MainModule_.instance.matchCurrentID(Current.Group, object.group_id);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user