|
|
|
@ -2,8 +2,12 @@ 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.*; |
|
|
|
@ -11,6 +15,13 @@ import java.awt.*;
|
|
|
|
|
|
|
|
|
|
public class MobileTopParamPane extends BasicBeanPane<MobileTopParamStyle> { |
|
|
|
|
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 +32,29 @@ public class MobileTopParamPane extends BasicBeanPane<MobileTopParamStyle> {
|
|
|
|
|
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[] portRowSize = {p, p}; |
|
|
|
|
double[] portColumnSize = {p, f}; |
|
|
|
|
JPanel portComPane = TableLayoutHelper.createCommonTableLayoutPane(components, portRowSize, portColumnSize, GAP); |
|
|
|
|
panel.add(portComPane); |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|