From cc7e2b8fdb49c324f0d06c1dfcadedc123fae67f Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 26 Nov 2021 15:59:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-63192=20=E3=80=90=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8F=AF=E6=9B=B4=E6=96=B0=E6=8F=90=E9=86=92=E3=80=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A4=8D=E7=94=A8-=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E7=AB=AF=E7=94=9F=E6=88=90=E7=BB=84=E4=BB=B6=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E6=94=B9=E4=B8=BA=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 监听下必填项设置:组件分类 【改动思路】 同上 --- .../com/fr/design/share/ui/generate/ShareMainPane.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java index 5639b5957d..9ac98286e8 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java @@ -409,6 +409,15 @@ public class ShareMainPane extends JPanel { childClassify.clearBoxItems(); childClassify.refreshBoxItems(children); } + + notifyRequiredSettingChanged(new ChangeEvent(parentClassify)); + } + }); + + childClassify.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + notifyRequiredSettingChanged(new ChangeEvent(parentClassify)); } }); From 5a407a44914a8fbfa88e9c27aab5629eb0c389cc Mon Sep 17 00:00:00 2001 From: Hoky <303455184@qq.com> Date: Tue, 30 Nov 2021 18:10:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-60163=20=E5=85=AC=E5=BC=8F=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E4=BC=98=E5=8C=962.0=201.=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=202.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FormulaPane.java | 16 ++-- .../function/MismatchedCharFunction.java | 9 -- .../function/MismatchedTokenFunction.java | 38 +------- .../function/TranslateTokenUtils.java | 96 +++++++++++++++++++ 4 files changed, 108 insertions(+), 51 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/formula/exception/function/TranslateTokenUtils.java 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 189b9e0426..27018e6e01 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 @@ -341,7 +341,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { @Override public void focusGained(FocusEvent e) { // 获得焦点时 安装 - installAutoCompletion(); + if (autoCompletion == null && autoCompletionCheck.isSelected()) { + installAutoCompletion(); + } } @Override @@ -405,13 +407,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { } private void installAutoCompletion() { - if (autoCompletion == null && autoCompletionCheck.isSelected()) { - CompletionProvider provider = createCompletionProvider(); - autoCompletion = new FormulaPaneAutoCompletion(provider); - autoCompletion.setListCellRenderer(new CompletionCellRenderer()); - autoCompletion.install(formulaTextArea); - autoCompletion.installVariableTree(variableTreeAndDescriptionArea); - } + CompletionProvider provider = createCompletionProvider(); + autoCompletion = new FormulaPaneAutoCompletion(provider); + autoCompletion.setListCellRenderer(new CompletionCellRenderer()); + autoCompletion.install(formulaTextArea); + autoCompletion.installVariableTree(variableTreeAndDescriptionArea); } diff --git a/designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java b/designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java index c25b34f67b..69ea0c81a9 100644 --- a/designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java +++ b/designer-base/src/main/java/com/fr/design/formula/exception/function/MismatchedCharFunction.java @@ -35,10 +35,6 @@ public class MismatchedCharFunction implements Function"; } else { String[] tokenNames = (String[]) getFieldValue(exception, "tokenNames"); - return tokenType >= 0 && tokenType < tokenNames.length ? translateToken(tokenNames[tokenType]) : "<" + tokenType + ">"; + return tokenType >= 0 && tokenType < tokenNames.length ? TranslateTokenUtils.translateToken(tokenNames[tokenType]) : "<" + tokenType + ">"; } } - private String translateToken(String token) { - switch (token) { - case ("RPAREN"): - return ")"; - case ("LPAREN"): - return "("; - case ("COMMA"): - return ","; - case ("COLON"): - return ":"; - default: - return token; - } - } private Object getFieldValue(Object object, String fieldName) { try { diff --git a/designer-base/src/main/java/com/fr/design/formula/exception/function/TranslateTokenUtils.java b/designer-base/src/main/java/com/fr/design/formula/exception/function/TranslateTokenUtils.java new file mode 100644 index 0000000000..1df697d071 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/formula/exception/function/TranslateTokenUtils.java @@ -0,0 +1,96 @@ +package com.fr.design.formula.exception.function; + +import com.fr.design.i18n.Toolkit; + +/** + * @author Hoky + * @date 2021/11/30 + */ +public class TranslateTokenUtils { + public static String translateToken(String token) { + switch (token) { + case ("RPAREN"): + return ")"; + case ("LPAREN"): + return "("; + case ("COMMA"): + return ","; + case ("COLON"): + return ":"; + case ("EOF"): + return Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Mismatched_EOF"); + case ("DOT"): + return "."; + case ("FLOT_NUM"): + return Toolkit.i18nText("Fine-Design_Basic_Formula_Float_Number"); + case ("LOR"): + return "||"; + case ("LAND"): + return "&&"; + case ("EQUAL"): + return "="; + case ("EQUAL2"): + return "="; + case ("NOT_EQUAL"): + return "!="; + case ("NOT_EQUAL2"): + return "!="; + case ("GE"): + return ">="; + case ("LE"): + return "<="; + case ("LT"): + return "<"; + case ("PLUS"): + return "+"; + case ("MINUS"): + return "-"; + case ("STAR"): + return "*"; + case ("DIV"): + return "/"; + case ("MOD"): + return "%"; + case ("POWER"): + return "^"; + case ("LNOT"): + return "!"; + case ("WAVE"): + return "~"; + case ("LBRACK"): + return "["; + case ("SEMI"): + return ";"; + case ("RBRACK"): + return "]"; + case ("LCURLY"): + return "{"; + case ("RCURLY"): + return "}"; + case ("DCOLON"): + return ";"; + case ("INT_NUM"): + return Toolkit.i18nText("Fine-Design_Basic_Formula_Integer"); + case ("CR_ADRESS"): + return "\n"; + case ("SHARP"): + return "#"; + case ("AT"): + return "@"; + case ("QUESTION"): + return "?"; + case ("BOR"): + return "||"; + case ("BAND"): + return "&&"; + case ("Char"): + return Toolkit.i18nText("Fine-Design_Basic_Formula_Character"); + case ("DIGIT"): + return Toolkit.i18nText("Fine-Design_Basic_Formula_Digital"); + case ("XDIGIT"): + return Toolkit.i18nText("Fine-Design_Basic_Formula_Hexadecimal_Digital"); + default: + return token; + } + } +}