|
|
@ -387,7 +387,6 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
} |
|
|
|
} |
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, paramWithoutPre, BaseUtils.readIcon(PARAM_ICON))); |
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, paramWithoutPre, BaseUtils.readIcon(PARAM_ICON))); |
|
|
|
} |
|
|
|
} |
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, "$$$", BaseUtils.readIcon(PARAM_ICON))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return completionProvider; |
|
|
|
return completionProvider; |
|
|
|
} |
|
|
|
} |
|
|
@ -787,7 +786,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
// Execute Formula default cell element.
|
|
|
|
// Execute Formula default cell element.
|
|
|
|
String formulaText = formulaTextArea.getText().trim(); |
|
|
|
String formulaText = formulaTextArea.getText().trim(); |
|
|
|
FormulaCheckResult checkResult = FormulaChecker.check(formulaText); |
|
|
|
FormulaCheckResult checkResult = FormulaChecker.check(formulaText); |
|
|
|
confirmCheckResult(checkResult); |
|
|
|
confirmCheckResult(checkResult, checkResult.getTips()); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -804,7 +803,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
|
|
|
|
|
|
|
|
String messageTips; |
|
|
|
String messageTips; |
|
|
|
FormulaCheckResult checkResult = FormulaChecker.check(formulaText); |
|
|
|
FormulaCheckResult checkResult = FormulaChecker.check(formulaText); |
|
|
|
if (checkResult.isValid()) { |
|
|
|
if (checkResult.grammarValid()) { |
|
|
|
messageTips = checkResult.getTips() + NEWLINE; |
|
|
|
messageTips = checkResult.getTips() + NEWLINE; |
|
|
|
Map<String, Object> paramsMap = setParamsIfExist(formulaText); |
|
|
|
Map<String, Object> paramsMap = setParamsIfExist(formulaText); |
|
|
|
Calculator calculator = Calculator.createCalculator(); |
|
|
|
Calculator calculator = Calculator.createCalculator(); |
|
|
@ -836,12 +835,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
if (checkResult.isValid()) { |
|
|
|
if (checkResult.isValid()) { |
|
|
|
showMessageDialog(messageTips, checkResult.isValid()); |
|
|
|
showMessageDialog(messageTips, checkResult.isValid()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
confirmCheckResult(checkResult); |
|
|
|
confirmCheckResult(checkResult, messageTips); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private boolean confirmCheckResult(FormulaCheckResult checkResult) { |
|
|
|
private boolean confirmCheckResult(FormulaCheckResult checkResult, String messageTips) { |
|
|
|
if (checkResult.isValid()) { |
|
|
|
if (checkResult.isValid()) { |
|
|
|
showMessageDialog(checkResult.getTips(), checkResult.isValid()); |
|
|
|
showMessageDialog(checkResult.getTips(), checkResult.isValid()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -849,7 +848,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
+ Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + " "; |
|
|
|
+ Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + " "; |
|
|
|
int confirmDialog = FineJOptionPane.showConfirmDialog( |
|
|
|
int confirmDialog = FineJOptionPane.showConfirmDialog( |
|
|
|
FormulaPane.this, |
|
|
|
FormulaPane.this, |
|
|
|
position + checkResult.getTips(), |
|
|
|
position + messageTips, |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), |
|
|
|
JOptionPane.YES_NO_OPTION, |
|
|
|
JOptionPane.YES_NO_OPTION, |
|
|
|
JOptionPane.WARNING_MESSAGE, |
|
|
|
JOptionPane.WARNING_MESSAGE, |
|
|
@ -902,7 +901,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
String formula = formulaTextArea.getText().trim(); |
|
|
|
String formula = formulaTextArea.getText().trim(); |
|
|
|
FormulaCheckResult checkResult = FormulaChecker.check(formula); |
|
|
|
FormulaCheckResult checkResult = FormulaChecker.check(formula); |
|
|
|
if (!checkResult.isValid()) { |
|
|
|
if (!checkResult.isValid()) { |
|
|
|
return confirmCheckResult(checkResult); |
|
|
|
return confirmCheckResult(checkResult, checkResult.getTips()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|