Browse Source

REPORT-22964 系统参数说明无对应国际化键值

feature/big-screen
Joe.Jiang 5 years ago
parent
commit
035f9fd99f
  1. 11
      designer-base/src/main/java/com/fr/design/formula/FormulaConstants.java
  2. 10
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

11
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; import com.fr.stable.StringUtils;
/**
* @author Joe
* @version 10.0
* Created by Joe on 10/30/2019
*/
public enum FormulaConstants { public enum FormulaConstants {
PAGE_NUMBER("$$page_number", "Page_Number"), PAGE_NUMBER("$$page_number", "Page_Number"),
@ -21,13 +26,13 @@ public enum FormulaConstants {
CONTEXT_PATH("contextPath", "Context_Path"), CONTEXT_PATH("contextPath", "Context_Path"),
SESSION_ID("sessionID", "SessionID"); SESSION_ID("sessionID", "SessionID");
private String key; private String key;
private String value; private String value;
private static final String KEY_PREFIX = "Fine-Design_CurReport_Variable_";
private FormulaConstants(String key, String value) { private FormulaConstants(String key, String value) {
this.key = key; this.key = key;
this.value = value; this.value = KEY_PREFIX + value;
} }
public String getKey() { public String getKey() {
@ -47,4 +52,6 @@ public enum FormulaConstants {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
} }

10
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是系统参数 //有公式说明的条件:1.属于TextUserObject 2.parent是系统参数
if (ComparatorUtils.equals(((TextFolderUserObject) selectedParentValue).getText(), if (ComparatorUtils.equals(((TextFolderUserObject) selectedParentValue).getText(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Variables"))) { 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 { } else {
descriptionTextArea.setText(""); descriptionTextArea.setText(StringUtils.EMPTY);
} }
} else if (selectedValue instanceof TextFolderUserObject) { } else if (selectedValue instanceof TextFolderUserObject) {
descriptionTextArea.setText(""); descriptionTextArea.setText(StringUtils.EMPTY);
} }
descriptionTextArea.moveCaretPosition(0); 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() { private void initVariablesTree() {
// vairable. // vairable.

Loading…
Cancel
Save