перенос проходов в центральный модуль

This commit is contained in:
2024-10-13 23:55:03 +03:00
parent 6afa2dc892
commit 4e86871571
150 changed files with 510 additions and 576 deletions

View File

@@ -1,6 +1,9 @@
package _VisualDVM;
import Common.Current_;
import Common.Passes.Pass;
import Common.Passes.PassCode_;
import Common.Utils.Vector_;
import MainModule_.MainModule_;
import Visual_DVM_2021.Passes.PassCode;
import Visual_DVM_2021.Passes.UI.PassForm;
import _VisualDVM.GlobalData.Account.Account;
import _VisualDVM.GlobalData.Compiler.Compiler;
@@ -37,12 +40,34 @@ import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
import javax.swing.tree.DefaultMutableTreeNode;
import java.io.File;
import java.util.Vector;
public class MainModule extends MainModule_<GlobalDatabase> {
Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
PassCode.AddSubscriber,
PassCode.EditSubscriber,
PassCode.DeleteSubscriber,
PassCode.DeleteSubscriberWorkspace,
//--
PassCode.DownloadAllBugReportsArchives,
//--
PassCode.CompileServerSapfor,
PassCode.DeleteServerSapfor,
//
PassCode.ShutdownComponentsServer,
PassCode.StartComponentsServer,
PassCode.PublishComponentsServer,
//
PassCode.ShutdownTestingServer,
PassCode.StartTestingServer,
PassCode.PublishTestingServer
);
public MainModule() {
super(GlobalDatabase.class);
}
//--
public boolean HasProject() {return get(Current.Project) != null;}
public boolean HasProject() {
return get(Current.Project) != null;
}
public db_project_info getProject() {
return (db_project_info) get(Current.Project);
}
@@ -50,7 +75,9 @@ public class MainModule extends MainModule_<GlobalDatabase> {
public boolean HasFile() {
return get(Current.File) != null;
}
public boolean HasAccount() { return get(Current.Account) != null; }
public boolean HasAccount() {
return get(Current.Account) != null;
}
public boolean HasMachine() {
return get(Current.Machine) != null;
}
@@ -63,7 +90,7 @@ public class MainModule extends MainModule_<GlobalDatabase> {
public boolean HasRemoteFile() {
return get(Current.RemoteFile) != null;
}
public boolean HasMakefile() {
public boolean HasMakefile() {
return get(Current.Makefile) != null;
}
public boolean HasRunConfiguration() {
@@ -81,7 +108,7 @@ public class MainModule extends MainModule_<GlobalDatabase> {
public boolean HasProjectView() {
return get(Current.ProjectView) != null;
}
public Credentials getCredentials(){
public Credentials getCredentials() {
return (Credentials) get(Current.Credentials);
}
public SapforSettings getSapforSettings() {
@@ -268,18 +295,18 @@ public class MainModule extends MainModule_<GlobalDatabase> {
public DVMRunTask getDVMRunTask() {
return (DVMRunTask) get(Current.DVMRunTask);
}
public void DropCurrentFile(){
public void DropCurrentFile() {
set(Current.File, null);
set(Current.FileGraphElement, null);
set(Current.Notes, null);
set(Current.Warnings, null);
set(Current.Errors, null);
}
public void DropCurrentProject(){
public void DropCurrentProject() {
set(Current.Project, null);
set(Current.File, null);
set(Current.Function, null);
set(Current.SelectedFunction,null);
set(Current.SelectedFunction, null);
set(Current.ProjectNode, null);
set(Current.SelectedFile, null);
set(Current.SelectedDirectory, null);
@@ -288,4 +315,20 @@ public class MainModule extends MainModule_<GlobalDatabase> {
set(Current.Array, null);
set(Current.DBArray, null);
}
@Override
public Class getPassCodesEnum() {
return PassCode.class;
}
public void SetUserAccess() {
for (PassCode code: accountRoleDependentPasses)
getPass(code).setControlsVisible(false);
}
public void SetDeveloperAccess() {
SetUserAccess();
getPass(PassCode.DownloadAllBugReportsArchives).setControlsVisible(true);
}
public void SetAdminAccess(){
for (PassCode code: accountRoleDependentPasses)
getPass(code).setControlsVisible(true);
}
}