Browse Source

Pull request #10264: REPORT-75998 添加帮助文档、优化表格逻辑

Merge in DESIGN/design from ~DESTINY.LIN/design:release/11.0 to release/11.0

* commit '1fdd0cac880d7c7b73831fd46660c5f7cc1c1769':
  REPORT-75998 更改跳转逻辑,更改帮助文档Icon
  REPORT-75998 更新错误信息
  REPORT-75998 添加帮助文档Icon
  REPORT-75998 添加帮助文档
newui
Destiny.Lin-林锦龙 2 years ago
parent
commit
40372eec42
  1. 3
      designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg
  2. 3
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  3. 47
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java
  4. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java

3
designer-base/src/main/resources/com/fr/design/images/buttonicon/replace_help.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15ZM8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM6.193 4.696C6.655 4.223 7.293 3.992 8.107 3.992C8.811 3.992 9.383 4.179 9.823 4.575C10.263 4.96 10.483 5.488 10.483 6.148C10.483 6.687 10.34 7.138 10.065 7.49C9.966 7.611 9.658 7.897 9.141 8.348C8.932 8.524 8.778 8.722 8.679 8.92C8.558 9.14 8.503 9.382 8.503 9.646V9.733C8.503 9.78823 8.45823 9.833 8.403 9.833H7.426C7.37077 9.833 7.326 9.78823 7.326 9.733V9.646C7.326 9.239 7.392 8.887 7.546 8.601C7.689 8.293 8.107 7.842 8.789 7.237L8.976 7.028C9.174 6.775 9.284 6.511 9.284 6.225C9.284 5.84 9.174 5.543 8.965 5.323C8.745 5.103 8.426 4.993 8.03 4.993C7.535 4.993 7.172 5.147 6.952 5.466C6.76786 5.71152 6.66935 6.05217 6.65646 6.48796C6.65482 6.54316 6.61023 6.588 6.555 6.588H5.6C5.54477 6.588 5.49986 6.54311 5.50122 6.4879C5.51978 5.7327 5.75038 5.13862 6.193 4.696ZM7.337 10.647C7.491 10.493 7.689 10.427 7.909 10.427C8.14 10.427 8.338 10.493 8.492 10.647C8.646 10.79 8.723 10.977 8.723 11.208C8.723 11.439 8.635 11.626 8.481 11.78C8.327 11.923 8.129 12 7.909 12C7.689 12 7.491 11.923 7.337 11.769C7.183 11.615 7.106 11.428 7.106 11.208C7.106 10.977 7.183 10.79 7.337 10.647Z" fill="#419BF9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
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.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Point; import java.awt.Point;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -153,7 +152,7 @@ public class ITReplaceMainDialog extends UIDialog {
}); });
center.add(northPane.getScrollPane(), BorderLayout.NORTH); center.add(northPane.getScrollPane(), BorderLayout.NORTH);
center.add(southPanel.getTableEditorPane(), BorderLayout.CENTER); center.add(southPanel.getTableEditorPane(), BorderLayout.CENTER);
add(westPanel.getLeftJpanel(), BorderLayout.WEST); add(westPanel.getLeftPanel(), BorderLayout.WEST);
//主体部分 //主体部分
add(center, BorderLayout.CENTER); add(center, BorderLayout.CENTER);
center.setVisible(true); center.setVisible(true);

47
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java

@ -1,14 +1,21 @@
package com.fr.design.actions.replace.ui; 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.ibutton.UIToggleButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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 com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Color; import java.awt.Color;
import java.awt.Cursor;
import java.awt.GridLayout; 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 * created by Destiny.Lin on 2022-09-05
*/ */
public class ITReplaceWestPanel { 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");
private static final int FILL_COUNT = 13;
public ITReplaceWestPanel() { public ITReplaceWestPanel() {
leftJpanel = new JPanel(new GridLayout(15, 1, 0, 0)); leftPanel = new JPanel(new GridLayout(15, 1, 0, 0));
iconLabel = new UILabel("<html><u><font color = 'rgb(61,153,249)'>" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + "</font></u></html>");
UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content"));
contentButton.setSelected(true); contentButton.setSelected(true);
contentButton.setBorderPainted(false); contentButton.setBorderPainted(false);
leftJpanel.add(contentButton); leftPanel.add(contentButton);
leftJpanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221))); leftPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, new Color(218, 218, 221)));
//填充一下面板 //填充一下面板
int labelNum = 14; for (int i = 0; i < FILL_COUNT; i++) {
for (int i = 0; i < labelNum; i++) { leftPanel.add(new UILabel(StringUtils.EMPTY));
leftJpanel.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() { public JPanel getLeftPanel() {
return leftJpanel; return leftPanel;
} }
public void setLeftJpanel(JPanel leftJpanel) { public void setLeftPanel(JPanel leftPanel) {
this.leftJpanel = leftJpanel; this.leftPanel = leftPanel;
} }
} }

2
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<? extends Info> list) { public void add(List<? extends Info> list) {
for (Info info : list) { for (Info info : list) {
addRow(info.getContent()); addRow(info.getContent());
fireTableDataChanged();
} }
fireTableDataChanged();
} }
public enum ChooseIndex { public enum ChooseIndex {

Loading…
Cancel
Save