diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/AbstractSearchHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/AbstractSearchHighlightAction.java new file mode 100644 index 0000000000..adb4ce6b1a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/AbstractSearchHighlightAction.java @@ -0,0 +1,31 @@ +package com.fr.design.actions.replace.action.content.formula.highlight; + +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.mainframe.JTemplate; +import com.fr.report.cell.cellattr.highlight.HighlightAction; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-19 + */ +public abstract class AbstractSearchHighlightAction implements SearchHighlightFormula { + @Override + public void dealWithHighlightAction(ITContent content, ArrayList formulaInfos, HighlightAction highlightAction) { + + } + + @Override + public void searchFormula(ArrayList formulaInfos, ITContent content) { + + } + + @Override + public ArrayList search4Infos(JTemplate jTemplate) { + return null; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaAction.java new file mode 100644 index 0000000000..11667b228a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/SearchHighlightFormulaAction.java @@ -0,0 +1,37 @@ +package com.fr.design.actions.replace.action.content.formula.highlight; + +import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.report.cell.cellattr.highlight.HighlightAction; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * 处理条件属性中各种属性的公式(超级链接、控件...) + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-18 + */ +public class SearchHighlightFormulaAction extends AbstractSearchHighlightAction{ + public static HashMap highlightHashMap = new HashMap<>(); + static { + //这边控件类型不做处理,在SearchWidgetFormulaAction统一处理即可 + //条件属性-超级链接 + highlightHashMap.put("HyperlinkHighlightAction",new SearchJSHighlightAction()); + //条件属性-... + // TODO: 2022/9/14 条件属性的其他类型 + } + + + @Override + public void dealWithHighlightAction(ITContent content, ArrayList formulaInfos, HighlightAction highlightAction) { + if (highlightHashMap.containsKey(highlightAction.getClass().getSimpleName())){ + SearchHighlightFormula searchHighlight = highlightHashMap.get(highlightAction.getClass().getSimpleName()); + searchHighlight.dealWithHighlightAction(content,formulaInfos,highlightAction); + } + + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchCommonConditionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchCommonConditionAction.java new file mode 100644 index 0000000000..d78041f569 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchCommonConditionAction.java @@ -0,0 +1,25 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.condition; + +import com.fr.base.Formula; +import com.fr.data.condition.CommonCondition; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.general.data.Condition; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-17 + */ +public class SearchCommonConditionAction implements SearchConditionFormula { + @Override + public void searchFormulaFromCondition(ArrayList formulaInfos, ITContent content, Condition condition) { + if (((CommonCondition)condition).getCompare().getValue() != null && ((CommonCondition)condition).getCompare().getValue() instanceof Formula){ + ITContent newContent =content.copy(); + newContent.setReplaceObject(((CommonCondition) condition).getCompare()); + formulaInfos.add(new FormulaInfo(newContent)); + } + } +} 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 new file mode 100644 index 0000000000..73a2a14351 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchFormulaConditionAction.java @@ -0,0 +1,26 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.condition; + +import com.fr.data.condition.FormulaCondition; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; + +import com.fr.general.data.Condition; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-17 + */ +public class SearchFormulaConditionAction implements SearchConditionFormula { + @Override + public void searchFormulaFromCondition(ArrayList formulaInfos, ITContent content, Condition condition) { + if (((FormulaCondition)(condition)).getFormula() != null){ + ITContent newContent = content.copy(); + newContent.setReplaceObject(condition); + formulaInfos.add(new FormulaInfo(newContent)); + } + + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchListConditionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchListConditionAction.java new file mode 100644 index 0000000000..33c52a7da1 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchListConditionAction.java @@ -0,0 +1,36 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.condition; + +import com.fr.data.condition.CommonCondition; +import com.fr.data.condition.FormulaCondition; +import com.fr.data.condition.ListCondition; +import com.fr.data.condition.ObjectCondition; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; + +import com.fr.general.data.Condition; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-17 + */ +public class SearchListConditionAction implements SearchConditionFormula { + @Override + public void searchFormulaFromCondition(ArrayList formulaInfos, ITContent content, Condition condition) { + for (int i = 0 ;i <((ListCondition)condition).getJoinConditionCount() ;i++){ + Condition joinCondition = ((ListCondition)condition).getJoinCondition(i).getCondition(); + if (joinCondition instanceof CommonCondition){ + SearchCommonConditionAction commonConditionAction = new SearchCommonConditionAction(); + commonConditionAction.searchFormulaFromCondition(formulaInfos, content, joinCondition); + } else if (joinCondition instanceof FormulaCondition){ + SearchFormulaConditionAction formulaConditionAction = new SearchFormulaConditionAction(); + formulaConditionAction.searchFormulaFromCondition(formulaInfos, content, joinCondition); + } else if (joinCondition instanceof ObjectCondition){ + SearchObjectConditionAction objectConditionAction = new SearchObjectConditionAction(); + objectConditionAction.searchFormulaFromCondition(formulaInfos, content, joinCondition); + } + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchObjectConditionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchObjectConditionAction.java new file mode 100644 index 0000000000..229512c2f5 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/condition/SearchObjectConditionAction.java @@ -0,0 +1,25 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.condition; + +import com.fr.base.Formula; +import com.fr.data.condition.ObjectCondition; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.general.data.Condition; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-18 + */ +public class SearchObjectConditionAction implements SearchConditionFormula { + @Override + public void searchFormulaFromCondition(ArrayList formulaInfos, ITContent content, Condition condition) { + if (((ObjectCondition)condition).getCompare().getValue() != null && ((ObjectCondition)condition).getCompare().getValue() instanceof Formula){ + ITContent newContent =content.copy(); + newContent.setReplaceObject(((ObjectCondition) condition).getCompare()); + formulaInfos.add(new FormulaInfo(newContent)); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/AbstractSearchJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/AbstractSearchJSFormulaAction.java new file mode 100644 index 0000000000..c7fd8cebc8 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/AbstractSearchJSFormulaAction.java @@ -0,0 +1,42 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.javascript; + +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.Info; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.mainframe.JTemplate; +import com.fr.js.JavaScript; +import com.fr.report.cell.cellattr.highlight.HighlightAction; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-19 + */ +public abstract class AbstractSearchJSFormulaAction implements SearchJSFormula { + @Override + public void searchJSFormulaFromOther(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + + } + + @Override + public void dealWithHighlightAction(ITContent content, ArrayList formulaInfos, HighlightAction highlightAction) { + + } + + @Override + public void searchFormula(ArrayList formulaInfos, ITContent content) { + + } + + @Override + public ArrayList search4Infos(JTemplate jTemplate) { + return null; + } + + @Override + public void addFormulaInfosFromJSPara(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java new file mode 100644 index 0000000000..aa956c52cc --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchCommit2DBJSFormulaAction.java @@ -0,0 +1,97 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.javascript; + +import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchCommonConditionAction; +import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionFormula; +import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchFormulaConditionAction; +import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchListConditionAction; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.general.data.Condition; +import com.fr.js.Commit2DBJavaScript; +import com.fr.js.JavaScript; +import com.fr.write.DBManipulation; +import com.fr.write.DMLConfigJob; +import com.fr.write.config.DMLConfig; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-19 + */ +public class SearchCommit2DBJSFormulaAction extends AbstractSearchJSFormulaAction{ + + public static HashMap conditionHashMap = new HashMap<>(); + static { + conditionHashMap.put("FormulaCondition",new SearchFormulaConditionAction()); + conditionHashMap.put("CommonCondition",new SearchCommonConditionAction()); + conditionHashMap.put("ListCondition",new SearchListConditionAction()); + } + @Override + public void searchJSFormulaFromOther(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + if (!((Commit2DBJavaScript)javaScript).getDBManipulation().isEmpty()){ + + //处理回调函数——这里单独摘出来是因为这边逻辑比较复杂,提交事件会再循环产生一个新的DBManipulation,后续统一处理 + dealWithCallBack(formulaInfos,content,((Commit2DBJavaScript)javaScript)); + //处理DBManipulation + for (int i = 0 ; i < ((Commit2DBJavaScript)javaScript).getDBManipulation().size() ; i++){ + dealWithDBManipulation(formulaInfos,content, (DBManipulation) ((Commit2DBJavaScript)javaScript).getDBManipulation().get(i)); + } + } + } + + private void dealWithDBManipulation(ArrayList formulaInfos, ITContent content, DBManipulation dbManipulation) { + DMLConfig dmlConfig = dbManipulation.getDmlConfig(); + //处理提交条件中的公式 + dealWithCommit2DBCondition(formulaInfos,content,dmlConfig); + //处理DBManipulation + dealWithSubmitJob(formulaInfos,content,dmlConfig); + } + + private void dealWithSubmitJob(ArrayList formulaInfos, ITContent content, DMLConfig dmlConfig) { + for (int i = 0 ;i < dmlConfig.getSubmitJobCount() ; i ++){ + //这边自定义事件不需要处理,只处理提交事件 + if (dmlConfig.getSubmitJob(i) instanceof DMLConfigJob){ + ITContent newContent = content.copy(); + + newContent.addOtherPos( + Toolkit.i18nText("Fine-Engine_Report_JavaScript_Commit_To_Database"), + Toolkit.i18nText("Fine-Design_Basic_Write_Submit_Event") + ); + dealWithDBManipulation(formulaInfos,newContent,(((DMLConfigJob)dmlConfig.getSubmitJob(i)).getDBManipulation())); + } + } + } + + private void dealWithCallBack(ArrayList formulaInfos, ITContent content, Commit2DBJavaScript javaScript) { + if (javaScript.getCallBack() != null){ + SearchJSHighlightAction SJSA = new SearchJSHighlightAction(); + ITContent newContent = content.copy(); + newContent.addOtherPos( + Toolkit.i18nText("Fine-Engine_Report_JavaScript_Commit_To_Database"), + Toolkit.i18nText("Fine-Design_Basic_Set_Callback_Function") + ); + SJSA.searchJSFormulaFromOther(formulaInfos,newContent, javaScript.getCallBack()); + + } + } + + private void dealWithCommit2DBCondition(ArrayList formulaInfos, ITContent content, DMLConfig dmlConfig){ + if (dmlConfig.getCondition() != null){ + //这边condition有三种情况:FormulaCondition、CommonCondition、ListCondition,分别处理 + Condition condition = dmlConfig.getCondition(); + SearchConditionFormula searchCondition = conditionHashMap.get(condition.getClass().getSimpleName()); + ITContent newContent = content.copy(); + newContent.addOtherPos( + Toolkit.i18nText("Fine-Engine_Report_JavaScript_Commit_To_Database"), + Toolkit.i18nText("Fine-Design_Basic_Submit_Condition") + ); + searchCondition.searchFormulaFromCondition(formulaInfos, newContent,condition); + } + } + + +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java new file mode 100644 index 0000000000..c49496db7a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchExportJSFormulaAction.java @@ -0,0 +1,49 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.javascript; + +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.js.ExportJavaScript; +import com.fr.js.JavaScript; +import com.fr.js.SingleJavaScript; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-19 + */ +public class SearchExportJSFormulaAction extends AbstractSearchJSFormulaAction{ + @Override + public void searchJSFormulaFromOther(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + //如果导出当前模板,可以存公式的地方就是命名方式-自定义 + if (((ExportJavaScript)javaScript).isCurrentTemplate()){ + dealSingleJavaScript(formulaInfos,content,((ExportJavaScript)javaScript).getCurrentTemplateJavaScript()); + } else { + List list = ((ExportJavaScript)javaScript).getJsListForOtherTemplates(); + if (isListExist(list)){ + for (SingleJavaScript singleJavaScript : list){ + dealSingleJavaScript(formulaInfos,content,singleJavaScript); + } + } + } + } + + public boolean isListExist(List list){ + return list != null && list.size() > 0; + } + + private void dealSingleJavaScript(ArrayList formulaInfos, ITContent content, SingleJavaScript javaScript){ + if (!javaScript.isDefaultFileName()){ + ITContent newContent = content.copy(); + newContent.setReplaceObject(javaScript); + newContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Event"), + Toolkit.i18nText("Fine-Design_Basic_Export_JS_Filename") + ); + formulaInfos.add(new FormulaInfo(newContent)); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java new file mode 100644 index 0000000000..36f5c2d9e5 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchJSHighlightAction.java @@ -0,0 +1,105 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.javascript; + +import com.fr.base.Formula; + +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.js.Commit2DBJavaScript; +import com.fr.js.JavaScript; +import com.fr.js.NameJavaScriptGroup; +import com.fr.report.cell.cellattr.highlight.HighlightAction; +import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; +import com.fr.stable.ParameterProvider; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * 处理条件属性中各种超级链接内的公式(也包括事件中的各种超链) + * + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-18 + */ +public class SearchJSHighlightAction extends AbstractSearchJSFormulaAction { + //需要特殊处理的JS类型 + public static HashMap javaScriptHashMap = new HashMap<>(); + public static HashMap hashMap = new HashMap<>(); + static { + hashMap.put(Commit2DBJavaScript.class, new SearchCommit2DBJSFormulaAction()); + } + static { + //控件事件里面需要特殊处理的类型 + //EmailJavaScript(这个暂时不做处理) + //ExportJavaScript + //MobilePopupHyperlink + //Commit2DBJavaScript + //单元格条件属性里面需要处理的类型 + //WebHyperlink——只有参数可以放公式,不需要特殊处理 + //ReportletHyperlink——只有参数可以放公式,不需要特殊处理 + //EmailJavaScript(这个暂时不做处理) + //ParameterJavaScript——只有参数可以放公式,不需要特殊处理 + //JavaScriptImpl——只有参数可以放公式,不需要特殊处理 + //MobilePopupHyperlink + //ChartHyperPoplink + //ChartHyperRelateCellLink + //ChartHyperRelateFloatLink + javaScriptHashMap.put("Commit2DBJavaScript",new SearchCommit2DBJSFormulaAction()); + javaScriptHashMap.put("ExportJavaScript",new SearchExportJSFormulaAction()); + javaScriptHashMap.put("MobilePopupHyperlink",new SearchMobileHyperlinkFormulaAction()); + } + + @Override + public void dealWithHighlightAction( ITContent content, ArrayList formulaInfos,HighlightAction highlightAction) { + NameJavaScriptGroup nameJavaScriptGroup = ((HyperlinkHighlightAction)highlightAction).getHperlink(); + if (nameJavaScriptGroup != null){ + for (int i = 0 ; i < nameJavaScriptGroup.size() ; i ++){ + //单元格条件属性-属性-超级链接里面参数的公式统一判断获取一下 + ITContent newContent =content.copy(); + newContent.addOtherPos( + Toolkit.i18nText("Fine-Design_Basic_Cell"), + Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), + Toolkit.i18nText("Fine-Design_Report_Hyperlink"), + Toolkit.i18nText("Fine-Design_Basic_Parameters")); + addFormulaInfosFromJSPara(formulaInfos,newContent,nameJavaScriptGroup.getNameHyperlink(i).getJavaScript()); + } + } + } + + /** + * 仅仅获取JS中的参数中的公式 + * @param formulaInfos + * @param content + * @param javaScript + */ + @Override + public void addFormulaInfosFromJSPara(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + if (javaScript.getParameters() != null){ + for (ParameterProvider provider : javaScript.getParameters()){ + if (provider.getValue() instanceof Formula){ + ITContent newContent = content.copy(); + newContent.setReplaceObject(provider); + formulaInfos.add(new FormulaInfo(newContent)); + } + } + } + } + + /** + * 对各种类型的JS分别处理,获取公式 + * @param formulaInfos + * @param content + * @param javaScript + */ + @Override + public void searchJSFormulaFromOther(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + //获取JS中的参数中的公式 + addFormulaInfosFromJSPara(formulaInfos, content, javaScript); + //这里面类型比较多,但是一部分不用处理——公式可能存在的地方只有参数,这部分在addFormulaInfosFromJSPara中就已经把公式拿完了 + if (javaScriptHashMap.containsKey(javaScript.getClass().getSimpleName())){ + SearchJSFormula javaScriptFormula = javaScriptHashMap.get(javaScript.getClass().getSimpleName()); + javaScriptFormula.searchJSFormulaFromOther(formulaInfos,content,javaScript); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchMobileHyperlinkFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchMobileHyperlinkFormulaAction.java new file mode 100644 index 0000000000..3524f6af15 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/highlight/javascript/SearchMobileHyperlinkFormulaAction.java @@ -0,0 +1,30 @@ +package com.fr.design.actions.replace.action.content.formula.highlight.javascript; + +import com.fr.base.Formula; +import com.fr.design.actions.replace.info.FormulaInfo; +import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.i18n.Toolkit; +import com.fr.js.JavaScript; +import com.fr.js.MobilePopupHyperlink; + +import java.util.ArrayList; + +/** + * @author Destiny.Lin + * @version 11.0 + * created by Destiny.Lin on 2022-08-19 + */ +public class SearchMobileHyperlinkFormulaAction extends AbstractSearchJSFormulaAction{ + @Override + public void searchJSFormulaFromOther(ArrayList formulaInfos, ITContent content, JavaScript javaScript) { + if (((MobilePopupHyperlink)javaScript).getPopupText() instanceof Formula){ + ITContent newContent = content.copy(); + newContent.setReplaceObject(((MobilePopupHyperlink)javaScript).getPopupText()); + newContent.addOtherPos( + Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup"), + Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Text") + ); + formulaInfos.add(new FormulaInfo(newContent)); + } + } +}