55 lines
1.7 KiB
Java
55 lines
1.7 KiB
Java
|
|
package Visual_DVM_2021.Passes;
|
||
|
|
import Common.Current;
|
||
|
|
import Common.Global;
|
||
|
|
import Common.UI.VisualCache.ConfigurationCache;
|
||
|
|
import Common.UI.VisualCache.VisualCaches;
|
||
|
|
import TestingSystem.Common.Configuration.Configuration;
|
||
|
|
import TestingSystem.Common.Group.Group;
|
||
|
|
import TestingSystem.Common.Test.Test;
|
||
|
|
|
||
|
|
import java.util.Vector;
|
||
|
|
public abstract class ShowCurrentConfigurationTests extends Pass_2021<Configuration> {
|
||
|
|
@Override
|
||
|
|
public String getIconPath() {
|
||
|
|
return "/icons/ShowPassword.png";
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
public String getButtonText() {
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
public abstract Current currentName();
|
||
|
|
@Override
|
||
|
|
protected boolean canStart(Object... args) throws Exception {
|
||
|
|
target = null;
|
||
|
|
if (Current.Check(Log, currentName())) {
|
||
|
|
target = (Configuration) Current.get(currentName());
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
protected void showPreparation() throws Exception {
|
||
|
|
Global.testingServer.db.UnselectAllGTC();
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
protected void showDone() throws Exception {
|
||
|
|
ConfigurationCache cache = (ConfigurationCache) VisualCaches.GetCache(target);
|
||
|
|
Vector<Group> groups = cache.getGroups();
|
||
|
|
Vector<Test> tests = cache.getTests();
|
||
|
|
//-----
|
||
|
|
//--
|
||
|
|
for (Group group: groups)
|
||
|
|
group.Select(true);
|
||
|
|
for (Test test: tests)
|
||
|
|
test.Select(true);
|
||
|
|
//--
|
||
|
|
if (!groups.isEmpty()){
|
||
|
|
Global.testingServer.db.groups.ShowUI(groups.lastElement().id);
|
||
|
|
}
|
||
|
|
if (!tests.isEmpty()){
|
||
|
|
Global.testingServer.db.tests.ShowUI(tests.lastElement().id);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|