|
|
|
@ -7,8 +7,13 @@ import com.fr.data.condition.FormulaCondition;
|
|
|
|
|
import com.fr.data.impl.FormulaDictionary; |
|
|
|
|
import com.fr.design.mod.ContentReplaceUtil; |
|
|
|
|
import com.fr.design.mod.ContentReplacer; |
|
|
|
|
import com.fr.form.ui.CardSwitchButton; |
|
|
|
|
import com.fr.form.ui.WidgetTitle; |
|
|
|
|
import com.fr.report.cell.cellattr.CellExpandAttr; |
|
|
|
|
import com.fr.report.cell.cellattr.CellGUIAttr; |
|
|
|
|
import com.fr.report.cell.cellattr.core.RichChar; |
|
|
|
|
import com.fr.report.cell.cellattr.core.group.FunctionGrouper; |
|
|
|
|
import com.fr.report.cell.cellattr.core.group.SelectCount; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 持有公式内容对象汇总 |
|
|
|
@ -148,4 +153,95 @@ public class FormulaReplacer {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 公式分组 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
public static final ContentReplacer<FunctionGrouper> FunctionGrouper4TableDataNameContentReplacer = new ContentReplacer<FunctionGrouper>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(FunctionGrouper functionGrouper, String oldName, String newName) { |
|
|
|
|
functionGrouper.setFormulaContent(ContentReplaceUtil.replacePureFormula4TableDataName(functionGrouper.getFormulaContent(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public static final ContentReplacer<FunctionGrouper> FunctionGrouper4WidgetNameContentReplacer = new ContentReplacer<FunctionGrouper>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(FunctionGrouper functionGrouper, String oldName, String newName) { |
|
|
|
|
functionGrouper.setFormulaContent(ContentReplaceUtil.replacePureFormula4WidgetName(functionGrouper.getFormulaContent(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 结果集筛选 |
|
|
|
|
*/ |
|
|
|
|
public static final ContentReplacer<SelectCount> SelectCount4TableDataNameContentReplacer = new ContentReplacer<SelectCount>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(SelectCount selectCount, String oldName, String newName) { |
|
|
|
|
selectCount.setFormulaCount(ContentReplaceUtil.replacePureFormula4TableDataName(selectCount.getFormulaCount(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
public static final ContentReplacer<SelectCount> SelectCount4WidgetNameContentReplacer = new ContentReplacer<SelectCount>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(SelectCount selectCount, String oldName, String newName) { |
|
|
|
|
selectCount.setFormulaCount(ContentReplaceUtil.replacePureFormula4WidgetName(selectCount.getFormulaCount(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* tab块标题 |
|
|
|
|
*/ |
|
|
|
|
public static final ContentReplacer<CardSwitchButton> CardSwitchButton4TableDataNameContentReplacer = new ContentReplacer<CardSwitchButton>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(CardSwitchButton cardSwitchButton, String oldName, String newName) { |
|
|
|
|
cardSwitchButton.setText(ContentReplaceUtil.replaceFormulaString4TableDataName(cardSwitchButton.getText(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public static final ContentReplacer<CardSwitchButton> CardSwitchButton4WidgetNameContentReplacer = new ContentReplacer<CardSwitchButton>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(CardSwitchButton cardSwitchButton, String oldName, String newName) { |
|
|
|
|
cardSwitchButton.setText(ContentReplaceUtil.replaceFormulaString4WidgetName(cardSwitchButton.getText(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 悬浮提示 |
|
|
|
|
*/ |
|
|
|
|
public static final ContentReplacer<CellGUIAttr> CellGUIAttr4TableDataNameContentReplacer = new ContentReplacer<CellGUIAttr>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(CellGUIAttr cellGUIAttr, String oldName, String newName) { |
|
|
|
|
cellGUIAttr.setTooltipText(ContentReplaceUtil.replaceFormulaString4TableDataName(cellGUIAttr.getTooltipText(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public static final ContentReplacer<CellGUIAttr> CellGUIAttr4WidgetNameContentReplacer = new ContentReplacer<CellGUIAttr>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(CellGUIAttr cellGUIAttr, String oldName, String newName) { |
|
|
|
|
cellGUIAttr.setTooltipText(ContentReplaceUtil.replaceFormulaString4WidgetName(cellGUIAttr.getTooltipText(), oldName, newName)); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 图表/报表块等标题 |
|
|
|
|
*/ |
|
|
|
|
public static final ContentReplacer<WidgetTitle> WidgetTitle4TableDataNameContentReplacer = new ContentReplacer<WidgetTitle>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(WidgetTitle widgetTitle, String oldName, String newName) { |
|
|
|
|
if (widgetTitle.getTextObject() instanceof String) { |
|
|
|
|
String content = (String) widgetTitle.getTextObject(); |
|
|
|
|
widgetTitle.setTextObject(ContentReplaceUtil.replaceFormulaString4TableDataName(content, oldName, newName)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public static final ContentReplacer<WidgetTitle> WidgetTitle4WidgetNameContentReplacer = new ContentReplacer<WidgetTitle>() { |
|
|
|
|
@Override |
|
|
|
|
public void replace(WidgetTitle widgetTitle, String oldName, String newName) { |
|
|
|
|
if (widgetTitle.getTextObject() instanceof String) { |
|
|
|
|
String content = (String) widgetTitle.getTextObject(); |
|
|
|
|
widgetTitle.setTextObject(ContentReplaceUtil.replaceFormulaString4WidgetName(content, oldName, newName)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|