Browse Source

REPORT-133410 fix: 富文本编辑器补充滚动条

fbp/release
Levy.Xie-解安森 3 months ago
parent
commit
afdf5f7b62
  1. 20
      designer-realize/src/main/java/com/fr/design/report/RichTextPane.java

20
designer-realize/src/main/java/com/fr/design/report/RichTextPane.java

@ -1,11 +1,13 @@
package com.fr.design.report; package com.fr.design.report;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.cell.editor.RichTextToolBar; import com.fr.design.cell.editor.RichTextToolBar;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -20,6 +22,7 @@ import com.fr.stable.Constants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.ScrollPaneConstants;
import javax.swing.text.AttributeSet; import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultStyledDocument; import javax.swing.text.DefaultStyledDocument;
@ -32,8 +35,6 @@ import java.awt.Font;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Iterator; import java.util.Iterator;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class RichTextPane extends BasicPane { public class RichTextPane extends BasicPane {
@ -50,13 +51,16 @@ public class RichTextPane extends BasicPane {
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(new BorderLayout()); this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
textPane = new RichTextEditingPane(); textPane = new RichTextEditingPane();
textPane.setBorder(new FlatRoundBorder());
textPane.setBackground(FineUIUtils.getUIColor("background.normal", "background")); textPane.setBackground(FineUIUtils.getUIColor("background.normal", "background"));
textPane.setFont(DEFAUL_FONT); textPane.setFont(DEFAUL_FONT);
toolBar = new RichTextToolBar(textPane); UIScrollPane scrollPane = new UIScrollPane(textPane,
this.add(column(10, cell(toolBar), cell(textPane).weight(1)).getComponent()); ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder());
toolBar = new RichTextToolBar(textPane);
this.add(toolBar, BorderLayout.NORTH);
this.add(scrollPane, BorderLayout.CENTER);
} }
@Override @Override

Loading…
Cancel
Save