From 97490a81162ed5bc1859032c5f238c578fdf3eae Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 15:22:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-75998=20=E6=B7=BB=E5=8A=A0=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../replace/ui/ITReplaceMainDialog.java | 3 +- .../replace/ui/ITReplaceWestPanel.java | 55 +++++++++++++++---- .../actions/replace/ui/ITTableEditor.java | 2 +- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 54e6a3bff4..9a2f5c8de7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -23,7 +23,6 @@ import com.fr.stable.StringUtils; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; @@ -153,7 +152,7 @@ public class ITReplaceMainDialog extends UIDialog { }); center.add(northPane.getScrollPane(), BorderLayout.NORTH); center.add(southPanel.getTableEditorPane(), BorderLayout.CENTER); - add(westPanel.getLeftJpanel(), BorderLayout.WEST); + add(westPanel.getLeftPanel(), BorderLayout.WEST); //主体部分 add(center, BorderLayout.CENTER); center.setVisible(true); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 9295baf655..c88e3a19df 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -1,14 +1,22 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; +import javax.swing.Icon; import javax.swing.JPanel; import java.awt.Color; +import java.awt.Cursor; +import java.awt.Desktop; +import java.awt.Font; import java.awt.GridLayout; +import java.awt.event.MouseEvent; +import java.net.URI; /** * 左侧面板 @@ -18,28 +26,53 @@ import java.awt.GridLayout; * created by Destiny.Lin on 2022-09-05 */ public class ITReplaceWestPanel { - JPanel leftJpanel; + private JPanel leftPanel; + private UILabel iconLabel; + private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); + private static final int FILL_COUNT = 13; public ITReplaceWestPanel() { - leftJpanel = new JPanel(new GridLayout(15, 1, 0, 0)); + leftPanel = new JPanel(new GridLayout(15, 1, 0, 0)); + iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); + UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); contentButton.setSelected(true); contentButton.setBorderPainted(false); - leftJpanel.add(contentButton); - leftJpanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); + leftPanel.add(contentButton); + leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); //填充一下面板 - int labelNum = 14; - for (int i = 0; i < labelNum; i++) { - leftJpanel.add(new UILabel(StringUtils.EMPTY)); + for (int i = 0; i < FILL_COUNT; i++) { + leftPanel.add(new UILabel(StringUtils.EMPTY)); } + + //添加帮助文档按钮及超链 + iconLabel.setIcon(HELP_ICON); + iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); + //设置游标 + iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); + iconLabel.setFont(new Font("Dialog", Font.BOLD, 12)); + iconLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + Desktop desktop = Desktop.getDesktop(); + try { + //创建URI统一资源标识符 + URI uri = new URI("https://help.fanruan.com/finereport/doc-view-4954.html"); + desktop.browse(uri); + } catch (Exception exception) { + exception.printStackTrace(); + } + } + }); + leftPanel.add(iconLabel); } - public JPanel getLeftJpanel() { - return leftJpanel; + public JPanel getLeftPanel() { + return leftPanel; } - public void setLeftJpanel(JPanel leftJpanel) { - this.leftJpanel = leftJpanel; + public void setLeftPanel(JPanel leftPanel) { + this.leftPanel = leftPanel; } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java index 5c57e6d6a1..0c8819abff 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java @@ -102,8 +102,8 @@ public class ITTableEditor extends UITableModelAdapter { public void add(List list) { for (Info info : list) { addRow(info.getContent()); - fireTableDataChanged(); } + fireTableDataChanged(); } public enum ChooseIndex { From 8ee083f996c29c2c40947a765f4d0e2d3a3770d6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 15:26:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-75998=20=E6=B7=BB=E5=8A=A0=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E6=96=87=E6=A1=A3Icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/design/images/buttonicon/replace_help.svg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg new file mode 100644 index 0000000000..cfc3370a66 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg @@ -0,0 +1,3 @@ + + + From c218e9c130be7a8e682ab915d46635a3aca5239b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 15:31:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=96=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index c88e3a19df..5b48827511 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -5,6 +5,7 @@ import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -61,7 +62,7 @@ public class ITReplaceWestPanel { URI uri = new URI("https://help.fanruan.com/finereport/doc-view-4954.html"); desktop.browse(uri); } catch (Exception exception) { - exception.printStackTrace(); + FineLoggerFactory.getLogger().error(exception.getMessage(), exception); } } }); From 1fdd0cac880d7c7b73831fd46660c5f7cc1c1769 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 10 Oct 2022 16:09:38 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-75998=20=E6=9B=B4=E6=94=B9=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=80=BB=E8=BE=91,=E6=9B=B4=E6=94=B9=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E6=96=87=E6=A1=A3Icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/buttonicon/replace_help.svg | 2 +- .../actions/replace/ui/ITReplaceWestPanel.java | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg index cfc3370a66..fdbd5eca5e 100644 --- a/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg @@ -1,3 +1,3 @@ - + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 5b48827511..3363b7db75 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -5,7 +5,8 @@ import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; -import com.fr.log.FineLoggerFactory; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -13,11 +14,8 @@ import javax.swing.Icon; import javax.swing.JPanel; import java.awt.Color; import java.awt.Cursor; -import java.awt.Desktop; -import java.awt.Font; import java.awt.GridLayout; import java.awt.event.MouseEvent; -import java.net.URI; /** * 左侧面板 @@ -30,6 +28,7 @@ public class ITReplaceWestPanel { private JPanel leftPanel; private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); + private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html"); private static final int FILL_COUNT = 13; public ITReplaceWestPanel() { @@ -52,18 +51,10 @@ public class ITReplaceWestPanel { iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); //设置游标 iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); - iconLabel.setFont(new Font("Dialog", Font.BOLD, 12)); iconLabel.addMouseListener(new MouseClickListener() { @Override public void mouseClicked(MouseEvent e) { - Desktop desktop = Desktop.getDesktop(); - try { - //创建URI统一资源标识符 - URI uri = new URI("https://help.fanruan.com/finereport/doc-view-4954.html"); - desktop.browse(uri); - } catch (Exception exception) { - FineLoggerFactory.getLogger().error(exception.getMessage(), exception); - } + BrowseUtils.browser(HELP_URL); } }); leftPanel.add(iconLabel);