Browse Source

REPORT-53156 【智能联动】组件拖入时,控件引用模板数据集的地方没有发生替换

feature/10.0
hades 3 years ago
parent
commit
e1ba505b50
  1. 3
      designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java
  2. 2
      designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java
  3. 34
      designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java
  4. 17
      designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java

3
designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java

@ -3,7 +3,7 @@ package com.fr.design.mod;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.file.filter.ClassFilter; import com.fr.data.impl.NameTableData;
import com.fr.invoke.ClassHelper; import com.fr.invoke.ClassHelper;
import com.fr.js.JavaScriptImpl; import com.fr.js.JavaScriptImpl;
import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.plugin.chart.base.VanChartHtmlLabel;
@ -41,6 +41,7 @@ public class ContentObjectManager {
set.add(ChartHyperRelateCellLink.class.getName()); set.add(ChartHyperRelateCellLink.class.getName());
set.add(ChartHyperRelateFloatLink.class.getName()); set.add(ChartHyperRelateFloatLink.class.getName());
set.add(VanChartHtmlLabel.class.getName()); set.add(VanChartHtmlLabel.class.getName());
set.add(NameTableData.class.getName());
} }
public void searchObject(Object ob) { public void searchObject(Object ob) {

2
designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java

@ -8,6 +8,7 @@ import com.fr.design.mod.impl.change.ChartHyperRelateCellLinkContentChange;
import com.fr.design.mod.impl.change.ChartHyperRelateFloatLinkContentChange; import com.fr.design.mod.impl.change.ChartHyperRelateFloatLinkContentChange;
import com.fr.design.mod.impl.change.FormulaContentChange; import com.fr.design.mod.impl.change.FormulaContentChange;
import com.fr.design.mod.impl.change.JavaScriptContentChange; import com.fr.design.mod.impl.change.JavaScriptContentChange;
import com.fr.design.mod.impl.change.NameTableDataContentChange;
import com.fr.design.mod.impl.change.VanChartHtmlLabelContentChange; import com.fr.design.mod.impl.change.VanChartHtmlLabelContentChange;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
@ -73,6 +74,7 @@ public class ContentReplacerCenter {
contentChangeList.add(new FormulaContentChange()); contentChangeList.add(new FormulaContentChange());
contentChangeList.add(new JavaScriptContentChange()); contentChangeList.add(new JavaScriptContentChange());
contentChangeList.add(new VanChartHtmlLabelContentChange()); contentChangeList.add(new VanChartHtmlLabelContentChange());
contentChangeList.add(new NameTableDataContentChange());
} }
private void onRename(List<ContentChangeItem> contentChangeItemList, List<ContentChange> contentChangeList) { private void onRename(List<ContentChangeItem> contentChangeItemList, List<ContentChange> contentChangeList) {

34
designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java

@ -0,0 +1,34 @@
package com.fr.design.mod.impl.change;
import com.fr.data.impl.NameTableData;
import com.fr.design.mod.ContentChange;
import com.fr.design.mod.ContentReplacer;
import com.fr.design.mod.bean.ChangeItem;
import com.fr.design.mod.impl.repalce.NameTableDataContentReplacer;
import java.util.HashMap;
import java.util.Map;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class NameTableDataContentChange implements ContentChange<NameTableData> {
private final Map<ChangeItem, ContentReplacer<NameTableData>> map;
public NameTableDataContentChange() {
map = new HashMap<>();
map.put(ChangeItem.TABLE_DATA_NAME, new NameTableDataContentReplacer());
}
@Override
public String type() {
return NameTableData.class.getName();
}
@Override
public Map<ChangeItem, ContentReplacer<NameTableData>> changeInfo() {
return map;
}
}

17
designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java

@ -0,0 +1,17 @@
package com.fr.design.mod.impl.repalce;
import com.fr.data.impl.NameTableData;
import com.fr.design.mod.ContentReplacer;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/6/2
*/
public class NameTableDataContentReplacer implements ContentReplacer<NameTableData> {
@Override
public void replace(NameTableData nameTableData, String oldName, String newName) {
nameTableData.rename(oldName, newName);
}
}
Loading…
Cancel
Save