hades
4 years ago
7 changed files with 123 additions and 0 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.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,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