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..fdbd5eca5e --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg @@ -0,0 +1,3 @@ + + + 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..a58091a06a 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,21 @@ 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.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; 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.GridLayout; +import java.awt.event.MouseEvent; /** * 左侧面板 @@ -18,28 +25,46 @@ 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 String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); + 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.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + BrowseUtils.browser(HELP_URL); + } + }); + 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 {