Browse Source

Pull request #10640: REPORT-83391 顶部参数面板体验优化

Merge in DESIGN/design from ~DESTINY.LIN/design:feature/x to feature/x

* commit '6c53a08939474a426042844e1612743d5d2f94c3':
  REPORT-83391 顶部参数面板体验优化 修改.*导入
  REPORT-83391 顶部参数面板体验优化 修改下变量命名
  REPORT-83391 顶部参数面板体验优化
feature/x
Destiny.Lin-林锦龙 2 years ago
parent
commit
26bed0d0a1
  1. 29
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/topparam/MobileTopParamPane.java

29
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<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 +34,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[] 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;
}

Loading…
Cancel
Save