Browse Source

REPORT-75998 添加帮助文档

newui
Destiny.Lin 2 years ago
parent
commit
97490a8116
  1. 3
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  2. 55
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java
  3. 2
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java

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.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);

55
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("<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"));
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;
}
}

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

Loading…
Cancel
Save