Browse Source

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

* commit 'ffa5a06918c4018e7568803741d380899ae86455':
  REPORT-12974 pc端》参数、表单界面》扫码优化》移动端属性没有设置扫码选项
research/10.0
Hades 6 years ago
parent
commit
006ad75e9f
  1. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java
  2. 32
      designer-form/src/main/java/com/fr/design/designer/properties/mobile/ScanCodeMobilePropertyUI.java
  3. 76
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java

6
designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java

@ -6,7 +6,9 @@ package com.fr.design.designer.creator;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.designer.properties.mobile.ScanCodeMobilePropertyUI;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.mainframe.widget.editors.RegexEditor; import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
@ -82,4 +84,8 @@ public class XTextEditor extends XWrapperedFieldEditor {
return "text_field_16.png"; return "text_field_16.png";
} }
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[] {new ScanCodeMobilePropertyUI(this)};
}
} }

32
designer-form/src/main/java/com/fr/design/designer/properties/mobile/ScanCodeMobilePropertyUI.java

@ -0,0 +1,32 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XTextEditor;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.widget.ui.designer.mobile.ScanCodeMobileDefinePane;
public class ScanCodeMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public ScanCodeMobilePropertyUI(XTextEditor xTextEditor) {
this.xCreator = xTextEditor;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return null;
}
@Override
public BasicPane createWidgetAttrPane() {
return new ScanCodeMobileDefinePane(xCreator);
}
@Override
public String tableTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr");
}
}

76
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ScanCodeMobileDefinePane.java

@ -0,0 +1,76 @@
package com.fr.design.widget.ui.designer.mobile;
import com.fr.base.mobile.MobileScanCodeAttr;
import com.fr.base.mobile.ScanCodeState;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.TextEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
public class ScanCodeMobileDefinePane extends MobileWidgetDefinePane {
private XCreator xCreator;
private UICheckBox appScanCodeCheck;
public ScanCodeMobileDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
}
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel mobileSettingsPane = getMobileSettingsPane();
this.add(mobileSettingsPane, BorderLayout.NORTH);
this.repaint();
}
private UIExpandablePane getMobileSettingsPane() {
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);
}
private void bindListeners2Widgets() {
reInitAllListeners();
AttributeChangeListener changeListener = new AttributeChangeListener() {
@Override
public void attributeChange() {
update();
}
};
this.addAttributeChangeListener(changeListener);
}
private void reInitAllListeners() {
initListener(this);
}
@Override
public void populate(FormDesigner designer) {
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr();
ScanCodeState scanCodeState = mobileScanCodeAttr.getScanCodeState();
appScanCodeCheck.setSelected(scanCodeState.getState());
this.bindListeners2Widgets();
}
@Override
public void update() {
MobileScanCodeAttr mobileScanCodeAttr = ((TextEditor) xCreator.toData()).getMobileScanCodeAttr();
mobileScanCodeAttr.setScanCodeState(ScanCodeState.parse(appScanCodeCheck.isSelected()));
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
}
Loading…
Cancel
Save