From 0a8fe7a35663bf3076bfaeb1867a877b804625cf Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 14 Aug 2024 23:40:30 +0800 Subject: [PATCH] =?UTF-8?q?INO-21074=20=E5=B7=A5=E4=BD=9C=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ilable/UILabel.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java b/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java index 1e7e0ff7c3..8d68135ed6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java @@ -1,6 +1,5 @@ package com.fr.design.gui.ilable; -import com.fr.base.i18n.BidiUtils; import com.fr.design.gui.core.UITextComponent; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.StringUtils; @@ -28,23 +27,19 @@ public class UILabel extends JLabel implements UITextComponent { if (image != null && text != null) { setIconTextGap(4); } - adjustLabelTextForRTL(); } public UILabel(String text, int horizontalAlignment) { super(text, horizontalAlignment); - adjustLabelTextForRTL(); } public UILabel(String text) { super(text); - adjustLabelTextForRTL(); } public UILabel(String text, boolean enable) { super(text); this.setEnabled(enable); - adjustLabelTextForRTL(); } public UILabel(Icon image, int horizontalAlignment) { @@ -69,27 +64,6 @@ public class UILabel extends JLabel implements UITextComponent { return preferredSize; } - /** - * 调整label的名称以适配RTL - *

- * 代码中有大量的国际化文本拼接冒号或者其他硬编码字符串创建Label的行为,RTL时名称需要分段反转,把一部分放在UILabel构造方法中进行调整,目前处理的场景如下: - *

- */ - private void adjustLabelTextForRTL() { - if (!BidiUtils.rtl()) { - return; - } - String text = this.getText(); - if (StringUtils.isNotEmpty(text) && text.length() > 1 && StringUtils.equals(String.valueOf(text.charAt(text.length() - 1)), COLON)) { - text = COLON + text.substring(0, text.length() - 1); - this.setText(text); - } - } - public static void main(String[] args) { // UILabel label = new UILabel("shishi",SwingConstants.LEFT); JFrame frame = new JFrame("Test");