2024-10-12 00:17:51 +03:00
|
|
|
package _VisualDVM;
|
2024-10-14 12:24:59 +03:00
|
|
|
import Common.MainModule_;
|
2024-10-14 15:19:13 +03:00
|
|
|
import Common.Utils.Vector_;
|
2024-10-13 22:08:13 +03:00
|
|
|
import _VisualDVM.GlobalData.Account.Account;
|
2024-10-12 00:17:51 +03:00
|
|
|
import _VisualDVM.GlobalData.GlobalDatabase;
|
2024-10-13 22:08:13 +03:00
|
|
|
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
2024-10-14 15:19:13 +03:00
|
|
|
import _VisualDVM.Passes.PassCode;
|
2024-10-13 22:08:13 +03:00
|
|
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
|
|
|
|
import _VisualDVM.ProjectData.Project.db_project_info;
|
|
|
|
|
import _VisualDVM.ProjectData.ProjectView;
|
|
|
|
|
import _VisualDVM.ProjectData.SapforData.Functions.FuncInfo;
|
|
|
|
|
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
2024-10-14 16:16:41 +03:00
|
|
|
import _VisualDVM.Visual.MainUI;
|
2024-10-13 22:08:13 +03:00
|
|
|
|
|
|
|
|
import javax.swing.tree.DefaultMutableTreeNode;
|
|
|
|
|
import java.io.File;
|
2024-10-13 23:55:03 +03:00
|
|
|
import java.util.Vector;
|
2024-10-14 16:16:41 +03:00
|
|
|
public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
|
2024-10-14 15:19:13 +03:00
|
|
|
//--
|
|
|
|
|
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,
|
2025-02-06 18:31:18 +03:00
|
|
|
PassCode.PublishTestingServer,
|
2025-02-12 23:02:46 +03:00
|
|
|
PassCode.CreateTestsGroupFromSelectedVersions,
|
|
|
|
|
PassCode.RefreshDVMPackageResults
|
2024-10-14 15:19:13 +03:00
|
|
|
);
|
2024-10-14 16:16:41 +03:00
|
|
|
public MainModule() throws Exception {
|
|
|
|
|
super(GlobalDatabase.class, MainUI.class);
|
2024-10-12 00:17:51 +03:00
|
|
|
}
|
2024-10-14 01:16:31 +03:00
|
|
|
@Override
|
|
|
|
|
public Class getPassCodesEnum() {
|
|
|
|
|
return PassCode.class;
|
|
|
|
|
}
|
2024-10-14 12:14:01 +03:00
|
|
|
@Override
|
|
|
|
|
public String getAllPassesClassPrefix() {
|
|
|
|
|
return "_VisualDVM.Passes.All.";
|
|
|
|
|
}
|
2024-10-13 22:08:13 +03:00
|
|
|
//--
|
2024-10-25 02:08:23 +03:00
|
|
|
public boolean HasAccount() {
|
|
|
|
|
return get(Current.Account) != null;
|
|
|
|
|
} //Бессмысленно. аккаунт всегда подразумевается. вывести.
|
|
|
|
|
public Account getAccount() {
|
|
|
|
|
return (Account) get(Current.Account);
|
|
|
|
|
} //временно
|
2024-10-13 23:55:03 +03:00
|
|
|
public boolean HasProject() {
|
|
|
|
|
return get(Current.Project) != null;
|
|
|
|
|
}
|
2024-10-13 22:08:13 +03:00
|
|
|
public db_project_info getProject() {
|
|
|
|
|
return (db_project_info) get(Current.Project);
|
|
|
|
|
}
|
|
|
|
|
//--
|
|
|
|
|
public boolean HasFile() {
|
|
|
|
|
return get(Current.File) != null;
|
|
|
|
|
}
|
|
|
|
|
public boolean HasRemoteFile() {
|
|
|
|
|
return get(Current.RemoteFile) != null;
|
|
|
|
|
}
|
|
|
|
|
public boolean HasProjectView() {
|
|
|
|
|
return get(Current.ProjectView) != null;
|
|
|
|
|
}
|
|
|
|
|
public DBProjectFile getFile() {
|
|
|
|
|
return (DBProjectFile) get(Current.File);
|
|
|
|
|
}
|
|
|
|
|
public db_project_info getRoot() {
|
|
|
|
|
return (db_project_info) get(Current.Root);
|
|
|
|
|
}
|
|
|
|
|
public boolean HasRoot() {
|
|
|
|
|
return get(Current.Root) != null;
|
|
|
|
|
}
|
|
|
|
|
public db_project_info getVersion() {
|
|
|
|
|
return (db_project_info) get(Current.Version);
|
|
|
|
|
}
|
|
|
|
|
public RemoteFile getRemoteFile() {
|
|
|
|
|
return (RemoteFile) get(Current.RemoteFile);
|
|
|
|
|
}
|
|
|
|
|
public Sapfor getSapfor() {
|
|
|
|
|
return (Sapfor) get(Current.Sapfor);
|
|
|
|
|
}
|
|
|
|
|
public boolean HasVersion() {
|
|
|
|
|
return get(Current.Version) != null;
|
|
|
|
|
}
|
|
|
|
|
public RemoteFile getComponentServerBackup() {
|
|
|
|
|
return (RemoteFile) get(Current.ComponentServerBackup);
|
|
|
|
|
}
|
|
|
|
|
public boolean HasComponentServerBackup() {
|
|
|
|
|
return get(Current.ComponentServerBackup) != null;
|
|
|
|
|
}
|
|
|
|
|
public DefaultMutableTreeNode getProjectNode() {
|
|
|
|
|
return (DefaultMutableTreeNode) get(Current.ProjectNode);
|
|
|
|
|
}
|
|
|
|
|
public DefaultMutableTreeNode getProjectCurrentParentNode() {
|
|
|
|
|
DefaultMutableTreeNode node = getProjectNode();
|
|
|
|
|
//если в дереве еще никто не выделялся, берем корень.
|
|
|
|
|
if (node == null)
|
|
|
|
|
return getProject().filesTreeRoot;
|
|
|
|
|
return (node.getUserObject() instanceof DBProjectFile) ? (DefaultMutableTreeNode) node.getParent() : node;
|
|
|
|
|
}
|
|
|
|
|
public File getSelectedDirectory() {
|
|
|
|
|
return (File) get(Current.SelectedDirectory);
|
|
|
|
|
}
|
|
|
|
|
public DBProjectFile getSelectedFile() {
|
|
|
|
|
return (DBProjectFile) get(Current.SelectedFile);
|
|
|
|
|
}
|
|
|
|
|
public boolean HasFunction() {
|
|
|
|
|
return get(Current.Function) != null;
|
|
|
|
|
}
|
|
|
|
|
public boolean HasSelectedFunction() {
|
|
|
|
|
return get(Current.SelectedFunction) != null;
|
|
|
|
|
}
|
|
|
|
|
public FuncInfo getFunction() {
|
|
|
|
|
return (FuncInfo) get(Current.Function);
|
|
|
|
|
}
|
|
|
|
|
public FuncInfo getSelectionFunction() {
|
|
|
|
|
return (FuncInfo) get(Current.SelectedFunction);
|
|
|
|
|
}
|
|
|
|
|
public ProjectView getProjectView() {
|
|
|
|
|
return (ProjectView) get(Current.ProjectView);
|
|
|
|
|
}
|
2024-10-13 23:55:03 +03:00
|
|
|
public void DropCurrentFile() {
|
2024-10-13 22:08:13 +03:00
|
|
|
set(Current.File, null);
|
|
|
|
|
set(Current.FileGraphElement, null);
|
|
|
|
|
}
|
2024-10-13 23:55:03 +03:00
|
|
|
public void DropCurrentProject() {
|
2024-10-13 22:08:13 +03:00
|
|
|
set(Current.Project, null);
|
|
|
|
|
set(Current.File, null);
|
|
|
|
|
set(Current.Function, null);
|
2024-10-13 23:55:03 +03:00
|
|
|
set(Current.SelectedFunction, null);
|
2024-10-13 22:08:13 +03:00
|
|
|
set(Current.ProjectNode, null);
|
|
|
|
|
set(Current.SelectedFile, null);
|
|
|
|
|
set(Current.SelectedDirectory, null);
|
|
|
|
|
}
|
2024-10-14 01:16:31 +03:00
|
|
|
public void SetUserPassesAccess() {
|
2024-10-14 15:19:13 +03:00
|
|
|
for (PassCode code : accountRoleDependentPasses)
|
2024-10-13 23:55:03 +03:00
|
|
|
getPass(code).setControlsVisible(false);
|
|
|
|
|
}
|
2024-10-14 01:16:31 +03:00
|
|
|
public void SetDeveloperPassesAccess() {
|
|
|
|
|
SetUserPassesAccess();
|
2025-02-06 18:31:18 +03:00
|
|
|
getPass(PassCode.CreateTestsGroupFromSelectedVersions).setControlsVisible(true);
|
2024-10-13 23:55:03 +03:00
|
|
|
getPass(PassCode.DownloadAllBugReportsArchives).setControlsVisible(true);
|
|
|
|
|
}
|
2024-10-14 15:19:13 +03:00
|
|
|
public void SetAdminPassesAccess() {
|
|
|
|
|
for (PassCode code : accountRoleDependentPasses)
|
2024-10-13 23:55:03 +03:00
|
|
|
getPass(code).setControlsVisible(true);
|
|
|
|
|
}
|
2024-10-15 15:38:35 +03:00
|
|
|
//--
|
|
|
|
|
@Override
|
|
|
|
|
public int getFirstAccessPassesCount() {
|
2025-01-18 01:36:02 +03:00
|
|
|
return Global.normalProperties.FastAccessPassesCount;
|
2024-10-15 15:38:35 +03:00
|
|
|
}
|
2024-10-15 15:55:57 +03:00
|
|
|
@Override
|
|
|
|
|
public boolean confirmPassesStart() {
|
2025-01-18 01:36:02 +03:00
|
|
|
return Global.normalProperties.ConfirmPassesStart;
|
2024-10-15 15:55:57 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean confirmPassesDone() {
|
2025-01-18 01:36:02 +03:00
|
|
|
return Global.normalProperties.ShowPassesDone;
|
2024-10-15 15:55:57 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean focusPassesResult() {
|
2025-01-18 01:36:02 +03:00
|
|
|
return Global.normalProperties.FocusPassesResult;
|
2024-10-15 15:55:57 +03:00
|
|
|
}
|
2024-10-12 00:17:51 +03:00
|
|
|
}
|