437 lines
17 KiB
Java
437 lines
17 KiB
Java
package _VisualDVM;
|
||
import Common.CurrentAnchestor;
|
||
import GlobalData.Account.Account;
|
||
import GlobalData.Compiler.Compiler;
|
||
import GlobalData.Machine.Machine;
|
||
import GlobalData.Makefile.Makefile;
|
||
import GlobalData.Module.Module;
|
||
import GlobalData.RemoteFile.RemoteFile;
|
||
import GlobalData.RunConfiguration.RunConfiguration;
|
||
import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||
import GlobalData.Tasks.RunTask.RunTask;
|
||
import GlobalData.User.User;
|
||
import ProjectData.Files.DBProjectFile;
|
||
import ProjectData.Project.db_project_info;
|
||
import ProjectData.SapforData.Functions.FuncInfo;
|
||
import ProjectData.SapforData.Regions.ParallelRegion;
|
||
import Repository.BugReport.BugReport;
|
||
import Repository.Subscribes.Subscriber;
|
||
import TestingSystem.Common.Test.Test;
|
||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||
import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
|
||
import TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||
import Visual_DVM_2021.Passes.UI.PassForm;
|
||
|
||
import javax.swing.tree.DefaultMutableTreeNode;
|
||
import java.io.File;
|
||
public enum Current implements CurrentAnchestor {
|
||
//--
|
||
DVMPackage,
|
||
SapforPackage,
|
||
//--
|
||
ServerSapfor,
|
||
SapforEtalonVersion,
|
||
SapforVersion,
|
||
//--
|
||
ComponentServerBackup,
|
||
Subscriber,
|
||
FileGraphElement,
|
||
InlineGraphElement,
|
||
InlineGraphElement2,
|
||
IncludeGraphElement,
|
||
Component,
|
||
Project,
|
||
File,
|
||
Root,
|
||
Version,
|
||
BugReport,
|
||
Account,
|
||
DBArray,
|
||
ProjectArray,
|
||
ParallelRegionInfo,
|
||
ParallelVariant,
|
||
Machine,
|
||
User,
|
||
Compiler,
|
||
Makefile,
|
||
Module,
|
||
RunConfiguration,
|
||
EnvironmentValue,
|
||
CompilationTask,
|
||
RunTask,
|
||
ProjectNode, //узел в дереве проекта. нужен для отображения добавленных файлов
|
||
SelectedDirectory,
|
||
SelectedFile,
|
||
//текущий выбранный удаленный файл
|
||
RemoteFile,
|
||
PassForm, //текущее окно анимации. нужно для сообщений сапфора по сокету.
|
||
RunStsRecord,
|
||
//только для того, чтобы закодировать таблицу.
|
||
Array,
|
||
ParallelRegion,
|
||
Dimensions,
|
||
//----------
|
||
Warnings,
|
||
Errors,
|
||
Notes,
|
||
Recommendations,
|
||
//-
|
||
Sapfor,
|
||
//-
|
||
Scenario,
|
||
ScenarioCommand,
|
||
//-
|
||
DVMConfiguration,
|
||
Group,
|
||
//-
|
||
DVMParameterValue,
|
||
Test,
|
||
Function,
|
||
SelectedFunction,
|
||
//-
|
||
Credentials,
|
||
//-
|
||
PackageVersion,
|
||
SapforConfiguration,
|
||
SapforProfile,
|
||
SapforProfileSetting,
|
||
//--
|
||
ProjectView,
|
||
SubscriberWorkspace,
|
||
DVMRunTask,
|
||
SapforSettings,
|
||
SapforSettingsCommand,
|
||
DVMSettings;
|
||
@Override
|
||
public String getDescription() {
|
||
switch (this) {
|
||
case DVMSettings:
|
||
return "Параметры тестирования DVM системы";
|
||
case SapforSettings:
|
||
return "Параметры тестирования системы SAPFOR";
|
||
case SapforSettingsCommand:
|
||
return "Команда SAPFOR";
|
||
case DVMRunTask:
|
||
return "Задача DVM тестирования";
|
||
case SapforPackage:
|
||
return "Пакет тестирования SAPFOR";
|
||
case DVMPackage:
|
||
return "Пакет тестирования DVM";
|
||
case DVMConfiguration:
|
||
return "Конфигурация тестирования";
|
||
case ServerSapfor:
|
||
return "тестовая версия SAPFOR";
|
||
case SubscriberWorkspace:
|
||
return "рабочее пространство пользователя";
|
||
case SapforProfile:
|
||
return "Профиль SAPFOR";
|
||
case SapforProfileSetting:
|
||
return "Настройка профиля SAPFOR";
|
||
case SapforEtalonVersion:
|
||
return "Версия SAPFOR(Эталон)";
|
||
case SapforVersion:
|
||
return "Версия SAPFOR";
|
||
case ComponentServerBackup:
|
||
return "Версия компонента для восстановления с сервера";
|
||
case Subscriber:
|
||
return "Адресат";
|
||
case SelectedFunction:
|
||
return "Выбранный узел графа процедур";
|
||
case SapforConfiguration:
|
||
return "Конфигурация тестирования SAPFOR";
|
||
case PackageVersion:
|
||
return "Версия пакетного режима";
|
||
case Credentials:
|
||
return "Учётные данные";
|
||
case Function:
|
||
return "Функция";
|
||
case DVMParameterValue:
|
||
return "Параметр DVM системы";
|
||
case ParallelRegion:
|
||
return "Область распараллеливания";
|
||
case Group:
|
||
return "Группа тестов DVM";
|
||
case Scenario:
|
||
return "Сценарий";
|
||
case ScenarioCommand:
|
||
return "Команда сценария";
|
||
case ProjectNode:
|
||
return "текущий узел дерева проектов"; //служебка
|
||
case Test:
|
||
return "Тест";
|
||
case Sapfor:
|
||
return "SAPFOR";
|
||
case EnvironmentValue:
|
||
return "Значение переменной окружения";
|
||
case SelectedDirectory:
|
||
return "Папка проекта";
|
||
case SelectedFile:
|
||
return "Файл проекта";
|
||
case RunConfiguration:
|
||
return "Конфигурация запуска";
|
||
case RunTask:
|
||
return "Задача на запуск";
|
||
case CompilationTask:
|
||
return "Задача на компиляцию";
|
||
case Makefile:
|
||
return "Мейкфайл";
|
||
case Module:
|
||
return "Языковой модуль мейкфайла";
|
||
case RemoteFile:
|
||
return "Удалённый файл";
|
||
case Component:
|
||
return "Компонент";
|
||
case Project:
|
||
return "Проект";
|
||
case File:
|
||
return "Файл";
|
||
case Root:
|
||
return "Корень дерева версий";
|
||
case Version:
|
||
return "Версия";
|
||
case BugReport:
|
||
return "Отчёт об ошибке";
|
||
case Account:
|
||
return "Аккаунт";
|
||
case Machine:
|
||
return "Машина";
|
||
case User:
|
||
return "Пользователь";
|
||
case Compiler:
|
||
return "Компилятор";
|
||
default:
|
||
return "";
|
||
}
|
||
}
|
||
//------------------------------------------------------------------------------------->>
|
||
public static boolean HasProject() {
|
||
return CurrentAnchestor.get(Project) != null;
|
||
}
|
||
public static boolean HasFile() {
|
||
return CurrentAnchestor.get(File) != null;
|
||
}
|
||
public static boolean HasSelectedFile() {
|
||
return CurrentAnchestor.get(SelectedFile) != null;
|
||
}
|
||
public static boolean HasAccount() {
|
||
return CurrentAnchestor.get(Account) != null;
|
||
}
|
||
public static boolean HasMachine() {
|
||
return CurrentAnchestor.get(Machine) != null;
|
||
}
|
||
public static boolean HasUser() {
|
||
return CurrentAnchestor.get(User) != null;
|
||
}
|
||
public static boolean HasCompiler() {
|
||
return CurrentAnchestor.get(Compiler) != null;
|
||
}
|
||
public static boolean HasRemoteFile() {
|
||
return CurrentAnchestor.get(RemoteFile) != null;
|
||
}
|
||
public static boolean HasMakefile() {
|
||
return CurrentAnchestor.get(Makefile) != null;
|
||
}
|
||
public static boolean HasRunConfiguration() {
|
||
return CurrentAnchestor.get(RunConfiguration) != null;
|
||
}
|
||
public static boolean HasCompilationTask() {
|
||
return CurrentAnchestor.get(CompilationTask) != null;
|
||
}
|
||
public static boolean HasRunTask() {
|
||
return CurrentAnchestor.get(RunTask) != null;
|
||
}
|
||
public static boolean HasPassForm() {
|
||
return CurrentAnchestor.get(PassForm) != null;
|
||
}
|
||
public static boolean HasProjectView() {
|
||
return CurrentAnchestor.get(ProjectView) != null;
|
||
}
|
||
public static SapforSettings getSapforSettings() {
|
||
return (SapforSettings) CurrentAnchestor.get(SapforSettings);
|
||
}
|
||
public static boolean HasSapforSettings() {
|
||
return CurrentAnchestor.get(SapforSettings) != null;
|
||
}
|
||
public static db_project_info getProject() {
|
||
return (db_project_info) CurrentAnchestor.get(Project);
|
||
}
|
||
public static DBProjectFile getFile() {
|
||
return (DBProjectFile) CurrentAnchestor.get(File);
|
||
}
|
||
public static Repository.Component.Component getComponent() {
|
||
return (Repository.Component.Component) CurrentAnchestor.get(Component);
|
||
}
|
||
public static Repository.BugReport.BugReport getBugReport() {
|
||
return (BugReport) CurrentAnchestor.get(BugReport);
|
||
}
|
||
public static db_project_info getRoot() {
|
||
return (db_project_info) CurrentAnchestor.get(Root);
|
||
}
|
||
public static boolean HasRoot() {
|
||
return CurrentAnchestor.get(Root) != null;
|
||
}
|
||
public static db_project_info getVersion() {
|
||
return (db_project_info) CurrentAnchestor.get(Version);
|
||
}
|
||
public static Account getAccount() {
|
||
return (Account) CurrentAnchestor.get(Account);
|
||
}
|
||
public static boolean HasSubscriber() {
|
||
return CurrentAnchestor.get(Current.Subscriber) != null;
|
||
}
|
||
public static Repository.Subscribes.Subscriber getSubscriber() {
|
||
return (Subscriber) CurrentAnchestor.get(Current.Subscriber);
|
||
}
|
||
public static Machine getMachine() {
|
||
return (Machine) CurrentAnchestor.get(Current.Machine);
|
||
}
|
||
public static User getUser() {
|
||
return (User) CurrentAnchestor.get(Current.User);
|
||
}
|
||
public static Compiler getCompiler() {
|
||
return (Compiler) CurrentAnchestor.get(Current.Compiler);
|
||
}
|
||
public static CompilationTask getCompilationTask() {
|
||
return (CompilationTask) CurrentAnchestor.get(Current.CompilationTask);
|
||
}
|
||
public static RunTask getRunTask() {
|
||
return (RunTask) CurrentAnchestor.get(Current.RunTask);
|
||
}
|
||
public static RemoteFile getRemoteFile() {
|
||
return (RemoteFile) CurrentAnchestor.get(Current.RemoteFile);
|
||
}
|
||
public static Makefile getMakefile() {
|
||
return (Makefile) CurrentAnchestor.get(Current.Makefile);
|
||
}
|
||
public static Module getModule() {
|
||
return (Module) CurrentAnchestor.get(Current.Module);
|
||
}
|
||
public static RunConfiguration getRunConfiguration() {
|
||
return (RunConfiguration) CurrentAnchestor.get(Current.RunConfiguration);
|
||
}
|
||
public static Repository.Component.Sapfor.Sapfor getSapfor() {
|
||
return (Repository.Component.Sapfor.Sapfor) CurrentAnchestor.get(Current.Sapfor);
|
||
}
|
||
public static boolean HasGroup() {
|
||
return CurrentAnchestor.get(Current.Group) != null;
|
||
}
|
||
public static TestingSystem.Common.Group.Group getGroup() {
|
||
return (TestingSystem.Common.Group.Group) CurrentAnchestor.get(Current.Group);
|
||
}
|
||
public static boolean HasConfiguration() {
|
||
return CurrentAnchestor.get(Current.DVMConfiguration) != null;
|
||
}
|
||
public static DVMConfiguration getDVMConfiguration() {
|
||
return (DVMConfiguration) CurrentAnchestor.get(Current.DVMConfiguration);
|
||
}
|
||
public static SapforConfiguration getSapforConfiguration() {
|
||
return (TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration) CurrentAnchestor.get(Current.SapforConfiguration);
|
||
}
|
||
public static Test getTest() {
|
||
return (TestingSystem.Common.Test.Test) CurrentAnchestor.get(Current.Test);
|
||
}
|
||
public static boolean HasTest() {
|
||
return CurrentAnchestor.get(Current.Test) != null;
|
||
}
|
||
public static boolean HasVersion() {
|
||
return CurrentAnchestor.get(Current.Version) != null;
|
||
}
|
||
public static RemoteFile getComponentServerBackup() {
|
||
return (RemoteFile) CurrentAnchestor.get(Current.ComponentServerBackup);
|
||
}
|
||
public static boolean HasComponentServerBackup() {
|
||
return CurrentAnchestor.get(Current.ComponentServerBackup) != null;
|
||
}
|
||
public static DefaultMutableTreeNode getProjectNode() {
|
||
return (DefaultMutableTreeNode) CurrentAnchestor.get(Current.ProjectNode);
|
||
}
|
||
public static DefaultMutableTreeNode getProjectCurrentParentNode() {
|
||
DefaultMutableTreeNode node = Current.getProjectNode();
|
||
//если в дереве еще никто не выделялся, берем корень.
|
||
if (node == null)
|
||
return Current.getProject().filesTreeRoot;
|
||
return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
|
||
}
|
||
public static File getSelectedDirectory() {
|
||
return (File) CurrentAnchestor.get(Current.SelectedDirectory);
|
||
}
|
||
public static DBProjectFile getSelectedFile() {
|
||
return (DBProjectFile) CurrentAnchestor.get(Current.SelectedFile);
|
||
}
|
||
public static boolean HasBugReport() {
|
||
return CurrentAnchestor.get(Current.BugReport) != null;
|
||
}
|
||
public static PassForm getPassForm() {
|
||
return (Visual_DVM_2021.Passes.UI.PassForm) CurrentAnchestor.get(Current.PassForm);
|
||
}
|
||
public static ParallelRegion getParallelRegion() {
|
||
return (ParallelRegion) CurrentAnchestor.get(Current.ParallelRegion);
|
||
}
|
||
public static boolean HasParallelRegion() {
|
||
return CurrentAnchestor.get(Current.ParallelRegion) != null;
|
||
}
|
||
public static boolean HasFunction() {
|
||
return CurrentAnchestor.get(Current.Function) != null;
|
||
}
|
||
public static boolean HasSelectedFunction() {
|
||
return CurrentAnchestor.get(Current.SelectedFunction) != null;
|
||
}
|
||
public static FuncInfo getFunction() {
|
||
return (FuncInfo) CurrentAnchestor.get(Current.Function);
|
||
}
|
||
public static FuncInfo getSelectionFunction() {
|
||
return (FuncInfo) CurrentAnchestor.get(Current.SelectedFunction);
|
||
}
|
||
public static boolean HasScenario() {
|
||
return CurrentAnchestor.get(Current.Scenario) != null;
|
||
}
|
||
public static db_project_info getPackageVersion() {
|
||
return (db_project_info) CurrentAnchestor.get(Current.PackageVersion);
|
||
}
|
||
public static boolean HasPackageVersion() {
|
||
return CurrentAnchestor.get(Current.PackageVersion) != null;
|
||
}
|
||
public static boolean HasSapforConfiguration() {
|
||
return CurrentAnchestor.get(Current.SapforConfiguration) != null;
|
||
}
|
||
public static ProjectData.ProjectView getProjectView() {
|
||
return (ProjectData.ProjectView) CurrentAnchestor.get(ProjectView);
|
||
}
|
||
public static boolean HasSapforProfile() {
|
||
return CurrentAnchestor.get(Current.SapforProfile) != null;
|
||
}
|
||
public static GlobalData.SapforProfile.SapforProfile getSapforProfile() {
|
||
return (GlobalData.SapforProfile.SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
|
||
}
|
||
public static boolean HasServerSapfor() {
|
||
return CurrentAnchestor.get(Current.ServerSapfor) != null;
|
||
}
|
||
public static TestingSystem.SAPFOR.ServerSapfor.ServerSapfor getServerSapfor() {
|
||
return (TestingSystem.SAPFOR.ServerSapfor.ServerSapfor) CurrentAnchestor.get(Current.ServerSapfor);
|
||
}
|
||
public static boolean HasSubscriberWorkspace() {
|
||
return CurrentAnchestor.get(Current.SubscriberWorkspace) != null;
|
||
}
|
||
public static Repository.SubscriberWorkspace.SubscriberWorkspace getSubscriberWorkspace() {
|
||
return (Repository.SubscriberWorkspace.SubscriberWorkspace) CurrentAnchestor.get(Current.SubscriberWorkspace);
|
||
}
|
||
public static boolean HasDVMPackage() {
|
||
return CurrentAnchestor.get(Current.DVMPackage) != null;
|
||
}
|
||
public static TestingSystem.DVM.DVMPackage.DVMPackage getDVMPackage() {
|
||
return (TestingSystem.DVM.DVMPackage.DVMPackage) CurrentAnchestor.get(Current.DVMPackage);
|
||
}
|
||
public static boolean HasSapforPackage() {
|
||
return CurrentAnchestor.get(Current.SapforPackage) != null;
|
||
}
|
||
public static TestingSystem.SAPFOR.SapforPackage.SapforPackage getSapforPackage() {
|
||
return (TestingSystem.SAPFOR.SapforPackage.SapforPackage) CurrentAnchestor.get(Current.SapforPackage);
|
||
}
|
||
public static boolean HasDVMRunTask() {
|
||
return CurrentAnchestor.get(Current.DVMRunTask) != null;
|
||
}
|
||
public static TestingSystem.DVM.DVMTasks.DVMRunTask getDVMRunTask() {
|
||
return (TestingSystem.DVM.DVMTasks.DVMRunTask) CurrentAnchestor.get(Current.DVMRunTask);
|
||
}
|
||
}
|