2024-10-09 22:15:56 +03:00
|
|
|
|
package _VisualDVM.Visual.Windows;
|
2024-10-11 00:00:30 +03:00
|
|
|
|
import Common.Utils.Utils_;
|
|
|
|
|
|
import Common.Visual.UI_;
|
2024-10-09 22:01:19 +03:00
|
|
|
|
import _VisualDVM.Current;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.GlobalData.GlobalDatabase;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import _VisualDVM.Global;
|
2024-10-09 20:35:18 +03:00
|
|
|
|
import _VisualDVM.Visual.Editor.BaseEditor;
|
|
|
|
|
|
import _VisualDVM.Visual.Editor.Viewer;
|
2024-10-09 22:01:19 +03:00
|
|
|
|
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
2024-10-09 20:35:18 +03:00
|
|
|
|
import Common.Visual.TextField.StyledTextField;
|
2024-10-09 22:01:19 +03:00
|
|
|
|
import _VisualDVM.Visual.UI;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.GlobalData.Settings.SettingName;
|
|
|
|
|
|
import _VisualDVM.Repository.BugReport.BugReport;
|
|
|
|
|
|
import _VisualDVM.Repository.BugReport.BugReportInterface;
|
|
|
|
|
|
import _VisualDVM.Repository.BugReport.BugReportState;
|
2024-10-09 23:37:58 +03:00
|
|
|
|
import Visual_DVM_2021.Passes.PassCode;
|
2024-10-10 23:57:36 +03:00
|
|
|
|
import Common.Passes.Pass;
|
2024-10-09 22:01:19 +03:00
|
|
|
|
import _VisualDVM.Visual.Interface.CallbackWindow;
|
|
|
|
|
|
import _VisualDVM.Visual.Interface.CommentInterface;
|
|
|
|
|
|
import _VisualDVM.Visual.Interface.DescriptionInterface;
|
|
|
|
|
|
import _VisualDVM.Visual.Interface.FormWithSplitters;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
import javax.swing.event.DocumentEvent;
|
|
|
|
|
|
import javax.swing.event.DocumentListener;
|
|
|
|
|
|
public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
|
|
|
|
|
private final JScrollPane bugCommentScroll;
|
|
|
|
|
|
private final JScrollPane bugReportCommentAdditionScroll;
|
|
|
|
|
|
private final BaseEditor BugReportComment;
|
|
|
|
|
|
private final BaseEditor BugReportCommentAddition;
|
|
|
|
|
|
//-------------------------------------------
|
|
|
|
|
|
private final JScrollPane bugDescriptionScroll;
|
|
|
|
|
|
private final JScrollPane bugReportDescriptionAdditionScroll;
|
|
|
|
|
|
private final BaseEditor BugReportDescription;
|
|
|
|
|
|
private final BaseEditor BugReportDescriptionAddition;
|
|
|
|
|
|
private JPanel content;
|
|
|
|
|
|
public JSplitPane SC10;
|
|
|
|
|
|
public DescriptionInterface descriptionInterface;
|
|
|
|
|
|
public CommentInterface commentInterface;
|
|
|
|
|
|
DocumentListener descriptionAdditionListener = new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
if (!Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
|
|
|
|
|
Global.mainModule.getBugReport().descriptionAdditionDraft =
|
2023-09-17 22:13:42 +03:00
|
|
|
|
BugReportDescriptionAddition.getText();
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
DocumentListener commentAdditionListener = new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
if (!Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
|
|
|
|
|
Global.mainModule.getBugReport().commentAdditionDraft = BugReportCommentAddition.getText();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
DocumentListener descriptionListener = new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
if (Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
|
|
|
|
|
Global.mainModule.getBugReport().description =
|
2023-09-17 22:13:42 +03:00
|
|
|
|
BugReportDescription.getText();
|
|
|
|
|
|
Global.componentsServer.db.bugReports.RefreshUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
DocumentListener commentListener = new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
if (Global.mainModule.getBugReport().state.equals(BugReportState.draft))
|
|
|
|
|
|
Global.mainModule.getBugReport().comment = BugReportComment.getText();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
//-
|
|
|
|
|
|
private JToolBar accountTools;
|
|
|
|
|
|
private JLabel lAccountName;
|
|
|
|
|
|
private JLabel lAccountMail;
|
|
|
|
|
|
private JLabel lAccountRole;
|
|
|
|
|
|
private JPanel accountPanel;
|
|
|
|
|
|
private JPanel bugReportsPanel;
|
|
|
|
|
|
private JPanel filterFormPanel;
|
|
|
|
|
|
private JPanel subscribersPanel;
|
|
|
|
|
|
private JTabbedPane currentBugReportTabs;
|
|
|
|
|
|
private JScrollPane bugSettingsScroll;
|
|
|
|
|
|
private JCheckBox BugReportsMyOnlyFilter;
|
|
|
|
|
|
private JCheckBox BugReportsOpenedOnly;
|
|
|
|
|
|
private JToolBar bugsTools;
|
|
|
|
|
|
private JToolBar settingsTools;
|
|
|
|
|
|
private JToolBar descriptionTools;
|
|
|
|
|
|
private JToolBar commentTools;
|
|
|
|
|
|
private JToolBar descriptionAdditionTools;
|
|
|
|
|
|
private JToolBar commentAdditionTools;
|
|
|
|
|
|
private JPanel descriptionPanel;
|
|
|
|
|
|
private JPanel commentPanel;
|
|
|
|
|
|
private JSplitPane SCX;
|
|
|
|
|
|
public JSplitPane SC6;
|
|
|
|
|
|
private JTextField BugReportsKeyFilter;
|
|
|
|
|
|
private JTextField BugReportsSenderNameFilter;
|
|
|
|
|
|
private JTextField BugReportsDescriptionFilter;
|
|
|
|
|
|
private JTextField BugReportsVersionFilter;
|
|
|
|
|
|
private JTextField BugReportsExecutorFilter;
|
|
|
|
|
|
private JTextField BugReportsCommentFilter;
|
2023-12-05 16:15:12 +03:00
|
|
|
|
public JSplitPane SC67;
|
|
|
|
|
|
private JPanel workspacesPanel;
|
2024-03-29 01:39:14 +03:00
|
|
|
|
private JLabel adminLabel;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
private Viewer BugReportSettings;
|
|
|
|
|
|
public void LockMyOnly() {
|
|
|
|
|
|
if (!BugReportsMyOnlyFilter.isSelected()) {
|
|
|
|
|
|
BugReportsMyOnlyFilter.doClick();
|
|
|
|
|
|
}
|
|
|
|
|
|
BugReportsMyOnlyFilter.setEnabled(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void UnlockMyOnly() {
|
|
|
|
|
|
BugReportsMyOnlyFilter.setEnabled(true);
|
|
|
|
|
|
if (BugReportsMyOnlyFilter.isSelected()) {
|
|
|
|
|
|
BugReportsMyOnlyFilter.doClick();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public CallbackForm() {
|
|
|
|
|
|
LoadSplitters();
|
|
|
|
|
|
//---------------------------------
|
|
|
|
|
|
//чтобы не было индусятины, лучше создать контролы здесь
|
|
|
|
|
|
BugReportDescription = new BaseEditor();
|
|
|
|
|
|
BugReportDescription.setLineWrap(true);
|
|
|
|
|
|
bugDescriptionScroll = new JScrollPane(BugReportDescription);
|
|
|
|
|
|
//----------------------------------------------
|
|
|
|
|
|
BugReportDescriptionAddition = new BaseEditor();
|
|
|
|
|
|
BugReportDescriptionAddition.setLineWrap(true);
|
|
|
|
|
|
bugReportDescriptionAdditionScroll = new JScrollPane(BugReportDescriptionAddition);
|
|
|
|
|
|
BugReportDescription.setWrapStyleWord(true);
|
|
|
|
|
|
BugReportDescriptionAddition.setWrapStyleWord(true);
|
|
|
|
|
|
//---------------------------------------------
|
|
|
|
|
|
//-
|
|
|
|
|
|
BugReportComment = new BaseEditor();
|
|
|
|
|
|
BugReportComment.setLineWrap(true);
|
|
|
|
|
|
bugCommentScroll = new JScrollPane(BugReportComment);
|
|
|
|
|
|
//-
|
|
|
|
|
|
BugReportCommentAddition = new BaseEditor();
|
|
|
|
|
|
BugReportCommentAddition.setLineWrap(true);
|
|
|
|
|
|
bugReportCommentAdditionScroll = new JScrollPane(BugReportCommentAddition);
|
|
|
|
|
|
BugReportComment.setWrapStyleWord(true);
|
|
|
|
|
|
BugReportCommentAddition.setWrapStyleWord(true);
|
|
|
|
|
|
//----------------------------------------------
|
|
|
|
|
|
//тут развилка на то вкладки или поля.
|
2024-10-12 00:17:51 +03:00
|
|
|
|
SwitchScreen((Global.mainModule.getDb()).settings.get(SettingName.SmallScreen).toBoolean());
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//-
|
|
|
|
|
|
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
|
|
|
|
|
|
Global.componentsServer.db.subscribers.mountUI(subscribersPanel);
|
2023-12-05 16:15:12 +03:00
|
|
|
|
Global.componentsServer.db.workspaces.mountUI(workspacesPanel);
|
2024-10-09 23:37:58 +03:00
|
|
|
|
settingsTools.add(Pass.passes.get(PassCode.ApplyBugReportSettings).createButton());
|
2023-10-17 19:16:59 +03:00
|
|
|
|
//-
|
2024-10-09 23:37:58 +03:00
|
|
|
|
if (!Pass.passes.get(PassCode.CheckAccount).isDone()) {
|
|
|
|
|
|
accountTools.add(Pass.passes.get(PassCode.CheckAccount).createButton());
|
2023-10-17 22:25:10 +03:00
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//--
|
|
|
|
|
|
BugReportsKeyFilter.getDocument().addDocumentListener(new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterKey = BugReportsKeyFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterKey = BugReportsKeyFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
BugReportsSenderNameFilter.getDocument().addDocumentListener(new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterSenderName = BugReportsSenderNameFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterSenderName = BugReportsSenderNameFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
BugReportsDescriptionFilter.getDocument().addDocumentListener(new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterDescription = BugReportsDescriptionFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterDescription = BugReportsDescriptionFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
//------->>>
|
|
|
|
|
|
BugReportsCommentFilter.getDocument().addDocumentListener(new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterComment = BugReportsCommentFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterComment = BugReportsCommentFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
BugReportsExecutorFilter.getDocument().addDocumentListener(new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterExecutor = BugReportsExecutorFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterExecutor = BugReportsExecutorFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
BugReportsVersionFilter.getDocument().addDocumentListener(new DocumentListener() {
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterVersion = BugReportsVersionFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) {
|
|
|
|
|
|
BugReportInterface.filterVersion = BugReportsVersionFilter.getText();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
//--------
|
|
|
|
|
|
BugReportsMyOnlyFilter.addActionListener(e -> {
|
|
|
|
|
|
BugReportInterface.filterMyOnly = BugReportsMyOnlyFilter.isSelected();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
});
|
|
|
|
|
|
BugReportsOpenedOnly.addActionListener(e -> {
|
|
|
|
|
|
BugReportInterface.filterOpenedOnly = BugReportsOpenedOnly.isSelected();
|
|
|
|
|
|
ShowBugReports();
|
|
|
|
|
|
});
|
2024-03-29 01:39:14 +03:00
|
|
|
|
//-
|
|
|
|
|
|
accountTools.addSeparator();
|
2024-10-09 23:37:58 +03:00
|
|
|
|
accountTools.add(Pass.passes.get(PassCode.StartComponentsServer).createButton());
|
|
|
|
|
|
accountTools.add(Pass.passes.get(PassCode.ShutdownComponentsServer).createButton());
|
|
|
|
|
|
accountTools.add(Pass.passes.get(PassCode.PublishComponentsServer).createButton());
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
//-------------------------------------------
|
|
|
|
|
|
DescriptionTabs descriptionTabs = new DescriptionTabs();
|
|
|
|
|
|
DescriptionFields descriptionFields = new DescriptionFields();
|
|
|
|
|
|
CommentTabs commentTabs = new CommentTabs();
|
|
|
|
|
|
CommentFields commentFields = new CommentFields();
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void SwitchScreen(boolean small) {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
UI_.Clear(descriptionPanel);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
descriptionInterface = small ? descriptionTabs : descriptionFields;
|
|
|
|
|
|
descriptionInterface.setEditorScroll(bugDescriptionScroll);
|
|
|
|
|
|
descriptionInterface.setAdditionScroll(bugReportDescriptionAdditionScroll);
|
|
|
|
|
|
descriptionPanel.add(descriptionInterface.getContent());
|
|
|
|
|
|
//----------
|
|
|
|
|
|
descriptionPanel.revalidate();
|
|
|
|
|
|
descriptionPanel.repaint();
|
|
|
|
|
|
//---------
|
2024-10-11 00:00:30 +03:00
|
|
|
|
UI_.Clear(commentPanel);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
commentInterface = small ? commentTabs : commentFields;
|
|
|
|
|
|
commentInterface.setEditorScroll(bugCommentScroll);
|
|
|
|
|
|
commentInterface.setAdditionScroll(bugReportCommentAdditionScroll);
|
|
|
|
|
|
commentPanel.add(commentInterface.getContent());
|
|
|
|
|
|
//----------
|
|
|
|
|
|
commentPanel.revalidate();
|
|
|
|
|
|
commentPanel.repaint();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void SaveSplitters() {
|
|
|
|
|
|
FormWithSplitters.super.SaveSplitters();
|
|
|
|
|
|
descriptionInterface.SaveSplitters();
|
|
|
|
|
|
commentInterface.SaveSplitters();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getBugReportDescriptionText() {
|
|
|
|
|
|
return BugReportDescription.getText();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getBugReportDescriptionAdditionText() {
|
|
|
|
|
|
return BugReportDescriptionAddition.getText();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getBugReportCommentText() {
|
|
|
|
|
|
return BugReportComment.getText();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public String getBugReportCommentAdditionText() {
|
|
|
|
|
|
return BugReportCommentAddition.getText();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ClearBugReportDescriptionAdditionText() {
|
|
|
|
|
|
BugReportDescriptionAddition.setText("");
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ClearBugReportCommentAdditionText() {
|
|
|
|
|
|
BugReportCommentAddition.setText("");
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void FocusRecipients() {
|
|
|
|
|
|
currentBugReportTabs.setSelectedIndex(2);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void SwitchListeners(boolean on) {
|
|
|
|
|
|
if (on) {
|
|
|
|
|
|
BugReportDescriptionAddition.getDocument().addDocumentListener(descriptionAdditionListener);
|
|
|
|
|
|
BugReportCommentAddition.getDocument().addDocumentListener(commentAdditionListener);
|
|
|
|
|
|
BugReportDescription.getDocument().addDocumentListener(descriptionListener);
|
|
|
|
|
|
BugReportComment.getDocument().addDocumentListener(commentListener);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
BugReportDescriptionAddition.getDocument().removeDocumentListener(descriptionAdditionListener);
|
|
|
|
|
|
BugReportCommentAddition.getDocument().removeDocumentListener(commentAdditionListener);
|
|
|
|
|
|
BugReportDescription.getDocument().removeDocumentListener(descriptionListener);
|
|
|
|
|
|
BugReportComment.getDocument().removeDocumentListener(commentListener);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private void createUIComponents() {
|
|
|
|
|
|
BugReportSettings = new Viewer();
|
|
|
|
|
|
bugSettingsScroll = new JScrollPane(BugReportSettings);
|
|
|
|
|
|
//--
|
|
|
|
|
|
BugReportsKeyFilter = new StyledTextField();
|
|
|
|
|
|
BugReportsSenderNameFilter = new StyledTextField();
|
|
|
|
|
|
BugReportsDescriptionFilter = new StyledTextField();
|
|
|
|
|
|
BugReportsCommentFilter = new StyledTextField();
|
|
|
|
|
|
BugReportsExecutorFilter = new StyledTextField();
|
|
|
|
|
|
BugReportsVersionFilter = new StyledTextField();
|
|
|
|
|
|
settingsTools = new VisualiserMenuBar();
|
|
|
|
|
|
}
|
|
|
|
|
|
public void EnableBugreports() {
|
2024-10-11 00:00:30 +03:00
|
|
|
|
UI_.Clear(accountPanel);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
accountPanel.add(SC10);
|
2023-11-20 22:59:55 +03:00
|
|
|
|
UI.getMainWindow().SwitchTestingTabs(true);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void setUserRights() {
|
|
|
|
|
|
LockMyOnly();
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.AddSubscriber).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.EditSubscriber).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteSubscriber).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DownloadAllBugReportsArchives).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteSubscriberWorkspace).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.CompileServerSapfor).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteServerSapfor).setControlsVisible(false);
|
2024-03-24 02:49:32 +03:00
|
|
|
|
//
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.ShutdownComponentsServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.StartComponentsServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.PublishComponentsServer).setControlsVisible(false);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
//
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.ShutdownTestingServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.StartTestingServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.PublishTestingServer).setControlsVisible(false);
|
2024-03-24 02:49:32 +03:00
|
|
|
|
UI.testingBar.showServerAdminLabel(false);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
adminLabel.setVisible(false);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
private void setDeveloperRights() {
|
|
|
|
|
|
UnlockMyOnly();
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.AddSubscriber).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.EditSubscriber).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteSubscriber).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DownloadAllBugReportsArchives).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteSubscriberWorkspace).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.CompileServerSapfor).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteServerSapfor).setControlsVisible(false);
|
2024-03-24 02:49:32 +03:00
|
|
|
|
//
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.ShutdownComponentsServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.StartComponentsServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.PublishComponentsServer).setControlsVisible(false);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
//
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.ShutdownTestingServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.StartTestingServer).setControlsVisible(false);
|
|
|
|
|
|
Pass.passes.get(PassCode.PublishTestingServer).setControlsVisible(false);
|
2024-03-24 02:49:32 +03:00
|
|
|
|
UI.testingBar.showServerAdminLabel(false);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
adminLabel.setVisible(false);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void setAdminRights() {
|
|
|
|
|
|
UnlockMyOnly();
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.AddSubscriber).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.EditSubscriber).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteSubscriber).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.DownloadAllBugReportsArchives).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteSubscriberWorkspace).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.CompileServerSapfor).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.DeleteServerSapfor).setControlsVisible(true);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
//
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.ShutdownComponentsServer).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.StartComponentsServer).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.PublishComponentsServer).setControlsVisible(true);
|
2024-03-24 02:49:32 +03:00
|
|
|
|
//--
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.passes.get(PassCode.ShutdownTestingServer).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.StartTestingServer).setControlsVisible(true);
|
|
|
|
|
|
Pass.passes.get(PassCode.PublishTestingServer).setControlsVisible(true);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
//--
|
2024-03-24 02:49:32 +03:00
|
|
|
|
UI.testingBar.showServerAdminLabel(true);
|
2024-03-29 01:39:14 +03:00
|
|
|
|
adminLabel.setVisible(true);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowAccount() {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
|
|
|
|
|
|
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
|
|
|
|
|
|
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
|
|
|
|
|
|
switch (Global.mainModule.getAccount().role) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
case Undefined:
|
2024-02-16 21:44:13 +03:00
|
|
|
|
/// UI.Clear(accountPanel);
|
|
|
|
|
|
// accountPanel.add(new CallbackWelcomeForm().content);
|
|
|
|
|
|
// UI.getMainWindow().SwitchTestingTabs(false);
|
|
|
|
|
|
// break;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
case User:
|
|
|
|
|
|
//видит только свои баги.
|
2024-02-16 21:44:13 +03:00
|
|
|
|
// EnableBugreports();
|
|
|
|
|
|
// setUserRights();
|
|
|
|
|
|
// break;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
case Developer:
|
|
|
|
|
|
EnableBugreports();
|
|
|
|
|
|
setDeveloperRights();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case Admin:
|
|
|
|
|
|
EnableBugreports();
|
|
|
|
|
|
setAdminRights();
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
EnableBugreports();
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowBugReports() {
|
|
|
|
|
|
Global.componentsServer.db.bugReports.ShowUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowNoBugReports() {
|
|
|
|
|
|
Global.componentsServer.db.bugReports.ClearUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowSubscribers() {
|
|
|
|
|
|
Global.componentsServer.db.subscribers.ShowUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowNoSubscribers() {
|
|
|
|
|
|
Global.componentsServer.db.subscribers.ClearUI();
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ShowDraft() {
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(true,
|
|
|
|
|
|
PassCode.PublishBugReport,
|
|
|
|
|
|
PassCode.SaveBugReportRecipients,
|
|
|
|
|
|
PassCode.SaveBugReportExecutor,
|
|
|
|
|
|
PassCode.DeleteBugReport
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(false,
|
|
|
|
|
|
PassCode.AppendBugReportDescription,
|
|
|
|
|
|
PassCode.AppendBugReportComment,
|
|
|
|
|
|
PassCode.SaveBugReportDescription,
|
|
|
|
|
|
PassCode.SaveBugReportComment,
|
|
|
|
|
|
PassCode.OpenBugReport,
|
|
|
|
|
|
PassCode.CloseBugReport,
|
|
|
|
|
|
PassCode.OpenBugReportTestProject,
|
|
|
|
|
|
PassCode.UpdateBugReportProgress
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ShowUserExecutor() {
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(true,
|
|
|
|
|
|
PassCode.AppendBugReportComment,
|
|
|
|
|
|
PassCode.UpdateBugReportProgress,
|
|
|
|
|
|
PassCode.OpenBugReportTestProject
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(false,
|
|
|
|
|
|
PassCode.PublishBugReport,
|
|
|
|
|
|
PassCode.SaveBugReportRecipients,
|
|
|
|
|
|
PassCode.SaveBugReportExecutor,
|
|
|
|
|
|
PassCode.SaveBugReportDescription,
|
|
|
|
|
|
PassCode.SaveBugReportComment,
|
|
|
|
|
|
PassCode.AppendBugReportDescription,
|
|
|
|
|
|
PassCode.OpenBugReport,
|
|
|
|
|
|
PassCode.CloseBugReport,
|
|
|
|
|
|
PassCode.DeleteBugReport
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ShowSender() {
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(true,
|
|
|
|
|
|
PassCode.AppendBugReportComment,
|
|
|
|
|
|
PassCode.UpdateBugReportProgress,
|
|
|
|
|
|
PassCode.OpenBugReportTestProject,
|
|
|
|
|
|
PassCode.SaveBugReportRecipients,
|
|
|
|
|
|
PassCode.SaveBugReportExecutor,
|
|
|
|
|
|
PassCode.SaveBugReportDescription,
|
|
|
|
|
|
PassCode.SaveBugReportComment,
|
|
|
|
|
|
PassCode.AppendBugReportDescription,
|
|
|
|
|
|
PassCode.OpenBugReport,
|
|
|
|
|
|
PassCode.CloseBugReport,
|
|
|
|
|
|
PassCode.DeleteBugReport
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(false,
|
|
|
|
|
|
PassCode.PublishBugReport
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
private void ShowUser() {
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(false,
|
|
|
|
|
|
PassCode.PublishBugReport,
|
|
|
|
|
|
PassCode.SaveBugReportRecipients,
|
|
|
|
|
|
PassCode.SaveBugReportExecutor,
|
|
|
|
|
|
PassCode.SaveBugReportDescription,
|
|
|
|
|
|
PassCode.SaveBugReportComment,
|
|
|
|
|
|
PassCode.AppendBugReportDescription,
|
|
|
|
|
|
PassCode.OpenBugReport,
|
|
|
|
|
|
PassCode.CloseBugReport,
|
|
|
|
|
|
PassCode.DeleteBugReport,
|
|
|
|
|
|
PassCode.AppendBugReportComment,
|
|
|
|
|
|
PassCode.UpdateBugReportProgress,
|
|
|
|
|
|
PassCode.OpenBugReportTestProject
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowCurrentBugReport() {
|
|
|
|
|
|
SwitchListeners(false);
|
|
|
|
|
|
// currentBugReportTabs.setSelectedIndex(0);
|
2024-10-13 22:08:13 +03:00
|
|
|
|
BugReport target = Global.mainModule.getBugReport();
|
2023-09-17 22:13:42 +03:00
|
|
|
|
BugReportInterface.CheckSubscribers(target);
|
|
|
|
|
|
Global.componentsServer.db.subscribers.ShowUI();
|
|
|
|
|
|
//-
|
|
|
|
|
|
BugReportDescription.setText(target.description);
|
|
|
|
|
|
BugReportDescription.ShowBegin();
|
|
|
|
|
|
BugReportDescriptionAddition.setText(target.descriptionAdditionDraft);
|
|
|
|
|
|
//-
|
|
|
|
|
|
BugReportComment.setText(target.comment);
|
|
|
|
|
|
BugReportComment.ShowBegin();
|
|
|
|
|
|
BugReportCommentAddition.setText(target.commentAdditionDraft);
|
|
|
|
|
|
BugReportSettings.setText(
|
|
|
|
|
|
String.join("\n",
|
|
|
|
|
|
("Версия SAPFOR: " + target.sapfor_version),
|
|
|
|
|
|
("Версия визуализатора: " + target.visualiser_version),
|
|
|
|
|
|
target.sapfor_settings
|
|
|
|
|
|
)
|
|
|
|
|
|
);
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(true, PassCode.ApplyBugReportSettings);
|
2023-09-17 22:13:42 +03:00
|
|
|
|
//
|
|
|
|
|
|
if (target.state.equals(BugReportState.draft)) {
|
|
|
|
|
|
ShowDraft();
|
|
|
|
|
|
} else {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
switch (Global.mainModule.getAccount().role) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
case User:
|
2024-10-13 22:08:13 +03:00
|
|
|
|
if (Global.mainModule.getAccount().email.equalsIgnoreCase(target.sender_address)) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
ShowSender(); //отправитель.может делать с багом все.
|
|
|
|
|
|
} else {
|
2024-10-13 22:08:13 +03:00
|
|
|
|
if (Global.mainModule.getAccount().email.equalsIgnoreCase(target.executor_address)) {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
ShowUserExecutor(); //исполнитель. может менять прогресс и дополнять комментарий.
|
|
|
|
|
|
} else ShowUser(); //недоступно ничего. и баг ему невидим. но на всякий случай.
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case Developer:
|
|
|
|
|
|
case Admin:
|
|
|
|
|
|
//разработчик может все то же что и админ. они равны по правам владельцу любого бага.
|
|
|
|
|
|
ShowSender();
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
SwitchListeners(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowNoCurrentBugReport() {
|
|
|
|
|
|
SwitchListeners(false);
|
|
|
|
|
|
Global.componentsServer.db.subscribers.ShowUI();
|
|
|
|
|
|
//-
|
|
|
|
|
|
BugReportDescription.setText("");
|
|
|
|
|
|
BugReportComment.setText("");
|
|
|
|
|
|
BugReportDescriptionAddition.setText("");
|
|
|
|
|
|
BugReportCommentAddition.setText("");
|
|
|
|
|
|
BugReportSettings.setText("");
|
|
|
|
|
|
//-
|
2024-10-09 23:37:58 +03:00
|
|
|
|
Pass.setPassesControlsVisible(false, PassCode.SaveBugReportExecutor,
|
|
|
|
|
|
PassCode.SaveBugReportRecipients,
|
|
|
|
|
|
PassCode.AppendBugReportDescription,
|
|
|
|
|
|
PassCode.SaveBugReportDescription,
|
|
|
|
|
|
PassCode.SaveBugReportComment,
|
|
|
|
|
|
PassCode.AppendBugReportComment,
|
|
|
|
|
|
PassCode.ApplyBugReportSettings,
|
|
|
|
|
|
PassCode.PublishBugReport,
|
|
|
|
|
|
PassCode.OpenBugReport,
|
|
|
|
|
|
PassCode.CloseBugReport,
|
|
|
|
|
|
PassCode.OpenBugReportTestProject,
|
|
|
|
|
|
PassCode.UpdateBugReportProgress,
|
|
|
|
|
|
PassCode.DeleteBugReport
|
2023-09-17 22:13:42 +03:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public void ShowSubscription() {
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public JPanel getContent() {
|
|
|
|
|
|
return content;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|