2024-10-14 16:16:41 +03:00
|
|
|
package _VisualDVM.Visual;
|
|
|
|
|
import Common.Visual.UIModule_;
|
2024-10-15 02:32:52 +03:00
|
|
|
import _VisualDVM.Global;
|
|
|
|
|
import _VisualDVM.GlobalData.RemoteFile.UI.RemoteFileChooser;
|
2024-11-19 11:21:12 +03:00
|
|
|
import _VisualDVM.Passes.PassCode;
|
2024-10-14 21:55:58 +03:00
|
|
|
import _VisualDVM.TestingSystem.Common.TestingMenuBar;
|
2024-10-15 02:32:52 +03:00
|
|
|
import _VisualDVM.Visual.Interface.DebugWindow;
|
2025-02-18 23:45:24 +03:00
|
|
|
import _VisualDVM.Visual.Interface.MainWindow;
|
2024-10-15 02:32:52 +03:00
|
|
|
import _VisualDVM.Visual.Interface.VersionsWindow;
|
2024-12-02 23:11:40 +03:00
|
|
|
import _VisualDVM.Visual.Menus.MainMenuBar.MainMenuBar;
|
2024-10-14 21:55:58 +03:00
|
|
|
import _VisualDVM.Visual.Menus.VersionsMenuBar.VersionsMenuBar;
|
2024-10-14 18:41:02 +03:00
|
|
|
import _VisualDVM.Visual.Syntax.LightSPFEditorTheme;
|
2024-10-15 02:32:52 +03:00
|
|
|
import _VisualDVM.Visual.Windows.*;
|
2024-10-14 16:16:41 +03:00
|
|
|
public class MainUI extends UIModule_ {
|
2024-12-02 23:11:40 +03:00
|
|
|
public MainMenuBar mainMenuBar = null;
|
2024-10-15 02:32:52 +03:00
|
|
|
public MainWindow mainWindow = null;
|
|
|
|
|
public SearchReplaceForm searchReplaceWindow = null;
|
|
|
|
|
public ProfilesForm profilesWindow = null;
|
|
|
|
|
public VersionsWindow versionsWindow = null;
|
|
|
|
|
public DebugWindow debugWindow = null;
|
|
|
|
|
public RemoteFileChooser remoteFileChooser = null;
|
2024-10-20 17:27:58 +03:00
|
|
|
ComponentsWindow componentsWindow = null;
|
2024-10-15 02:32:52 +03:00
|
|
|
//-
|
2024-10-14 21:55:58 +03:00
|
|
|
TestingMenuBar testingMenuBar = null;
|
|
|
|
|
VersionsMenuBar versionsMenuBar = null;
|
2024-10-15 02:32:52 +03:00
|
|
|
//-
|
2024-10-15 13:35:33 +03:00
|
|
|
//-
|
|
|
|
|
public MainUI() {
|
|
|
|
|
setTheme(new LightSPFEditorTheme());
|
|
|
|
|
}
|
|
|
|
|
//-
|
2024-10-15 02:32:52 +03:00
|
|
|
public TestingMenuBar getTestingMenuBar() {
|
|
|
|
|
if (testingMenuBar == null)
|
2024-10-14 21:55:58 +03:00
|
|
|
testingMenuBar = new TestingMenuBar();
|
|
|
|
|
return testingMenuBar;
|
|
|
|
|
}
|
2024-10-15 02:32:52 +03:00
|
|
|
public VersionsMenuBar getVersionsMenuBar() {
|
|
|
|
|
if (versionsMenuBar == null)
|
2024-10-14 21:55:58 +03:00
|
|
|
versionsMenuBar = new VersionsMenuBar();
|
|
|
|
|
return versionsMenuBar;
|
|
|
|
|
}
|
2024-10-15 02:32:52 +03:00
|
|
|
public MainWindow getMainWindow() {
|
|
|
|
|
if (mainWindow == null)
|
|
|
|
|
mainWindow = new MainForm();
|
|
|
|
|
return mainWindow;
|
|
|
|
|
}
|
|
|
|
|
public boolean hasMainWindow() {
|
|
|
|
|
return mainWindow != null;
|
|
|
|
|
}
|
2024-10-20 17:27:58 +03:00
|
|
|
public ComponentsWindow getComponentsWindow() {
|
2024-10-15 02:32:52 +03:00
|
|
|
if (componentsWindow == null)
|
2024-10-20 17:27:58 +03:00
|
|
|
componentsWindow = new ComponentsWindow();
|
2024-11-19 11:21:12 +03:00
|
|
|
//-
|
|
|
|
|
Global.mainModule.getPass(PassCode.PublishComponent).setControlsVisible(
|
|
|
|
|
(Global.mainModule.getAccount() != null) ? Global.mainModule.getAccount().isAdmin() : false);
|
|
|
|
|
//--
|
2024-10-15 02:32:52 +03:00
|
|
|
return componentsWindow;
|
|
|
|
|
}
|
|
|
|
|
//--
|
|
|
|
|
//возможно перекинуть на тестирование. потом.
|
|
|
|
|
public DebugWindow getDebugWindow() {
|
|
|
|
|
if (debugWindow == null)
|
|
|
|
|
debugWindow = new DebugForm();
|
|
|
|
|
return debugWindow;
|
|
|
|
|
}
|
|
|
|
|
public void HideSearchForm() {
|
2025-01-11 17:43:27 +03:00
|
|
|
if (getSearchReplaceWindow().isVisible())
|
|
|
|
|
getSearchReplaceWindow().setVisible(false);
|
2024-10-15 02:32:52 +03:00
|
|
|
}
|
|
|
|
|
public VersionsWindow getVersionsWindow() {
|
|
|
|
|
return versionsWindow;
|
|
|
|
|
}
|
|
|
|
|
public SearchReplaceForm getSearchReplaceWindow() {
|
|
|
|
|
if (searchReplaceWindow == null)
|
|
|
|
|
searchReplaceWindow = new SearchReplaceForm();
|
|
|
|
|
return searchReplaceWindow;
|
|
|
|
|
}
|
|
|
|
|
public void ShowSearchForm(boolean replace) {
|
|
|
|
|
searchReplaceWindow.setMode(replace);
|
|
|
|
|
searchReplaceWindow.ShowMode();
|
|
|
|
|
ShowSearchForm();
|
|
|
|
|
}
|
|
|
|
|
public void ShowSearchForm() {
|
|
|
|
|
if (searchReplaceWindow.isVisible())
|
|
|
|
|
searchReplaceWindow.Refresh();
|
|
|
|
|
else
|
|
|
|
|
searchReplaceWindow.Show();
|
|
|
|
|
}
|
|
|
|
|
public RemoteFileChooser getRemoteFileChooser() {
|
|
|
|
|
if (remoteFileChooser == null)
|
|
|
|
|
remoteFileChooser = new RemoteFileChooser();
|
|
|
|
|
return remoteFileChooser;
|
|
|
|
|
}
|
|
|
|
|
public void CreateVersionsWindow() {
|
|
|
|
|
versionsWindow = new VersionsForm(Global.mainModule.getRoot());
|
|
|
|
|
}
|
|
|
|
|
public ProfilesForm getProfilesWindow() {
|
|
|
|
|
if (profilesWindow == null)
|
|
|
|
|
profilesWindow = new ProfilesForm();
|
|
|
|
|
return profilesWindow;
|
|
|
|
|
}
|
2025-02-28 16:18:37 +03:00
|
|
|
//---
|
2025-02-28 17:46:57 +03:00
|
|
|
void showUndefinedRights(){
|
|
|
|
|
Global.mainModule.SetUserPassesAccess();
|
2025-02-28 21:48:51 +03:00
|
|
|
getMainWindow().ShowUndefinedTabs();
|
2025-02-28 17:46:57 +03:00
|
|
|
getTestingMenuBar().showServerAdminLabel(false);
|
|
|
|
|
getMainWindow().getCallbackWindow().showNoBugReports();
|
2025-02-28 19:12:32 +03:00
|
|
|
Global.normalProperties.setControlVisible("AutoBugReportsLoad", false);
|
|
|
|
|
Global.normalProperties.setControlVisible("AutoTestsLoad", false);
|
2025-03-06 17:59:03 +03:00
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToCompilationOptions", false);
|
|
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToRunEnvironments", false);
|
2025-03-03 16:21:32 +03:00
|
|
|
Global.normalProperties.AutoCheckTesting = false;
|
|
|
|
|
Global.normalProperties.Update();
|
2025-02-28 17:46:57 +03:00
|
|
|
};
|
|
|
|
|
void showUserRights(){
|
|
|
|
|
Global.mainModule.SetUserPassesAccess();
|
2025-02-28 21:48:51 +03:00
|
|
|
getMainWindow().ShowUserTabs();
|
2025-02-28 17:46:57 +03:00
|
|
|
getTestingMenuBar().showServerAdminLabel(false);
|
|
|
|
|
getMainWindow().getCallbackWindow().showMyOnlyBugReports();
|
2025-02-28 19:12:32 +03:00
|
|
|
Global.normalProperties.setControlVisible("AutoBugReportsLoad", true);
|
|
|
|
|
Global.normalProperties.setControlVisible("AutoTestsLoad", false);
|
2025-03-06 17:59:03 +03:00
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToCompilationOptions", false);
|
|
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToRunEnvironments", false);
|
2025-03-03 16:21:32 +03:00
|
|
|
Global.normalProperties.AutoCheckTesting = false;
|
|
|
|
|
Global.normalProperties.Update();
|
2025-02-28 17:46:57 +03:00
|
|
|
};
|
|
|
|
|
void showDeveloperRights(){
|
|
|
|
|
Global.mainModule.SetDeveloperPassesAccess();
|
2025-02-28 21:48:51 +03:00
|
|
|
getMainWindow().ShowDeveloperTabs();
|
2025-02-28 17:46:57 +03:00
|
|
|
getTestingMenuBar().showServerAdminLabel(false);
|
|
|
|
|
getMainWindow().getCallbackWindow().showAllBugreports();
|
2025-02-28 19:12:32 +03:00
|
|
|
Global.normalProperties.setControlVisible("AutoBugReportsLoad", true);
|
|
|
|
|
Global.normalProperties.setControlVisible("AutoTestsLoad", true);
|
2025-03-06 17:59:03 +03:00
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToCompilationOptions", true);
|
|
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToRunEnvironments", true);
|
2025-02-28 17:46:57 +03:00
|
|
|
}
|
|
|
|
|
void showAdminRights(){
|
|
|
|
|
Global.mainModule.SetAdminPassesAccess();
|
2025-02-28 21:48:51 +03:00
|
|
|
getMainWindow().ShowAdminTabs();
|
2025-02-28 17:46:57 +03:00
|
|
|
getTestingMenuBar().showServerAdminLabel(true);
|
|
|
|
|
getMainWindow().getCallbackWindow().showAllBugReportsAdmin(); //метод избыточный. возможно.
|
2025-02-28 19:12:32 +03:00
|
|
|
Global.normalProperties.setControlVisible("AutoBugReportsLoad", true);
|
|
|
|
|
Global.normalProperties.setControlVisible("AutoTestsLoad", true);
|
2025-03-06 17:59:03 +03:00
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToCompilationOptions", true);
|
|
|
|
|
Global.normalProperties.setControlVisible("AddDefaultsToRunEnvironments", true);
|
2025-02-28 17:46:57 +03:00
|
|
|
};
|
|
|
|
|
public void ShowAccount(){
|
|
|
|
|
getMainWindow().getCallbackWindow().ShowAccountInfo();
|
|
|
|
|
switch (Global.mainModule.getAccount().role) {
|
|
|
|
|
case Undefined:
|
|
|
|
|
showUndefinedRights();
|
|
|
|
|
break;
|
|
|
|
|
case User:
|
|
|
|
|
showUserRights();
|
|
|
|
|
break;
|
|
|
|
|
case Developer:
|
|
|
|
|
showDeveloperRights();
|
|
|
|
|
break;
|
|
|
|
|
case Admin:
|
|
|
|
|
showAdminRights();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-10-14 16:16:41 +03:00
|
|
|
}
|