java getdocument_Java Element.getDocument方法代码示例
import javax.swing.text.Element; //导入方法依赖的package包/类
/**
* Writes out all empty elements (all tags that have no
* corresponding end tag).
*
* @param elem an Element
* @exception IOException on any I/O error
* @exception BadLocationException if pos represents an invalid
* location within the document.
*/
protected void emptyTag(Element elem) throws BadLocationException, IOException {
if (!inContent && !inPre) {
indent();
}
AttributeSet attr = elem.getAttributes();
closeOutUnwantedEmbeddedTags(attr);
writeEmbeddedTags(attr);
if (attr != null && matchNameAttribute(attr, HTML.Tag.CONTENT)) {
inContent = true;
text(elem);
}
else if (attr != null && matchNameAttribute(attr, HTML.Tag.COMMENT)) {
comment(elem);
}
else {
boolean isBlock = isBlockTag(elem.getAttributes());
if (inContent && isBlock) {
writeLineSeparator();
indent();
}
Object nameTag = (attr != null) ? attr.getAttribute(StyleConstants.NameAttribute) : null;
Object endTag = (attr != null) ? attr.getAttribute(HTML.Attribute.ENDTAG) : null;
boolean outputEndTag = false;
// If an instance of an UNKNOWN Tag, or an instance of a
// tag that is only visible during editing
//
if (nameTag != null && endTag != null && (endTag instanceof String) && ((String) endTag).equals("true")) {
outputEndTag = true;
}
if (completeDoc && matchNameAttribute(attr, HTML.Tag.HEAD)) {
if (outputEndTag) {
// Write out any styles.
writeStyles(((HTMLDocument) getDocument()).getStyleSheet());
}
wroteHead = true;
}
write('
if (outputEndTag) {
write('/');
}
write(elem.getName());
writeAttributes(attr);
write('>');
if (attr != null && matchNameAttribute(attr, HTML.Tag.TITLE) && !outputEndTag) {
Document doc = elem.getDocument();
String title = (String) doc.getProperty(Document.TitleProperty);
write(title);
}
else if (!inContent || isBlock) {
writeLineSeparator();
if (isBlock && inContent) {
indent();
}
}
}
}
java getdocument_Java Element.getDocument方法代码示例相关推荐
- java kryo_Kryo框架使用方法代码示例
Kryo框架的source已移至https://github.com/EsotericSoftware/kryo ,进入此页面,然后点击右边的Download Zip按钮,就能下载到最新版本的Kryo ...
- java readtimeout_Java HttpURLConnection.getReadTimeout方法代码示例
import java.net.HttpURLConnection; //导入方法依赖的package包/类 /** * 得到响应对象 * * @param urlConnection * @retu ...
- java invalidate_Java Component.invalidate方法代码示例
import java.awt.Component; //导入方法依赖的package包/类 /** Installs the component we will embed to display t ...
- java hasmoreelements_Java IOException.hasMoreElements方法代码示例
import java.io.IOException; //导入方法依赖的package包/类 /** * fileName���� ���� package �������� ������ ���� ...
- java methode_Java Method.getTypeParameters方法代码示例
import java.lang.reflect.Method; //导入方法依赖的package包/类 private void validateRuleMethod(MethodRuleDefin ...
- java locationuitool_Java JavaUI.getLibraryJavadocLocation方法代码示例
import org.eclipse.jdt.ui.JavaUI; //导入方法依赖的package包/类 /** * Shows the UI for configuring a javadoc l ...
- java setmethod_Java Operation.setJavaMethod方法代码示例
import com.sun.tools.internal.ws.processor.model.Operation; //导入方法依赖的package包/类 private void createJ ...
- java cancel_Java RunnableFuture.cancel方法代码示例
import java.util.concurrent.RunnableFuture; //导入方法依赖的package包/类 @Test public void testSnapshotAsyncC ...
- replaceselection();java'_Java JTextComponent.replaceSelection方法代码示例
import javax.swing.text.JTextComponent; //导入方法依赖的package包/类 public void actionPerformed(final Action ...
最新文章
- 天翼云认证--大纲介绍
- 360全景图three.js
- 实现JavaScript继承
- 10.4 使用instanceof操作符判断对象类型
- linux udp端口大数据包,Linux协议栈中UDP数据报从网卡到用户空间流程总结
- 51 NOD 1227 平均最小公倍数(杜教筛)
- Java如何将指定字符串转化为指定日期格式
- 微软随.NET 4.5发布新REST API框架
- 虽然苏伊士运河大堵塞了,但是全球“玩家”收获了真实的快乐
- 关于Python学习的一点说明
- 机器学习知识点整理(《机器学习》——周志华)
- (二十一) Sed编辑器高级部分
- 华为网络设备-访问控制列表配置实验
- 解决 Unit is masked
- java 调停者模式_[Java教程]《JAVA与模式》之调停者模式
- 黑马淘淘商城第十二天 购物车实现、订单确认页面展示
- 网页制作学习3----实现连缀功能
- STM32 高级定时TIM 死区时间计算--C语言实现
- 字符编码和字符集基础知识
- 小甲鱼课后作业_【第九讲勤思课后作业】二元一次方程组的解法巩固加油站