Browse Source

REPORT-75998 补充搜索单元格属性-其他-内容提示的公式

feature/x
Destiny.Lin 2 years ago
parent
commit
dd77af15e0
  1. 13
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
  2. 27
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
  3. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java

13
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java

@ -9,6 +9,7 @@ import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.general.GeneralUtils;
import com.fr.main.impl.WorkBook;
import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.stable.collections.combination.Pair;
import org.jetbrains.annotations.Nullable;
@ -120,6 +121,18 @@ public enum FormulaTag implements DealWithInfoValue {
workBook.setReportName(sheetId, ShowValueUtils.replaceAll(name, findStr, replaceStr));
}
}
},
/**
* 单元格属性-其他-内容提示
*/
CELL_TOOL_TIP(SearchTag.CELL_TOOL_TIP) {
@Override
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof CellGUIAttr) {
CellGUIAttr attr = (CellGUIAttr) info.getContent().getHoldObject();
attr.setTooltipText(ShowValueUtils.replaceAll(attr.getTooltipText(), findStr, replaceStr));
}
}
};
int index;

27
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java

@ -20,12 +20,14 @@ import com.fr.general.data.Condition;
import com.fr.js.NameJavaScriptGroup;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.cell.cellattr.highlight.DefaultHighlight;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.HighlightGroup;
import com.fr.report.core.sort.common.CellSortAttr;
import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import com.fr.report.core.sort.sortexpression.SortExpression;
import com.fr.stable.CommonUtils;
import java.util.List;
@ -69,6 +71,8 @@ public class SearchCellFormulaAction implements SearchCellFormula {
searchCellSortAttr4Formula(cellInfo, formulaInfos);
//单元格属性-形态
searchCellPresent4Formula(cellInfo, formulaInfos);
//单元格属性-其他-内容提示-自定义
searchCellToolTip4Formula(cellInfo, formulaInfos);
//单元格属性-其他-插入策略
searchCellInsertPolicy4Formula(cellInfo, formulaInfos);
//单元格条件属性-参数-公式
@ -84,6 +88,29 @@ public class SearchCellFormulaAction implements SearchCellFormula {
}
private void searchCellToolTip4Formula(CellInfo cellInfo, List<FormulaInfo> formulaInfos) {
if (cellInfo.getContent().getReplaceObject() instanceof TemplateCellElement) {
TemplateCellElement cellElement = (TemplateCellElement) cellInfo.getContent().getReplaceObject();
if (isCellGUIAttrValid(cellElement.getCellGUIAttr())) {
CellGUIAttr attr = cellElement.getCellGUIAttr();
ITContent attrContent = ITContent.copy(cellInfo.getContent());
attrContent.addOtherPos(
Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"),
Toolkit.i18nText("Fine-Design_Report_Other"),
Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"),
Toolkit.i18nText("Fine-Design_Basic_Custom")
);
attrContent.setReplaceObject(attr.getTooltipText());
attrContent.setHoldObject(attr);
formulaInfos.add(new FormulaInfo(attrContent));
}
}
}
private boolean isCellGUIAttrValid(CellGUIAttr attr) {
return attr != null && attr.isCustomTooltip() && CommonUtils.canBeFormula(attr.getTooltipText());
}
private void searchCellHyperLink4Formula(CellInfo cellInfo, List<FormulaInfo> formulaInfos) {
NameJavaScriptGroup nameJavaScriptGroup = ((CellElement) cellInfo.getContent().getReplaceObject()).getNameHyperlinkGroup();
if (nameJavaScriptGroup != null) {

4
designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java

@ -40,6 +40,10 @@ public class SearchTag {
* sheet名称
*/
public static final int SHEET_NAME = 7;
/**
* 单元格属性-其他-内容提示
*/
public static final int CELL_TOOL_TIP = 8;

Loading…
Cancel
Save