当前位置: 首页>>代码示例>>Java>>正文


Java Element.getContentSize方法代码示例

本文整理汇总了Java中org.jdom.Element.getContentSize方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getContentSize方法的具体用法?Java Element.getContentSize怎么用?Java Element.getContentSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdom.Element的用法示例。


在下文中一共展示了Element.getContentSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writePluginJpf

import org.jdom.Element; //导入方法依赖的package包/类
@SuppressWarnings("nls")
private void writePluginJpf(IProgressMonitor monitor, IProject project) throws CoreException
{
	Document doc = new Document();
	doc.setDocType(new DocType("plugin", "-//JPF//Java Plug-in Manifest 1.0",
		"http://jpf.sourceforge.net/plugin_1_0.dtd"));
	Element rootElem = new Element("plugin");
	doc.setRootElement(rootElem);
	rootElem.setAttribute("id", project.getName());
	rootElem.setAttribute("version", "1");
	Element requires = new Element("requires");
	rootElem.addContent(requires);
	Element runtime = new Element("runtime");
	Element srcLib = new Element("library");
	srcLib.setAttribute("type", "code");
	srcLib.setAttribute("path", "classes/");
	srcLib.setAttribute("id", "classes");
	Element export = new Element("export");
	export.setAttribute("prefix", "*");
	srcLib.addContent(export);
	runtime.addContent(srcLib);
	rootElem.addContent(runtime);
	fFirstPage.customizeManifest(rootElem, project, monitor);
	if( requires.getContentSize() == 0 )
	{
		rootElem.removeContent(requires);
	}

	IFile manifest = JPFProject.getManifest(project);
	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	try
	{
		xmlOut.output(doc, baos);
	}
	catch( IOException e )
	{
		throw new RuntimeException(e);
	}
	manifest.create(new ByteArrayInputStream(baos.toByteArray()), true, monitor);
}
 
开发者ID:equella,项目名称:Equella,代码行数:41,代码来源:NewPluginWizard.java


注:本文中的org.jdom.Element.getContentSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。