From eab979b3f1a0aa8d672c0e872463dc3824890d98 Mon Sep 17 00:00:00 2001 From: obo Date: Tue, 30 Jul 2024 14:09:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5-js?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/JSContentPane.java | 5 ++++- .../com/fr/design/javascript/JavaScriptImplPane.java | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 31c45da762..45177d1cf2 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -1,5 +1,6 @@ package com.fr.design.javascript; +import com.fr.base.i18n.BidiUtils; import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.border.UIRoundedBorder; @@ -96,6 +97,7 @@ public class JSContentPane extends BasicPane { private void addNewPaneLabel(){ UILabel advancedEditorLabel = new UILabel(Toolkit.i18nText("Fine-Design_Advanced_Editor"), IconUtils.readIcon("com/fr/design/images/edit/advancedEditor.svg"), SwingConstants.LEFT); + BidiUtils.applyOrientationByLocale(advancedEditorLabel); advancedEditorLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); advancedEditorLabel.addMouseListener(new MouseAdapter() { @@ -129,7 +131,7 @@ public class JSContentPane extends BasicPane { advancedEditorDialog.requestFocus(); } }); - labelPane.add(advancedEditorLabel,BorderLayout.EAST); + labelPane.add(advancedEditorLabel, BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST); } protected UIScrollPane createContentTextAreaPanel(){ @@ -160,6 +162,7 @@ public class JSContentPane extends BasicPane { protected JPanel createJSParaPane(){ UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Format_JavaScript"), IOUtils.readIcon("com/fr/design/images/edit/format.png"), SwingConstants.LEFT); + BidiUtils.applyOrientationByLocale(label); label.setCursor(new Cursor(Cursor.HAND_CURSOR)); label.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Format_JavaScript")); label.addMouseListener(new MouseAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index 37bca2f6eb..f405efcdfa 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -1,6 +1,7 @@ package com.fr.design.javascript; import com.fr.base.Parameter; +import com.fr.base.i18n.BidiUtils; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.frpane.ReportletParameterViewPane; @@ -9,6 +10,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.hyperlink.AbstractHyperLinkPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.javascript.jsapi.JSImplPopulateAction; import com.fr.design.javascript.jsapi.JSImplUpdateAction; import com.fr.design.mainframe.DesignerContext; @@ -20,6 +22,7 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.border.TitledBorder; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import java.awt.BorderLayout; @@ -67,7 +70,9 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { importedJsPane.setPreferredSize(new Dimension(265, 150)); jsPane = createJSContentPane(defaultArgs); - jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"))); + TitledBorder titledBorder = BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Toolkit.i18nText("Fine-Design_Report_JavaScript")); + titledBorder.setTitleJustification(BidiUtils.rtl() ? TitledBorder.RIGHT : TitledBorder.LEFT); + jsPane.setBorder(titledBorder); parameterPane.setPreferredSize(new Dimension(265, 150)); JPanel topPane = new JPanel(new GridLayout(1,2)); @@ -143,7 +148,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { }; UITableEditorPane importedJsPane = new UITableEditorPane(model); importedJsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"))); - return importedJsPane; + return BidiUtils.applyOrientationByLocale(importedJsPane); } /**