diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java index 7f19bd3683..f367365f75 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java @@ -2,15 +2,28 @@ package com.fr.design.mainframe.mobile.ui.topparam; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.mobile.impl.MobileTopParamStyle; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.FlowLayout; public class MobileTopParamPane extends BasicBeanPane { private UICheckBox autoCommitCheckBox; + private UISpinner maxDirectShowCountSpinner; + private UILabel showCountTextField; + private static final int MAX_VALUE = 4; + private static final int MIN_VALUE = 0; + private static final int DEFAULT_DIERTA = 1; + private static final int DEFAULT_VALUE = 0; + private static final int GAP = 2; public MobileTopParamPane() { this.init(); @@ -21,19 +34,29 @@ public class MobileTopParamPane extends BasicBeanPane { JPanel panel = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Plugin-TopParam_Setting")); panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); autoCommitCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Plugin-TopParam_AutoCommit"), true); - panel.add(autoCommitCheckBox); + maxDirectShowCountSpinner = new UISpinner(MIN_VALUE, MAX_VALUE, DEFAULT_DIERTA, DEFAULT_VALUE); + showCountTextField = new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Show_Count")); + Component[][] components = {{autoCommitCheckBox},{showCountTextField, maxDirectShowCountSpinner}}; + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] rowSize = {p, p}; + double[] columnSize = {p, f}; + JPanel paraPane = TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, GAP); + panel.add(paraPane); this.add(panel, BorderLayout.CENTER); } @Override public void populateBean(MobileTopParamStyle topParamStyle) { autoCommitCheckBox.setSelected(topParamStyle.isAutoCommit()); + maxDirectShowCountSpinner.setValue(topParamStyle.getMaxDirectShowCount()); } @Override public MobileTopParamStyle updateBean() { MobileTopParamStyle topParamStyle = new MobileTopParamStyle(); topParamStyle.setAutoCommit(autoCommitCheckBox.isSelected()); + topParamStyle.setMaxDirectShowCount((int) maxDirectShowCountSpinner.getValue()); return topParamStyle; }