diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java index 0f2f6d181a..826b247e0c 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/cell/SearchCellAction.java @@ -17,7 +17,6 @@ import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.GeneralUtils; import com.fr.main.impl.WorkBook; import com.fr.report.cell.CellElement; -import com.fr.report.cell.cellattr.core.RichText; import com.fr.report.elementcase.ElementCase; import com.fr.report.poly.PolyECBlock; import com.fr.report.report.Report; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java index 4a478b596e..4eaa574bea 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/floatelement/SearchFloatAction.java @@ -85,7 +85,7 @@ public class SearchFloatAction implements SearchAction { if (floatElement.getValue() instanceof ChartCollection) { floatInfo.setChartExist(true); } - if (!(floatElement.getValue() instanceof ImageWithSuffix)){ + if (!(floatElement.getValue() instanceof ImageWithSuffix)) { result.add(floatInfo); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java index 40ff04006c..aadf2aee41 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/chart/SearchChartCollectionFormulaAction.java @@ -97,20 +97,20 @@ public class SearchChartCollectionFormulaAction { Toolkit.i18nText("Fine-Design_Chart_Interactive") ); - if (chart.getPlot() instanceof VanChartCustomPlot){ + if (chart.getPlot() instanceof VanChartCustomPlot) { VanChartCustomPlot plot = chart.getPlot(); - for (int i = 0 ; i < plot.getCustomPlotList().size() ; i++){ + for (int i = 0; i < plot.getCustomPlotList().size(); i++) { ITContent customContent = ITContent.copy(conditionContent); customContent.addOtherPos(CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)))); - dealPlot(formulaInfos,customContent,plot.getCustomPlotList().get(i)); + dealPlot(formulaInfos, customContent, plot.getCustomPlotList().get(i)); } } else if (chart.getPlot() != null) { - dealPlot(formulaInfos,conditionContent,chart.getPlot()); + dealPlot(formulaInfos, conditionContent, chart.getPlot()); } } - private void dealPlot(List formulaInfos, ITContent content, Plot plot){ + private void dealPlot(List formulaInfos, ITContent content, Plot plot) { NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); if (javaScriptGroup != null) { for (int i = 0; i < javaScriptGroup.size(); i++) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java index c6b8533219..44d495018b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java @@ -21,7 +21,6 @@ public class SearchFormulaConditionAction implements SearchConditionFormula { } - @Override public void searchFormulaFromCondition(List formulaInfos, ITContent content, Condition condition) { if (((FormulaCondition) (condition)).getFormula() != null) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java index 069167260a..ad97655263 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/js/SearchChartJSAction.java @@ -67,18 +67,18 @@ public class SearchChartJSAction { //坐标轴 searchAxisJS(jsInfos, chartContent, chartCollection.getChart(i)); //组合图表-条件属性-超链特判 - dealCustomPlot(jsInfos, conditionContent,chartCollection.getChart(i)); + dealCustomPlot(jsInfos, conditionContent, chartCollection.getChart(i)); } } private void dealCustomPlot(List jsInfos, ITContent conditionContent, Chart chart) { - if (chart.getPlot() instanceof VanChartCustomPlot){ + if (chart.getPlot() instanceof VanChartCustomPlot) { VanChartCustomPlot customPlot = chart.getPlot(); - for (VanChartPlot plot : customPlot.getCustomPlotList()){ + for (VanChartPlot plot : customPlot.getCustomPlotList()) { NameJavaScriptGroup javaScriptGroup = plot.getHotHyperLink(); - if (javaScriptGroup != null){ - for (int i = 0 ; i < javaScriptGroup.size();i++){ - if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl){ + if (javaScriptGroup != null) { + for (int i = 0; i < javaScriptGroup.size(); i++) { + if (javaScriptGroup.getNameHyperlink(i).getJavaScript() instanceof JavaScriptImpl) { ITContent content = ITContent.copy(conditionContent); content.addOtherPos( CustomPlotFactory.getTitle(CustomPlotFactory.getCustomType(plot)), diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java index c0d95e7079..8f962667d3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/utils/ShowValueUtils.java @@ -1,7 +1,6 @@ package com.fr.design.actions.replace.utils; - import com.fr.design.actions.replace.ui.ITReplaceMainDialog; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; @@ -30,6 +29,7 @@ public class ShowValueUtils { public static final String NUMBER_REGEX = "[0-9]"; public static final String ENGLISH_REGEX = "[a-zA-Z]"; private static List specialCharList = new ArrayList<>(); + static { //正则特殊字符:? * () [] {} ^ $ . //如果是? 并采用通配符 ,会自动转成“.” 所以 ? 不用处理 @@ -84,8 +84,8 @@ public class ShowValueUtils { */ public static String changeRegex(String regex) { String change = "\\"; - for (int i = 0 ; i < specialCharList.size() ; i ++){ - regex = regex.replace(specialCharList.get(i),change + specialCharList.get(i)); + for (int i = 0; i < specialCharList.size(); i++) { + regex = regex.replace(specialCharList.get(i), change + specialCharList.get(i)); } regex = regex.replace(NUMBER, NUMBER_REGEX); regex = regex.replace(ENGLISH, ENGLISH_REGEX); @@ -185,6 +185,12 @@ public class ShowValueUtils { return failReturn; } + /** + * 支持通配符的contains + * @param originStr + * @param matchStr + * @return + */ public static boolean contains(String originStr, String matchStr) { if (ITReplaceMainDialog.isMatched()) { String str = changeRegex(matchStr);