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 97430ba7f..4dfcb4bb4 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 87d0a3a98..a8c8c3477 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.