Browse Source

Merge pull request #613 in DESIGN/design from ~HADES/design:feature/10.0 to feature/10.0

* commit '695aea46b367e73e9c355e61d86fc5ee7a61602d':
  修改enum解析
  修改一个SB写法
  REPORT-12622 文本控件支持扫码 ui部分
research/10.0
Hades 6 years ago
parent
commit
fdf4690062
  1. 3
      designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java
  2. 50
      designer-realize/src/main/java/com/fr/design/widget/ui/mobile/ScanCodeMobilePane.java

3
designer-realize/src/main/java/com/fr/design/widget/WidgetMobilePaneFactory.java

@ -4,7 +4,9 @@ import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.widget.mobile.WidgetMobilePane; import com.fr.design.widget.mobile.WidgetMobilePane;
import com.fr.design.widget.ui.mobile.MultiFileEditorMobilePane; import com.fr.design.widget.ui.mobile.MultiFileEditorMobilePane;
import com.fr.design.widget.ui.mobile.ScanCodeMobilePane;
import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import java.util.HashMap; import java.util.HashMap;
@ -18,6 +20,7 @@ public class WidgetMobilePaneFactory {
static { static {
mobilePaneMap.put(MultiFileEditor.class, MultiFileEditorMobilePane.class); mobilePaneMap.put(MultiFileEditor.class, MultiFileEditorMobilePane.class);
mobilePaneMap.put(TextEditor.class, ScanCodeMobilePane.class);
mobilePaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap()); mobilePaneMap.putAll(ExtraDesignClassManager.getInstance().getCellWidgetMobileOptionsMap());
} }

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

@ -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…
Cancel
Save