Browse Source

REPORT-60163 公式编辑器优化2.0

1.修改了国际化的位置
feature/x
Hoky 3 years ago
parent
commit
105d7308ec
  1. 32
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  2. 17
      designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckConstants.java
  3. 29
      designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java
  4. 37
      designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedTokenFunction.java
  5. 3
      designer-base/src/main/java/com/fr/design/formula/exception/function/NoViableAltForCharFunction.java
  6. 7
      designer-base/src/main/java/com/fr/design/formula/exception/function/NoViableAltFunction.java

32
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -122,19 +122,13 @@ import java.util.Set;
* @since 2012-3-29下午1:50:53 * @since 2012-3-29下午1:50:53
*/ */
public class FormulaPane extends BasicPane implements KeyListener, UIFormula { public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private final static String CONFIRM_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm");
public static final int DEFUAL_FOMULA_LENGTH = 103; public static final int DEFUAL_FOMULA_LENGTH = 103;
public static final String ELLIPSIS = "..."; public static final String ELLIPSIS = "...";
public static final int KEY_CODE_A = 64; public static final int KEY_CODE_A = 64;
public static final int KEY_CODE_Z = 91; public static final int KEY_CODE_Z = 91;
public static final String CHECK_RESULT = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Result");
public static final String CONTINUE = Toolkit.i18nText("Fine-Design_Basic_Formula_Continue");
public static final String CAL_RESULT = Toolkit.i18nText("Fine-Design_Basic_Formula_Cal_Result");
public static final String NEWLINE = "\n"; public static final String NEWLINE = "\n";
public static final String ERROR_POSITION = Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position");
public static final String FORMULA_ICON = "/com/fr/design/images/m_file/formula.png"; public static final String FORMULA_ICON = "/com/fr/design/images/m_file/formula.png";
public static final String PARAM_ICON = "/com/fr/design/images/m_file/param.png"; public static final String PARAM_ICON = "/com/fr/design/images/m_file/param.png";
public static final int KEY_CODE_$ = 515;
private VariableTreeAndDescriptionArea variableTreeAndDescriptionArea; private VariableTreeAndDescriptionArea variableTreeAndDescriptionArea;
private RSyntaxTextArea formulaTextArea; private RSyntaxTextArea formulaTextArea;
private UITextField keyWordTextField = new UITextField(18); private UITextField keyWordTextField = new UITextField(18);
@ -152,7 +146,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private JList functionNameList; private JList functionNameList;
private UITableEditorPane<ParameterProvider> editor4CalPane; private UITableEditorPane<ParameterProvider> editor4CalPane;
private FormulaPaneAutoCompletion autoCompletion; private FormulaPaneAutoCompletion autoCompletion;
private static DefaultCompletionProvider COMPLETION_PROVIDER = null; private DefaultCompletionProvider completionProvider;
private static final Map<String, String> PARAM_PREFIX_MAP = new HashMap<>(); private static final Map<String, String> PARAM_PREFIX_MAP = new HashMap<>();
public FormulaPane() { public FormulaPane() {
@ -353,11 +347,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
} }
private CompletionProvider createCompletionProvider() { private CompletionProvider createCompletionProvider() {
if (COMPLETION_PROVIDER == null) { if (completionProvider == null) {
COMPLETION_PROVIDER = new DefaultCompletionProvider(); completionProvider = new DefaultCompletionProvider();
NameAndDescription[] nameAndDescriptions = FunctionConstants.ALL.getDescriptions(); NameAndDescription[] nameAndDescriptions = FunctionConstants.ALL.getDescriptions();
for (NameAndDescription nameAndDescription : nameAndDescriptions) { for (NameAndDescription nameAndDescription : nameAndDescriptions) {
COMPLETION_PROVIDER.addCompletion(new FormulaCompletion(COMPLETION_PROVIDER, nameAndDescription.getName(), BaseUtils.readIcon(FORMULA_ICON))); completionProvider.addCompletion(new FormulaCompletion(completionProvider, nameAndDescription.getName(), BaseUtils.readIcon(FORMULA_ICON)));
} }
VariableResolver variableResolver = VariableResolver.DEFAULT; VariableResolver variableResolver = VariableResolver.DEFAULT;
@ -381,13 +375,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
paramWithoutPre = parameter; paramWithoutPre = parameter;
PARAM_PREFIX_MAP.put(paramWithoutPre, StringUtils.EMPTY); PARAM_PREFIX_MAP.put(paramWithoutPre, StringUtils.EMPTY);
} }
COMPLETION_PROVIDER.addCompletion(new FormulaCompletion(COMPLETION_PROVIDER, paramWithoutPre, BaseUtils.readIcon(PARAM_ICON))); completionProvider.addCompletion(new FormulaCompletion(completionProvider, paramWithoutPre, BaseUtils.readIcon(PARAM_ICON)));
} }
COMPLETION_PROVIDER.addCompletion(new FormulaCompletion(COMPLETION_PROVIDER, "$$$", BaseUtils.readIcon(PARAM_ICON))); completionProvider.addCompletion(new FormulaCompletion(completionProvider, "$$$", BaseUtils.readIcon(PARAM_ICON)));
return COMPLETION_PROVIDER; return completionProvider;
} }
return COMPLETION_PROVIDER; return completionProvider;
} }
public static boolean containsParam(String param) { public static boolean containsParam(String param) {
@ -821,7 +815,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
String objectToString = EssentialUtils.objectToString(value); String objectToString = EssentialUtils.objectToString(value);
String result = objectToString.length() > DEFUAL_FOMULA_LENGTH ? String result = objectToString.length() > DEFUAL_FOMULA_LENGTH ?
objectToString.substring(0, DEFUAL_FOMULA_LENGTH - ELLIPSIS.length()) + ELLIPSIS : objectToString; objectToString.substring(0, DEFUAL_FOMULA_LENGTH - ELLIPSIS.length()) + ELLIPSIS : objectToString;
messageTips = messageTips + CAL_RESULT + ":" + result; messageTips = messageTips + Toolkit.i18nText("Fine-Design_Basic_Formula_Cal_Result") + ":" + result;
FineLoggerFactory.getLogger().info("value:{}", value); FineLoggerFactory.getLogger().info("value:{}", value);
} catch (UtilEvalError utilEvalError) { } catch (UtilEvalError utilEvalError) {
FineLoggerFactory.getLogger().error(utilEvalError.getMessage(), utilEvalError); FineLoggerFactory.getLogger().error(utilEvalError.getMessage(), utilEvalError);
@ -843,13 +837,13 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
} else { } else {
int confirmDialog = FineJOptionPane.showConfirmDialog( int confirmDialog = FineJOptionPane.showConfirmDialog(
FormulaPane.this, FormulaPane.this,
checkResult.getTips() + ", " + ERROR_POSITION + ":" + (checkResult.getFormulaCoordinates().getColumns()) + ".", checkResult.getTips() + ", " + Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + ":" + (checkResult.getFormulaCoordinates().getColumns()) + ".",
CONFIRM_DIALOG_TITLE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"),
JOptionPane.YES_NO_OPTION, JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE, JOptionPane.WARNING_MESSAGE,
null, null,
new String[]{CHECK_RESULT, CONTINUE}, new String[]{Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Result"), Toolkit.i18nText("Fine-Design_Basic_Formula_Continue")},
CHECK_RESULT); Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Result"));
if (confirmDialog == 0) { if (confirmDialog == 0) {
formulaTextArea.setCaretPosition(checkResult.getFormulaCoordinates().getColumns()); formulaTextArea.setCaretPosition(checkResult.getFormulaCoordinates().getColumns());
formulaTextArea.requestFocus(); formulaTextArea.requestFocus();

17
designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckConstants.java

@ -1,27 +1,10 @@
package com.fr.design.formula.exception.function; package com.fr.design.formula.exception.function;
import com.fr.design.i18n.Toolkit;
/** /**
* @author Hoky * @author Hoky
* @date 2021/10/28 * @date 2021/10/28
*/ */
public class FormulaCheckConstants { public class FormulaCheckConstants {
public final static String EXPECTING = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ";
public final static String FOUND = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found");
public final static String EXPECTING_ANYTHING = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything");
public final static String GOT_IT_ANYWAY = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_GotItAnyway");
public final static String TOKEN = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Token");
public final static String IN_RANGE = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_In_Range");
public final static String CHECK_NOT = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Not");
public final static String ONE_OF = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_ONE_OF");
public final static String UNEXPECTED_TOKEN = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Unexpected_Token");
public final static String UNEXPECTED_CHAR = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Unexpected_Char");
public final static String UNEXPECTED_END_OF_SUBTREE = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_End_Of_Subtree");
public final static String UNEXPECTED_AST_NODE = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Unexpected_AST_Node");
public final static String MISMATCHED_TOKEN = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Token");
public final static String MISMATCHED_CHAR = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Char");
public final static String MISMATCHED_EOF = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_EOF");
public static final String COLON = ":"; public static final String COLON = ":";
public static final String LEFT = "("; public static final String LEFT = "(";
public static final String COMMON = ","; public static final String COMMON = ",";

29
designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java

@ -1,6 +1,7 @@
package com.fr.design.formula.exception.function; package com.fr.design.formula.exception.function;
import com.fr.design.formula.FormulaChecker; import com.fr.design.formula.FormulaChecker;
import com.fr.design.i18n.Toolkit;
import com.fr.script.checker.result.FormulaCheckResult; import com.fr.script.checker.result.FormulaCheckResult;
import com.fr.script.checker.result.FormulaCoordinates; import com.fr.script.checker.result.FormulaCoordinates;
import com.fr.third.antlr.MismatchedCharException; import com.fr.third.antlr.MismatchedCharException;
@ -32,50 +33,50 @@ public class MismatchedCharFunction implements Function<Exception, FormulaCheckR
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
switch (charException.mismatchType) { switch (charException.mismatchType) {
case 1: case 1:
sb.append(FormulaCheckConstants.EXPECTING); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ");
appendCharName(sb, charException.expecting); appendCharName(sb, charException.expecting);
sb.append(FormulaCheckConstants.COMMON) sb.append(FormulaCheckConstants.COMMON)
.append(FormulaCheckConstants.BLANK) .append(FormulaCheckConstants.BLANK)
.append(FormulaCheckConstants.FOUND); .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"));
appendCharName(sb, charException.foundChar); appendCharName(sb, charException.foundChar);
break; break;
case 2: case 2:
sb.append(FormulaCheckConstants.EXPECTING_ANYTHING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything") + ": ")
.append(FormulaCheckConstants.BLANK) .append(FormulaCheckConstants.BLANK)
.append(FormulaCheckConstants.SINGLE_QUOTES); .append(FormulaCheckConstants.SINGLE_QUOTES);
appendCharName(sb, charException.expecting); appendCharName(sb, charException.expecting);
sb.append("';").append(FormulaCheckConstants.GOT_IT_ANYWAY); sb.append("';").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_GotItAnyway"));
break; break;
case 3: case 3:
case 4: case 4:
sb.append(FormulaCheckConstants.EXPECTING).append(FormulaCheckConstants.TOKEN); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Token"));
if (charException.mismatchType == 4) { if (charException.mismatchType == 4) {
sb.append(FormulaCheckConstants.CHECK_NOT); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Not"));
} }
sb.append(FormulaCheckConstants.IN_RANGE).append(": "); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_In_Range")).append(": ");
appendCharName(sb, charException.expecting); appendCharName(sb, charException.expecting);
sb.append(".."); sb.append("..");
appendCharName(sb, charException.upper); appendCharName(sb, charException.upper);
sb.append(", ").append(FormulaCheckConstants.FOUND); sb.append(", ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"));
appendCharName(sb, charException.foundChar); appendCharName(sb, charException.foundChar);
break; break;
case 5: case 5:
case 6: case 6:
sb.append(FormulaCheckConstants.EXPECTING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
.append(charException.mismatchType == 6 ? FormulaCheckConstants.CHECK_NOT : FormulaCheckConstants.BLANK) .append(charException.mismatchType == 6 ? Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Not") : FormulaCheckConstants.BLANK)
.append(FormulaCheckConstants.ONE_OF).append(" ("); .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_ONE_OF")).append(" (");
int[] elems = charException.set.toArray(); int[] elems = charException.set.toArray();
for (int i = 0; i < elems.length; ++i) { for (int i = 0; i < elems.length; ++i) {
appendCharName(sb, elems[i]); appendCharName(sb, elems[i]);
} }
sb.append("), ").append(FormulaCheckConstants.FOUND); sb.append("), ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"));
appendCharName(sb, charException.foundChar); appendCharName(sb, charException.foundChar);
break; break;
default: default:
sb.append(FormulaCheckConstants.MISMATCHED_CHAR); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Char"));
} }
return sb.toString(); return sb.toString();
@ -93,7 +94,7 @@ public class MismatchedCharFunction implements Function<Exception, FormulaCheckR
sb.append("'\\r'"); sb.append("'\\r'");
break; break;
case 65535: case 65535:
sb.append(FormulaCheckConstants.MISMATCHED_EOF); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_EOF"));
break; break;
default: default:
sb.append((char) c); sb.append((char) c);

37
designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedTokenFunction.java

@ -1,6 +1,7 @@
package com.fr.design.formula.exception.function; package com.fr.design.formula.exception.function;
import com.fr.design.formula.FormulaChecker; import com.fr.design.formula.FormulaChecker;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.script.checker.result.FormulaCheckResult; import com.fr.script.checker.result.FormulaCheckResult;
import com.fr.script.checker.result.FormulaCoordinates; import com.fr.script.checker.result.FormulaCoordinates;
@ -38,50 +39,50 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
String tokenText = fieldValue == null ? NULL_STRING : fieldValue.toString(); String tokenText = fieldValue == null ? NULL_STRING : fieldValue.toString();
switch (exception.mismatchType) { switch (exception.mismatchType) {
case 1: case 1:
sb.append(FormulaCheckConstants.EXPECTING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception))
.append(", ") .append(", ")
.append(FormulaCheckConstants.FOUND) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append(FormulaCheckConstants.BLANK + FormulaCheckConstants.SINGLE_QUOTES) .append(FormulaCheckConstants.BLANK + FormulaCheckConstants.SINGLE_QUOTES)
.append(tokenText).append("'"); .append(tokenText).append("'");
break; break;
case 2: case 2:
sb.append(FormulaCheckConstants.EXPECTING_ANYTHING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting_Anything") + ": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception))
.append("; ") .append("; ")
.append(FormulaCheckConstants.GOT_IT_ANYWAY); .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_GotItAnyway"));
break; break;
case 3: case 3:
sb.append(FormulaCheckConstants.EXPECTING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
.append(FormulaCheckConstants.TOKEN) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Token"))
.append(FormulaCheckConstants.IN_RANGE) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_In_Range"))
.append(": ") .append(": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception))
.append("..") .append("..")
.append(tokenName(exception.upper, exception)) .append(tokenName(exception.upper, exception))
.append(", ").append(FormulaCheckConstants.FOUND) .append(", ").append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append("'").append(tokenText).append("'"); .append("'").append(tokenText).append("'");
break; break;
case 4: case 4:
sb.append(FormulaCheckConstants.EXPECTING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
.append(FormulaCheckConstants.TOKEN) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Token"))
.append(FormulaCheckConstants.CHECK_NOT) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Not"))
.append(FormulaCheckConstants.IN_RANGE) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_In_Range"))
.append(": ") .append(": ")
.append(tokenName(exception.expecting, exception)) .append(tokenName(exception.expecting, exception))
.append("..") .append("..")
.append(tokenName(exception.upper, exception)) .append(tokenName(exception.upper, exception))
.append(","). .append(",").
append(FormulaCheckConstants.FOUND) append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append(" '") .append(" '")
.append(tokenText) .append(tokenText)
.append("'"); .append("'");
break; break;
case 5: case 5:
case 6: case 6:
sb.append(FormulaCheckConstants.EXPECTING) sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Expecting") + ": ")
.append(exception.mismatchType == 6 ? FormulaCheckConstants.CHECK_NOT : FormulaCheckConstants.BLANK) .append(exception.mismatchType == 6 ? Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Not") : FormulaCheckConstants.BLANK)
.append(FormulaCheckConstants.ONE_OF).append("("); .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_ONE_OF")).append("(");
int[] elms = exception.set.toArray(); int[] elms = exception.set.toArray();
for (int i = 0; i < elms.length; ++i) { for (int i = 0; i < elms.length; ++i) {
@ -90,13 +91,13 @@ public class MismatchedTokenFunction implements Function<Exception, FormulaCheck
} }
sb.append("),") sb.append("),")
.append(FormulaCheckConstants.FOUND) .append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Found"))
.append("'") .append("'")
.append(tokenText) .append(tokenText)
.append("'"); .append("'");
break; break;
default: default:
sb.append(FormulaCheckConstants.MISMATCHED_TOKEN); sb.append(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_Token"));
} }
return sb.toString(); return sb.toString();

3
designer-base/src/main/java/com/fr/design/formula/exception/function/NoViableAltForCharFunction.java

@ -1,6 +1,7 @@
package com.fr.design.formula.exception.function; package com.fr.design.formula.exception.function;
import com.fr.design.formula.FormulaChecker; import com.fr.design.formula.FormulaChecker;
import com.fr.design.i18n.Toolkit;
import com.fr.script.checker.result.FormulaCheckResult; import com.fr.script.checker.result.FormulaCheckResult;
import com.fr.script.checker.result.FormulaCoordinates; import com.fr.script.checker.result.FormulaCoordinates;
import com.fr.third.antlr.NoViableAltForCharException; import com.fr.third.antlr.NoViableAltForCharException;
@ -29,7 +30,7 @@ public class NoViableAltForCharFunction implements Function<Exception, FormulaCh
} }
public String getMessage(NoViableAltForCharException exception) { public String getMessage(NoViableAltForCharException exception) {
String mesg = FormulaCheckConstants.UNEXPECTED_CHAR + ": "; String mesg = Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Unexpected_Char") + ": ";
if (exception.foundChar >= ' ' && exception.foundChar <= '~') { if (exception.foundChar >= ' ' && exception.foundChar <= '~') {
mesg = mesg + '\''; mesg = mesg + '\'';
mesg = mesg + exception.foundChar; mesg = mesg + exception.foundChar;

7
designer-base/src/main/java/com/fr/design/formula/exception/function/NoViableAltFunction.java

@ -1,6 +1,7 @@
package com.fr.design.formula.exception.function; package com.fr.design.formula.exception.function;
import com.fr.design.formula.FormulaChecker; import com.fr.design.formula.FormulaChecker;
import com.fr.design.i18n.Toolkit;
import com.fr.script.checker.result.FormulaCheckResult; import com.fr.script.checker.result.FormulaCheckResult;
import com.fr.script.checker.result.FormulaCoordinates; import com.fr.script.checker.result.FormulaCoordinates;
import com.fr.third.antlr.NoViableAltException; import com.fr.third.antlr.NoViableAltException;
@ -31,10 +32,10 @@ public class NoViableAltFunction implements Function<Exception, FormulaCheckResu
public String getMessage(NoViableAltException exception) { public String getMessage(NoViableAltException exception) {
if (exception.token != null) { if (exception.token != null) {
return FormulaCheckConstants.UNEXPECTED_TOKEN + ": " + exception.token.getText(); return Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Unexpected_Token") + ": " + exception.token.getText();
} else { } else {
return exception.node == TreeParser.ASTNULL ? FormulaCheckConstants.UNEXPECTED_END_OF_SUBTREE : return exception.node == TreeParser.ASTNULL ? Toolkit.i18nText("Fine-Design_Basic_Formula_Check_End_Of_Subtree") :
FormulaCheckConstants.UNEXPECTED_AST_NODE + ": " + exception.node.toString(); Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Unexpected_AST_Node") + ": " + exception.node.toString();
} }
} }
} }
Loading…
Cancel
Save