From 035f9fd99f28e50966749db787b12f5b0f77e9b8 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Wed, 30 Oct 2019 11:11:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-22964=20=E7=B3=BB=E7=BB=9F=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=AF=B4=E6=98=8E=E6=97=A0=E5=AF=B9=E5=BA=94=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=94=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/formula/FormulaConstants.java | 11 +++++++++-- .../main/java/com/fr/design/formula/FormulaPane.java | 10 +++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaConstants.java b/designer-base/src/main/java/com/fr/design/formula/FormulaConstants.java index 97430ba7ff..4dfcb4bb47 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaConstants.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaConstants.java @@ -2,6 +2,11 @@ package com.fr.design.formula; import com.fr.stable.StringUtils; +/** + * @author Joe + * @version 10.0 + * Created by Joe on 10/30/2019 + */ public enum FormulaConstants { PAGE_NUMBER("$$page_number", "Page_Number"), @@ -21,13 +26,13 @@ public enum FormulaConstants { CONTEXT_PATH("contextPath", "Context_Path"), SESSION_ID("sessionID", "SessionID"); - private String key; private String value; + private static final String KEY_PREFIX = "Fine-Design_CurReport_Variable_"; private FormulaConstants(String key, String value) { this.key = key; - this.value = value; + this.value = KEY_PREFIX + value; } public String getKey() { @@ -47,4 +52,6 @@ public enum FormulaConstants { return StringUtils.EMPTY; } + + } diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 87d0a3a985..a8c8c34779 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -792,22 +792,18 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { //有公式说明的条件:1.属于TextUserObject 2.parent是系统参数 if (ComparatorUtils.equals(((TextFolderUserObject) selectedParentValue).getText(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Variables"))) { - descriptionTextArea.setText(getVariableDescription((TextUserObject) selectedValue)); + descriptionTextArea.setText(com.fr.design.i18n.Toolkit.i18nText(FormulaConstants.getValueByKey(((TextUserObject) selectedValue).getText()))); } else { - descriptionTextArea.setText(""); + descriptionTextArea.setText(StringUtils.EMPTY); } } else if (selectedValue instanceof TextFolderUserObject) { - descriptionTextArea.setText(""); + descriptionTextArea.setText(StringUtils.EMPTY); } descriptionTextArea.moveCaretPosition(0); } }); } - private String getVariableDescription(TextUserObject selectedValue) { - - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_CurReport_Variable_" + FormulaConstants.getValueByKey(selectedValue.getText())); - } private void initVariablesTree() { // vairable.