From 2be154b2ef2ebd91cfc96da6f3c1c38d627b40c2 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Thu, 9 Mar 2023 21:14:48 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-83259=20&=20REPORT-83263=20=E3=80=90?= =?UTF-8?q?=E6=9C=80=E5=BC=BA=E6=8E=A7=E4=BB=B6=E3=80=91=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98&?= =?UTF-8?q?=E5=BC=80=E6=94=BE=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/designer/ButtonDefinePane.java | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java index ed51d0469f..3059ddc37d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -18,6 +18,7 @@ import com.fr.general.GeneralContext; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.StableUtils; +import org.jetbrains.annotations.NotNull; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -91,31 +92,41 @@ public abstract class ButtonDefinePane extends AbstractDataMod rowSize = new double[]{p, p, p, p, p}; columnSize = new double[]{p, f}; rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; - n_components = new Component[][]{ - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")), iconPane}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField}, - {panel, null} - }; + n_components = getExtraAdvancedComponents(panel); } else { rowSize = new double[]{p, p, p, p, p, p, p, p}; columnSize = new double[]{p, f}; rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; - n_components = new Component[][]{ - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, - backgroundCompPane, - frFont, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")), iconPane}, - {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField} - }; + n_components = getAdvancedComponents(backgroundCompPane, frFont); } hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ",")); extraPane = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); extraPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); } + @NotNull + private Component[][] getAdvancedComponents(Component[] backgroundCompPane, Component[] frFont) { + return new Component[][]{ + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField}, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, + backgroundCompPane, + frFont, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")), iconPane}, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField} + }; + } + + @NotNull + private Component[][] getExtraAdvancedComponents(JPanel panel) { + return new Component[][]{ + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField}, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")), iconPane}, + {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField}, + {panel, null} + }; + } + protected void initPluginListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener() { @Override