You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
package com.fr.plugin.sqy.surface.config; |
|
|
|
import com.fr.stable.StringUtils; |
|
import com.fr.stable.xml.XMLPrintWriter; |
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
public class ShowConfig implements ConfigProvider{ |
|
private boolean show; |
|
private String id; |
|
|
|
private ShowConfig(){ |
|
} |
|
|
|
public ShowConfig(String id) { |
|
this.id = id; |
|
} |
|
|
|
public String getId() { |
|
return id; |
|
} |
|
|
|
public boolean isShow() { |
|
return show; |
|
} |
|
|
|
public void setShow(boolean show) { |
|
this.show = show; |
|
} |
|
|
|
private String concatName(String name1,String name2){ |
|
if(StringUtils.isBlank(name2)){ |
|
return name1 + "_" + this.getId(); |
|
} |
|
return name1 + "_" + this.getId() + "_" + name2; |
|
} |
|
|
|
@Override |
|
public void writeAttr(String var1, XMLPrintWriter var2) { |
|
var2.attr(concatName(var1,"show"),this.isShow()); |
|
} |
|
@Override |
|
public void readAttr(String var1, XMLableReader var2) { |
|
this.setShow(var2.getAttrAsBoolean(concatName(var1,"show"),true)); |
|
} |
|
}
|
|
|