Browse Source
Merge in DESIGN/design from ~HADES/design:feature/10.0 to feature/10.0 * commit 'a83d2616adcabee00396391e1003d4cbb25644e8': REPORT-53157 【智能联动】组件拖入时,单元格位置引用数据集的地方未修改 REPORT-53156 【智能联动】组件拖入时,控件引用模板数据集的地方没有发生替换feature/10.0
Hades
4 years ago
9 changed files with 178 additions and 1 deletions
@ -0,0 +1,34 @@
|
||||
package com.fr.design.mod.impl.change; |
||||
|
||||
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.DSColumnContentReplacer; |
||||
import com.fr.report.cell.cellattr.core.group.DSColumn; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class DSColumnContentChange implements ContentChange<DSColumn> { |
||||
|
||||
private final Map<ChangeItem, ContentReplacer<DSColumn>> map; |
||||
|
||||
public DSColumnContentChange() { |
||||
map = new HashMap<>(); |
||||
map.put(ChangeItem.TABLE_DATA_NAME, new DSColumnContentReplacer()); |
||||
} |
||||
|
||||
@Override |
||||
public String type() { |
||||
return DSColumn.class.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Map<ChangeItem, ContentReplacer<DSColumn>> changeInfo() { |
||||
return map; |
||||
} |
||||
} |
@ -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; |
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
package com.fr.design.mod.impl.change; |
||||
|
||||
import com.fr.data.SimpleDSColumn; |
||||
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.SimpleDSColumnContentReplacer; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class SimpleDSColumnContentChange implements ContentChange<SimpleDSColumn> { |
||||
|
||||
private Map<ChangeItem, ContentReplacer<SimpleDSColumn>> map; |
||||
|
||||
public SimpleDSColumnContentChange() { |
||||
map = new HashMap<>(); |
||||
map.put(ChangeItem.TABLE_DATA_NAME, new SimpleDSColumnContentReplacer()); |
||||
} |
||||
|
||||
@Override |
||||
public String type() { |
||||
return SimpleDSColumn.class.getName(); |
||||
} |
||||
|
||||
@Override |
||||
public Map<ChangeItem, ContentReplacer<SimpleDSColumn>> changeInfo() { |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.mod.impl.repalce; |
||||
|
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.general.ComparatorUtils; |
||||
import com.fr.report.cell.cellattr.core.group.DSColumn; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class DSColumnContentReplacer implements ContentReplacer<DSColumn> { |
||||
|
||||
@Override |
||||
public void replace(DSColumn dsColumn, String oldName, String newName) { |
||||
if (ComparatorUtils.equals(dsColumn.getDSName(), oldName)) { |
||||
dsColumn.setDSName(newName); |
||||
} |
||||
} |
||||
} |
@ -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); |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.mod.impl.repalce; |
||||
|
||||
import com.fr.data.SimpleDSColumn; |
||||
import com.fr.design.mod.ContentReplacer; |
||||
import com.fr.general.ComparatorUtils; |
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2021/6/2 |
||||
*/ |
||||
public class SimpleDSColumnContentReplacer implements ContentReplacer<SimpleDSColumn> { |
||||
|
||||
@Override |
||||
public void replace(SimpleDSColumn simpleDSColumn, String oldName, String newName) { |
||||
if (ComparatorUtils.equals(simpleDSColumn.getDsName(), oldName)) { |
||||
simpleDSColumn.setDsName(newName); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue