Browse Source

修改enum解析

research/10.0
Hades 6 years ago
parent
commit
695aea46b3
  1. 14
      designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java

14
designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java

@ -37,24 +37,14 @@ public class ScanCodeMobilePane extends WidgetMobilePane {
public void populate(Widget widget) { public void populate(Widget widget) {
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr();
ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState(); ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState();
appScanCodeCheck.setSelected(scanCodeState2boolean(scanCodeState)); appScanCodeCheck.setSelected(scanCodeState.getState());
} }
@Override @Override
public void update(Widget widget) { public void update(Widget widget) {
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr(); MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) widget).getMobileScanCodeAttr();
mobileScanCodeAttr.setScanCodeState(boolean2ScanCodeState(appScanCodeCheck.isSelected())); mobileScanCodeAttr.setScanCodeState(ScanCodeState.parse(appScanCodeCheck.isSelected()));
} }
private ScanCodeState boolean2ScanCodeState(boolean scanCodeCheck) {
if (scanCodeCheck) {
return ScanCodeState.SUPPORT_SCAN_CODE;
} else {
return ScanCodeState.NOT_SUPPORT_SCAN_CODE;
}
}
private boolean scanCodeState2boolean(ScanCodeState scanCodeState) {
return scanCodeState == ScanCodeState.SUPPORT_SCAN_CODE;
}
} }

Loading…
Cancel
Save