forked from fanruan/design
hades
4 years ago
4 changed files with 58 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.FormHyperlinkContentReplacer; |
||||||
|
import com.fr.form.main.FormHyperlink; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2021/6/2 |
||||||
|
*/ |
||||||
|
public class FormHyperlinkContentChange implements ContentChange<FormHyperlink> { |
||||||
|
|
||||||
|
private final Map<ChangeItem, ContentReplacer<FormHyperlink>> map; |
||||||
|
|
||||||
|
public FormHyperlinkContentChange() { |
||||||
|
map = new HashMap<>(); |
||||||
|
map.put(ChangeItem.WIDGET_NAME, new FormHyperlinkContentReplacer()); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String type() { |
||||||
|
return FormHyperlink.class.getName(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Map<ChangeItem, ContentReplacer<FormHyperlink>> changeInfo() { |
||||||
|
return map; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.design.mod.impl.repalce; |
||||||
|
|
||||||
|
import com.fr.design.mod.ContentReplacer; |
||||||
|
import com.fr.form.main.FormHyperlink; |
||||||
|
import com.fr.general.ComparatorUtils; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2021/6/2 |
||||||
|
*/ |
||||||
|
public class FormHyperlinkContentReplacer implements ContentReplacer<FormHyperlink> { |
||||||
|
|
||||||
|
@Override |
||||||
|
public void replace(FormHyperlink formHyperlink, String oldName, String newName) { |
||||||
|
if (ComparatorUtils.equals(formHyperlink.getRelateEditorName(), oldName)) { |
||||||
|
formHyperlink.setRelateEditorName(newName); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue