forked from fanruan/finekit
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.
64 lines
1.7 KiB
64 lines
1.7 KiB
package com.fanruan.api.report.form.category; |
|
|
|
import com.fanruan.api.report.form.BaseWidget; |
|
import com.fanruan.api.report.form.describer.TextDescriber; |
|
import com.fanruan.api.util.ArrayKit; |
|
import com.fanruan.api.xml.XmlKit; |
|
import com.fr.stable.script.CalculatorProvider; |
|
import com.fr.stable.xml.XMLPrintWriter; |
|
import com.fr.stable.xml.XMLableReader; |
|
|
|
/** |
|
* @author richie |
|
* @version 10.0 |
|
* Created by richie on 2019-09-10 |
|
*/ |
|
public abstract class TextWidget extends BaseWidget { |
|
|
|
private TextDescriber textDescriber; |
|
|
|
/** |
|
* 获取联动参数 |
|
* |
|
* @param c 当前算子 |
|
* @return 放回当前控件依赖的参数 |
|
*/ |
|
public String[] dependence(CalculatorProvider c) { |
|
return ArrayKit.EMPTY_STRING_ARRAY; |
|
} |
|
|
|
/** |
|
* 获取支持的事件 |
|
* |
|
* @return 当前控件支持的事件 |
|
*/ |
|
public String[] supportedEvents() { |
|
return new String[]{AFTERINIT, BEFOREEDIT, AFTEREDIT, STOPEDIT}; |
|
} |
|
|
|
@Override |
|
public void readXML(XMLableReader reader) { |
|
if (reader.isChildNode()) { |
|
String tagName = reader.getTagName(); |
|
if (TextDescriber.XML_TAG.equals(tagName)) { |
|
textDescriber = (TextDescriber) XmlKit.readXMLable(reader); |
|
} |
|
} |
|
} |
|
|
|
@Override |
|
public void writeXML(XMLPrintWriter writer) { |
|
if (textDescriber != null) { |
|
XmlKit.writeXMLable(writer, textDescriber, TextDescriber.XML_TAG); |
|
} |
|
} |
|
|
|
@Override |
|
public Object clone() throws CloneNotSupportedException { |
|
TextWidget cloned = (TextWidget) super.clone(); |
|
if (textDescriber != null) { |
|
cloned.textDescriber = (TextDescriber) textDescriber.clone(); |
|
} |
|
return cloned; |
|
} |
|
}
|
|
|