From ed7930133f37dabfc2c76bcd643dc9c62c82c338 Mon Sep 17 00:00:00 2001 From: xiongcz Date: Fri, 25 Apr 2025 17:19:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(autocode):=20=E6=96=B0=E5=A2=9E=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=B1=BB=E5=88=AB=E5=B1=9E=E6=80=A7=E5=80=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在新建 UI 组件时,增加判断当前属性是否为文档类别 - 如果是文档类别属性,将最左侧选中的编码规则名称写入到属性值中 - 优化了属性名称和默认值的设置逻辑 --- .../generatcode/NewCodeItemDialog.java | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java b/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java index 0c62a86..b805797 100644 --- a/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java +++ b/src/cn/com/origin/autocode/newitem/generatcode/NewCodeItemDialog.java @@ -645,6 +645,7 @@ public class NewCodeItemDialog extends Dialog { * ½ UI -LabelobjPropComposite£ʹ */ public void addGeneralPropComosite() { + boolean isDocType = false;//ǰǷΪĵͣ for (int i = 0; i < generalPropLabelList.size(); i++) { Label label = generalPropLabelList.get(i); Widget text = generalPropTextList.get(i); @@ -656,19 +657,37 @@ public class NewCodeItemDialog extends Dialog { if (this.cnpropList != null) { for (CNProperty cnProp : this.cnpropList) { + //20250425 ѡеıд뵽Ҳĵ + Stirng currentPropName = cnProp.getDisplayName();//ǰĶor + System.out.println("ǰUILabel="+currentPropName); + if(currentPropName != null && currentPropName.equals("ĵ") && leftMostCodeRuleNameString != null && !leftMostCodeRuleNameString.equals("")){ + System.out.println("ĵƥɹֵΪѡб="+leftMostCodeRuleNameString); +// widget.setText(leftMostCodeRuleNameString); + isDocType = true; + } Label label = CreateCompositeUtil.createNewLabel(objPropComposite, - cnProp.getIsMust() ? (cnProp.getDisplayName() + "()") : cnProp.getDisplayName()); + cnProp.getIsMust() ? (currentPropName + "()") : currentPropName); generalPropLabelList.add(label); Widget widget = null; if (!cnProp.getIsLov()) { if (cnProp.getPropertyType().toUpperCase().equals("STRING")) { final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); - text.setText(cnProp.getDefaultValue()); +// text.setText(cnProp.getDefaultValue()); + if (isDocType){ + text.setText(leftMostCodeRuleNameString); + }else { + text.setText(cnProp.getDefaultValue()); + } widget = text; } else if (cnProp.getPropertyType().toUpperCase().equals("INTEGER")) { final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); - text.setText("0"); +// text.setText("0"); + if (isDocType){ + text.setText(leftMostCodeRuleNameString); + }else { + text.setText("0"); + } widget = text; text.addVerifyListener(new VerifyListener() { @Override @@ -679,7 +698,12 @@ public class NewCodeItemDialog extends Dialog { }); } else if (cnProp.getPropertyType().toUpperCase().equals("DOUBLE")) { final Text text = CreateCompositeUtil.createNewText(objPropComposite, cnProp.getDefaultValue()); - text.setText("0"); +// text.setText("0"); + if (isDocType){ + text.setText(leftMostCodeRuleNameString); + }else { + text.setText("0"); + } widget = text; text.addVerifyListener(new VerifyListener() { @Override @@ -698,6 +722,11 @@ public class NewCodeItemDialog extends Dialog { final Combo comb = CreateCompositeUtil.createNotFillNewCombo(objPropComposite, new String[] { "true", "false" }); // new comb.setText(cnProp.getDefaultValue()); // Combo(propTable, + if (isDocType){ + comb.setText(leftMostCodeRuleNameString); + }else { + comb.setText(cnProp.getDefaultValue()); + } widget = comb; // SWT.NONE); } } else {// lovBeanList @@ -769,6 +798,7 @@ public class NewCodeItemDialog extends Dialog { } } + generalPropTextList.add(widget); } }