From 9430e29cb022ba55a1ce84267b52de0a9a9a3d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 8 Oct 2024 17:04:33 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-136473=20&=20EPORT-136480=20fix:=20?= =?UTF-8?q?=E6=87=92=E5=8A=A0=E8=BD=BD=E5=AF=BC=E8=87=B4=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E4=BA=8B=E4=BB=B6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/FormWidgetValuePane.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java index bb150383fc..31865224fc 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java @@ -5,7 +5,6 @@ import com.fr.design.editor.editor.DateEditor; import com.fr.design.editor.editor.DoubleEditor; import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.FormulaEditor; -import com.fr.design.gui.core.ReactiveCardPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.widget.editors.DataBindingEditor; @@ -19,6 +18,9 @@ import com.fr.form.ui.concept.data.ValueInitializer; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; @@ -34,20 +36,31 @@ import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP; public class FormWidgetValuePane extends JPanel { private UIButtonGroup widgetValueHead; private Editor[] editor; - private ReactiveCardPane customPane; + private JPanel customPane; + private CardLayout cardLayout; public FormWidgetValuePane(Object o, boolean onlyServer) { DataControl widget = (DataControl) o; editor = createWidgetValueEditor(widget, onlyServer); this.setLayout(new BorderLayout()); - customPane = ReactiveCardPane.create(); + cardLayout = new CardLayout(); + customPane = new JPanel(cardLayout) { + @Override + public Dimension getPreferredSize() { + for (Component comp : getComponents()) { + if (comp.isVisible()) { + return comp.getPreferredSize(); + } + } + return new Dimension(0, 0); + } + }; final String[] tabTitles = new String[editor.length]; for (int i = 0; i < editor.length; i++) { Editor currentEditor = editor[i]; - customPane.addSupplier(editor[i].getName(), () -> currentEditor); + customPane.add(currentEditor, editor[i].getName()); tabTitles[i] = editor[i].getName(); } - customPane.select(editor[0].getName()).populate(); widgetValueHead = new UIButtonGroup(tabTitles); UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value")); this.add(column(VERTICAL_GAP, @@ -69,7 +82,7 @@ public class FormWidgetValuePane extends JPanel { index = 0; widgetValueHead.setSelectedIndex(index); } - customPane.select(editor[index].getName()).populate(); + cardLayout.show(customPane, editor[index].getName()); }