|
|
@ -1,24 +1,24 @@ |
|
|
|
package com.fr.design.widget.ui.designer.mobile; |
|
|
|
package com.fr.design.widget.ui.designer.mobile; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.mobile.MobileScanCodeAttr; |
|
|
|
import com.fr.base.mobile.MobileScanCodeAttr; |
|
|
|
import com.fr.base.mobile.ScanCodeState; |
|
|
|
import com.fr.base.mobile.TextInputMode; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.ibutton.ModeButtonGroup; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.form.ui.TextEditor; |
|
|
|
import com.fr.form.ui.TextEditor; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
|
|
|
|
|
|
|
|
private XCreator xCreator; |
|
|
|
private XCreator xCreator; |
|
|
|
private UICheckBox appScanCodeCheck; |
|
|
|
private ModeButtonGroup<TextInputMode> buttonGroup; |
|
|
|
|
|
|
|
|
|
|
|
public ScanCodeMobileDefinePane(XCreator xCreator) { |
|
|
|
public ScanCodeMobileDefinePane(XCreator xCreator) { |
|
|
|
this.xCreator = xCreator; |
|
|
|
this.xCreator = xCreator; |
|
|
@ -33,14 +33,31 @@ public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private UIExpandablePane getMobileSettingsPane() { |
|
|
|
private UIExpandablePane getMobileSettingsPane() { |
|
|
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); |
|
|
|
appScanCodeCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Support_Scan_Code"), true); |
|
|
|
buttonGroup = new ModeButtonGroup<>(); |
|
|
|
appScanCodeCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
UIRadioButton scanCodeAndManualInput = new UIRadioButton( |
|
|
|
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design__Mobile_Support_Scan_Code_And_Manual_Input"), true); |
|
|
|
|
|
|
|
UIRadioButton onlyManualInput = new UIRadioButton( |
|
|
|
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Only_Support_Manual_Input"), false); |
|
|
|
|
|
|
|
UIRadioButton onlyScanCodeInput = new UIRadioButton( |
|
|
|
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Only_Support_Scan_Code_Input"), false); |
|
|
|
|
|
|
|
scanCodeAndManualInput.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
|
|
|
onlyManualInput.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
|
|
|
onlyScanCodeInput.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
|
|
|
buttonGroup.put(TextInputMode.SUPPORT_SCAN_CODE_And_MANUAL, scanCodeAndManualInput); |
|
|
|
|
|
|
|
buttonGroup.put(TextInputMode.ONLY_SUPPORT_MANUAL, onlyManualInput); |
|
|
|
|
|
|
|
buttonGroup.put(TextInputMode.ONLY_SUPPORT_SCAN_CODE, onlyScanCodeInput); |
|
|
|
|
|
|
|
buttonGroup.add(scanCodeAndManualInput); |
|
|
|
|
|
|
|
buttonGroup.add(onlyManualInput); |
|
|
|
|
|
|
|
buttonGroup.add(onlyScanCodeInput); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); |
|
|
|
panel.add(appScanCodeCheck); |
|
|
|
panel.add(scanCodeAndManualInput); |
|
|
|
|
|
|
|
panel.add(onlyManualInput); |
|
|
|
|
|
|
|
panel.add(onlyScanCodeInput); |
|
|
|
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
panelWrapper.add(panel, BorderLayout.NORTH); |
|
|
|
panelWrapper.add(panel, BorderLayout.NORTH); |
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panelWrapper); |
|
|
|
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, |
|
|
|
|
|
|
|
panelWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void bindListeners2Widgets() { |
|
|
|
private void bindListeners2Widgets() { |
|
|
@ -61,15 +78,14 @@ public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void populate(FormDesigner designer) { |
|
|
|
public void populate(FormDesigner designer) { |
|
|
|
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr(); |
|
|
|
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr(); |
|
|
|
ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState(); |
|
|
|
buttonGroup.setSelectButton(mobileScanCodeAttr.getTextInputMode()); |
|
|
|
appScanCodeCheck.setSelected(scanCodeState.getState()); |
|
|
|
|
|
|
|
this.bindListeners2Widgets(); |
|
|
|
this.bindListeners2Widgets(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void update() { |
|
|
|
public void update() { |
|
|
|
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr(); |
|
|
|
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr(); |
|
|
|
mobileScanCodeAttr.setScanCodeState(ScanCodeState.parse(appScanCodeCheck.isSelected())); |
|
|
|
mobileScanCodeAttr.setTextInputMode(buttonGroup.getCurrentSelected()); |
|
|
|
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); |
|
|
|
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|