|
|
@ -8,10 +8,8 @@ import com.fr.base.iofile.attr.WatermarkAttr; |
|
|
|
import com.fr.base.present.FormulaPresent; |
|
|
|
import com.fr.base.present.FormulaPresent; |
|
|
|
import com.fr.data.condition.FormulaCondition; |
|
|
|
import com.fr.data.condition.FormulaCondition; |
|
|
|
import com.fr.data.core.Compare; |
|
|
|
import com.fr.data.core.Compare; |
|
|
|
import com.fr.design.actions.replace.action.ShowValue; |
|
|
|
|
|
|
|
import com.fr.design.actions.replace.info.DealWithInfoValue; |
|
|
|
import com.fr.design.actions.replace.info.DealWithInfoValue; |
|
|
|
import com.fr.design.actions.replace.info.Info; |
|
|
|
import com.fr.design.actions.replace.info.Info; |
|
|
|
import com.fr.design.actions.replace.info.base.ITContent; |
|
|
|
|
|
|
|
import com.fr.design.actions.replace.utils.ShowValueUtils; |
|
|
|
import com.fr.design.actions.replace.utils.ShowValueUtils; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
import com.fr.js.SingleJavaScript; |
|
|
|
import com.fr.js.SingleJavaScript; |
|
|
@ -23,11 +21,12 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; |
|
|
|
import com.fr.stable.FormulaProvider; |
|
|
|
import com.fr.stable.FormulaProvider; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import javafx.util.Pair; |
|
|
|
import com.fr.stable.collections.combination.Pair; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author Destiny.Lin |
|
|
|
* @author Destiny.Lin |
|
|
@ -40,7 +39,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
FORMULA("Formula") { |
|
|
|
FORMULA("Formula") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) o[0]).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) o[0]).getContent())) { |
|
|
|
map.put("content", ((Formula) o[0]).getContent()); |
|
|
|
map.put("content", ((Formula) o[0]).getContent()); |
|
|
@ -49,7 +48,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((Formula) replaceObject).getContent(), findStr); |
|
|
|
info.updateOldStr(((Formula) replaceObject).getContent(), findStr); |
|
|
|
((Formula) replaceObject).setContent(ShowValueUtils.replaceAll(((Formula) replaceObject).getContent(), findStr, replaceStr)); |
|
|
|
((Formula) replaceObject).setContent(ShowValueUtils.replaceAll(((Formula) replaceObject).getContent(), findStr, replaceStr)); |
|
|
@ -60,7 +59,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
FORMULA_CONDITION("FormulaCondition") { |
|
|
|
FORMULA_CONDITION("FormulaCondition") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((FormulaCondition) o[0]).getFormula())) { |
|
|
|
if (!StringUtils.isEmpty(((FormulaCondition) o[0]).getFormula())) { |
|
|
|
map.put("content", ((FormulaCondition) o[0]).getFormula()); |
|
|
|
map.put("content", ((FormulaCondition) o[0]).getFormula()); |
|
|
@ -69,7 +68,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
//更新上一次操作的信息
|
|
|
|
//更新上一次操作的信息
|
|
|
|
info.updateOldStr(((FormulaCondition) replaceObject).getFormula(), findStr); |
|
|
|
info.updateOldStr(((FormulaCondition) replaceObject).getFormula(), findStr); |
|
|
@ -83,7 +82,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
COMPARE("Compare") { |
|
|
|
COMPARE("Compare") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) ((Compare) o[0]).getValue()).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) ((Compare) o[0]).getValue()).getContent())) { |
|
|
|
map.put("content", ((Formula) ((Compare) o[0]).getValue()).getContent()); |
|
|
|
map.put("content", ((Formula) ((Compare) o[0]).getValue()).getContent()); |
|
|
@ -92,7 +91,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
if (((Compare) replaceObject).getValue() instanceof Formula) { |
|
|
|
if (((Compare) replaceObject).getValue() instanceof Formula) { |
|
|
|
Formula formula = (Formula) ((Compare) replaceObject).getValue(); |
|
|
|
Formula formula = (Formula) ((Compare) replaceObject).getValue(); |
|
|
@ -108,7 +107,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
RICH_TEXT("RichText") { |
|
|
|
RICH_TEXT("RichText") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((RichText) ((CellElement) o[0]).getValue()).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((RichText) ((CellElement) o[0]).getValue()).getContent())) { |
|
|
|
map.put("content", ((RichText) ((CellElement) o[0]).getValue()).getContent()); |
|
|
|
map.put("content", ((RichText) ((CellElement) o[0]).getValue()).getContent()); |
|
|
@ -117,7 +116,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
//todo 富文本公式处理
|
|
|
|
//todo 富文本公式处理
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -127,7 +126,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
KV("KV") { |
|
|
|
KV("KV") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent())) { |
|
|
|
map.put("content", ((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent()); |
|
|
|
map.put("content", ((Formula) ((com.fr.base.core.KV) o[0]).getValue()).getContent()); |
|
|
@ -136,7 +135,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(), findStr); |
|
|
|
info.updateOldStr(((Formula) ((com.fr.base.core.KV) replaceObject).getValue()).getContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -149,7 +148,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
CELL_INSERT_POLICY_ATTR("CellInsertPolicyAttr") { |
|
|
|
CELL_INSERT_POLICY_ATTR("CellInsertPolicyAttr") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent())) { |
|
|
|
map.put("content", ((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent()); |
|
|
|
map.put("content", ((Formula) (((CellInsertPolicyAttr) o[0]).getDefaultInsertValue())).getContent()); |
|
|
@ -158,7 +157,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr); |
|
|
|
info.updateOldStr(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr); |
|
|
|
((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr, replaceStr)); |
|
|
|
((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).setContent(ShowValueUtils.replaceAll(((Formula) (((CellInsertPolicyAttr) replaceObject).getDefaultInsertValue())).getContent(), findStr, replaceStr)); |
|
|
@ -170,7 +169,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
PRESENT("Present") { |
|
|
|
PRESENT("Present") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((FormulaPresent) o[0]).getFormulaContent())) { |
|
|
|
if (!StringUtils.isEmpty(((FormulaPresent) o[0]).getFormulaContent())) { |
|
|
|
map.put("content", ((FormulaPresent) o[0]).getFormulaContent()); |
|
|
|
map.put("content", ((FormulaPresent) o[0]).getFormulaContent()); |
|
|
@ -179,7 +178,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((FormulaPresent) replaceObject).getFormulaContent(), findStr); |
|
|
|
info.updateOldStr(((FormulaPresent) replaceObject).getFormulaContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -192,7 +191,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
SINGLE_JAVA_SCRIPT("SingleJavaScript") { |
|
|
|
SINGLE_JAVA_SCRIPT("SingleJavaScript") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((SingleJavaScript) o[0]).getFileName())) { |
|
|
|
if (!StringUtils.isEmpty(((SingleJavaScript) o[0]).getFileName())) { |
|
|
|
map.put("content", ((SingleJavaScript) o[0]).getFileName()); |
|
|
|
map.put("content", ((SingleJavaScript) o[0]).getFileName()); |
|
|
@ -201,7 +200,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((SingleJavaScript) replaceObject).getFileName(), findStr); |
|
|
|
info.updateOldStr(((SingleJavaScript) replaceObject).getFileName(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -214,7 +213,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
PARAMETER_PROVIDER("ParameterProvider") { |
|
|
|
PARAMETER_PROVIDER("ParameterProvider") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) (((ParameterProvider) o[0]).getValue())).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) (((ParameterProvider) o[0]).getValue())).getContent())) { |
|
|
|
map.put("content", ((Formula) (((ParameterProvider) o[0]).getValue())).getContent()); |
|
|
|
map.put("content", ((Formula) (((ParameterProvider) o[0]).getValue())).getContent()); |
|
|
@ -223,7 +222,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(), findStr); |
|
|
|
info.updateOldStr(((Formula) (((ParameterProvider) replaceObject).getValue())).getContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -236,7 +235,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
FORMULA_PROVIDER("FormulaProvider") { |
|
|
|
FORMULA_PROVIDER("FormulaProvider") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((FormulaProvider) o[0]).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((FormulaProvider) o[0]).getContent())) { |
|
|
|
map.put("content", ((FormulaProvider) o[0]).getContent()); |
|
|
|
map.put("content", ((FormulaProvider) o[0]).getContent()); |
|
|
@ -245,7 +244,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((FormulaProvider) replaceObject).getContent(), findStr); |
|
|
|
info.updateOldStr(((FormulaProvider) replaceObject).getContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -258,7 +257,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
PARAMETER("Parameter") { |
|
|
|
PARAMETER("Parameter") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) (((Parameter) o[0]).getValue())).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) (((Parameter) o[0]).getValue())).getContent())) { |
|
|
|
map.put("content", ((Formula) (((Parameter) o[0]).getValue())).getContent()); |
|
|
|
map.put("content", ((Formula) (((Parameter) o[0]).getValue())).getContent()); |
|
|
@ -267,7 +266,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((Formula) (((Parameter) replaceObject).getValue())).getContent(), findStr); |
|
|
|
info.updateOldStr(((Formula) (((Parameter) replaceObject).getValue())).getContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -280,7 +279,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
DS_COLUMN("DSColumn") { |
|
|
|
DS_COLUMN("DSColumn") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((DSColumn) o[0]).getResult())) { |
|
|
|
if (!StringUtils.isEmpty(((DSColumn) o[0]).getResult())) { |
|
|
|
map.put("content", ((DSColumn) o[0]).getResult()); |
|
|
|
map.put("content", ((DSColumn) o[0]).getResult()); |
|
|
@ -289,7 +288,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((DSColumn) replaceObject).getResult(), findStr); |
|
|
|
info.updateOldStr(((DSColumn) replaceObject).getResult(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -302,7 +301,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
BASE_FORMULA("BaseFormula") { |
|
|
|
BASE_FORMULA("BaseFormula") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((BaseFormula) o[0]).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((BaseFormula) o[0]).getContent())) { |
|
|
|
map.put("content", ((BaseFormula) o[0]).getContent()); |
|
|
|
map.put("content", ((BaseFormula) o[0]).getContent()); |
|
|
@ -311,7 +310,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((BaseFormula) replaceObject).getContent(), findStr); |
|
|
|
info.updateOldStr(((BaseFormula) replaceObject).getContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -324,7 +323,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
STORE_PROCEDURE_PARAMETER("StoreProcedureParameter") { |
|
|
|
STORE_PROCEDURE_PARAMETER("StoreProcedureParameter") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent())) { |
|
|
|
if (!StringUtils.isEmpty(((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent())) { |
|
|
|
map.put("content", ((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent()); |
|
|
|
map.put("content", ((Formula) ((StoreProcedureParameter) o[0]).getValue()).getContent()); |
|
|
@ -333,7 +332,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
Object replaceObject = info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(), findStr); |
|
|
|
info.updateOldStr(((Formula) ((StoreProcedureParameter) replaceObject).getValue()).getContent(), findStr); |
|
|
|
|
|
|
|
|
|
|
@ -346,7 +345,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
WATER_MARK_ATTR("WatermarkAttr") { |
|
|
|
WATER_MARK_ATTR("WatermarkAttr") { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<String, String> getValue(Object... o) { |
|
|
|
public Map<String, String> getValue(Object... o) { |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
if (!StringUtils.isEmpty(((WatermarkAttr) o[0]).getText())) { |
|
|
|
if (!StringUtils.isEmpty(((WatermarkAttr) o[0]).getText())) { |
|
|
|
map.put("content", ((WatermarkAttr) o[0]).getText()); |
|
|
|
map.put("content", ((WatermarkAttr) o[0]).getText()); |
|
|
@ -355,7 +354,7 @@ public enum FormulaReplaceObject implements DealWithInfoValue { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, ArrayList<Pair<Integer, Integer>> operatorArray) { |
|
|
|
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) { |
|
|
|
WorkBook workBook = (WorkBook) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget(); |
|
|
|
WorkBook workBook = (WorkBook) HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget(); |
|
|
|
WatermarkAttr watermarkAttr = (WatermarkAttr) info.getContent().getReplaceObject(); |
|
|
|
WatermarkAttr watermarkAttr = (WatermarkAttr) info.getContent().getReplaceObject(); |
|
|
|
info.updateOldStr(watermarkAttr.getText(), findStr); |
|
|
|
info.updateOldStr(watermarkAttr.getText(), findStr); |
|
|
|