|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.env.detect.ui; |
|
|
|
|
|
|
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
|
import com.fr.design.RestartHelper; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
@ -47,36 +48,54 @@ public class DetectorErrorDialog extends JDialog implements ActionListener {
|
|
|
|
|
super(parent, true); |
|
|
|
|
|
|
|
|
|
JPanel northPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
JPanel headerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
headerPane.setLayout(new BorderLayout(15, 0)); |
|
|
|
|
|
|
|
|
|
UILabel iconLabel = new UILabel(IconUtils.readIcon("/com/fr/design/standard/reminder/reminder_warning_window.svg")); |
|
|
|
|
headerPane.add(iconLabel, BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
JPanel messagePane = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
|
|
|
|
{ |
|
|
|
|
UILabel boldHeader = new UILabel(Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message")); |
|
|
|
|
Font font = FRFont.getInstance(boldHeader.getFont().getFontName(), Font.PLAIN, 16); |
|
|
|
|
boldHeader.setFont(font); |
|
|
|
|
messagePane.add(boldHeader); |
|
|
|
|
|
|
|
|
|
UILabel description = new UILabel(Toolkit.i18nText("Fine-Design_Send_Report_To_Us")); |
|
|
|
|
messagePane.add(description); |
|
|
|
|
} |
|
|
|
|
headerPane.add(messagePane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
UILabel boldHeader = new UILabel(Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message")); |
|
|
|
|
Font font = FRFont.getInstance(boldHeader.getFont().getFontName(), Font.BOLD, 20); |
|
|
|
|
boldHeader.setFont(font); |
|
|
|
|
messagePane.add(boldHeader); |
|
|
|
|
|
|
|
|
|
UILabel description = new UILabel(Toolkit.i18nText("Fine-Design_Send_Report_To_Us")); |
|
|
|
|
messagePane.add(description); |
|
|
|
|
northPane.add(messagePane); |
|
|
|
|
northPane.add(headerPane); |
|
|
|
|
|
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
centerPane.setLayout(new BorderLayout(0, 5)); |
|
|
|
|
|
|
|
|
|
UILabel detailDesc = new UILabel(Toolkit.i18nText("Fine-Design_Problem_Detail_Message")); |
|
|
|
|
centerPane.add(detailDesc, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
JPanel detailPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
detailPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 10, 10)); |
|
|
|
|
detailPanel.setLayout(new BorderLayout(0, 8)); |
|
|
|
|
|
|
|
|
|
for (DetectorResult result : results) { |
|
|
|
|
JPanel detailItemPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
|
detailItemPanel.setLayout(new BorderLayout(0, 8)); |
|
|
|
|
ExceptionTips tips = result.getTips(); |
|
|
|
|
|
|
|
|
|
UILabel template = new UILabel(); |
|
|
|
|
template.setBackground(Color.white); |
|
|
|
|
|
|
|
|
|
if (tips != null) { |
|
|
|
|
Message tipsMsg = tips.getMessage(); |
|
|
|
|
detailPanel.add(DetectorUtil.convert2TextComponent(tipsMsg), BorderLayout.NORTH); |
|
|
|
|
detailItemPanel.add(DetectorUtil.convert2TextComponent(tipsMsg, template), BorderLayout.NORTH); |
|
|
|
|
} |
|
|
|
|
ExceptionSolution solution = result.getSolution(); |
|
|
|
|
if (solution != null) { |
|
|
|
|
Message solutionMsg = solution.getMessage(); |
|
|
|
|
detailPanel.add(DetectorUtil.convert2TextComponent(solutionMsg), BorderLayout.CENTER); |
|
|
|
|
detailItemPanel.add(DetectorUtil.convert2TextComponent(solutionMsg, template), BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
detailPanel.add(detailItemPanel, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JScrollPane detailPanelWrapper = new JScrollPane(detailPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
|
|
|
@ -110,7 +129,7 @@ public class DetectorErrorDialog extends JDialog implements ActionListener {
|
|
|
|
|
this.add(northPane, BorderLayout.NORTH); |
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
this.add(southPane, BorderLayout.SOUTH); |
|
|
|
|
this.setSize(new Dimension(600, 500)); |
|
|
|
|
this.setSize(new Dimension(650, 500)); |
|
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|