forked from fanruan/design
Browse Source
* commit '695aea46b367e73e9c355e61d86fc5ee7a61602d': 修改enum解析 修改一个SB写法 REPORT-12622 文本控件支持扫码 ui部分research/10.0
Hades
6 years ago
2 changed files with 53 additions and 0 deletions
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.design.widget.ui.mobile; |
||||||
|
|
||||||
|
import com.fr.base.mobile.MobileScanCodeAttr; |
||||||
|
import com.fr.base.mobile.ScanCodeState; |
||||||
|
import com.fr.design.foldablepane.UIExpandablePane; |
||||||
|
import com.fr.design.gui.icheckbox.UICheckBox; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.design.widget.mobile.WidgetMobilePane; |
||||||
|
import com.fr.form.ui.TextEditor; |
||||||
|
import com.fr.form.ui.Widget; |
||||||
|
|
||||||
|
import javax.swing.BorderFactory; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
|
|
||||||
|
public class ScanCodeMobilePane extends WidgetMobilePane { |
||||||
|
|
||||||
|
private UICheckBox appScanCodeCheck; |
||||||
|
|
||||||
|
protected void init() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
||||||
|
this.add(getMobileSettingPane(), BorderLayout.NORTH); |
||||||
|
} |
||||||
|
|
||||||
|
private UIExpandablePane getMobileSettingPane() { |
||||||
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||||
|
appScanCodeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Support_Scan_Code"), true); |
||||||
|
appScanCodeCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
||||||
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
||||||
|
panel.add(appScanCodeCheck); |
||||||
|
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||||
|
panelWrapper.add(panel, BorderLayout.NORTH); |
||||||
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panelWrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populate(Widget widget) { |
||||||
|
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); |
||||||
|
ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState(); |
||||||
|
appScanCodeCheck.setSelected(scanCodeState.getState()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void update(Widget widget) { |
||||||
|
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); |
||||||
|
mobileScanCodeAttr.setScanCodeState(ScanCodeState.parse(appScanCodeCheck.isSelected())); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue