• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Outlet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.xpand2.output.Outlet的典型用法代码示例。如果您正苦于以下问题:Java Outlet类的具体用法?Java Outlet怎么用?Java Outlet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Outlet类属于org.eclipse.xpand2.output包,在下文中一共展示了Outlet类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: LazyXpand

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
public LazyXpand(
		HashMap<String, EObject> slotContents, 
		EPackage[] ePackages,
		Outlet[] outlets,
		String expandExpression,
		String encoding
		) {
	this(slotContents,
			ePackages, 
			outlets,
			expandExpression,
			encoding,
			false, 
			false,
			new ArrayList<String>());
}
 
开发者ID:aciancone,项目名称:klapersuite,代码行数:17,代码来源:LazyXpand.java


示例2: factory

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
public static LazyXpand factory(String template, Outlet[] outlets,
		EPackage[] ePackages, HashMap<String, EObject> slots, String encoding) {
	//TODO remove the logging trick to let xpand work
       String value = System.getProperty(LogFactoryImpl.LOG_PROPERTY);
       System.setProperty(LogFactoryImpl.LOG_PROPERTY, "org.apache.commons.logging.impl.NoOpLog");

       LazyXpand job = new LazyXpand(
                       slots, 
                       ePackages, 
                       outlets, 
                       template,
                       encoding);

       //TODO remove the logging trick to let xpand work
       System.setProperty(LogFactoryImpl.LOG_PROPERTY, value);
	return job;
}
 
开发者ID:aciancone,项目名称:klapersuite,代码行数:18,代码来源:LazyXpand.java


示例3: createDtmc2PrismJob

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
private LazyXpand createDtmc2PrismJob(String template, String outputFolder) {
    Outlet[] outlets = new Outlet[1];
    outlets[0] = new Outlet();
    outlets[0].setPath(outputFolder);

    EPackage[] ePackages = { dtmc.DtmcPackage.eINSTANCE };  

    HashMap<String,EObject> slots = new HashMap<String, EObject>();
    slots.put("model", dtmcModel);

    return LazyXpand.factory(
    		template + "::main FOR model",
    		outlets,
    		ePackages,
    		slots,
    		LazyXpand.UTF8_ENCODING);
}
 
开发者ID:aciancone,项目名称:klapersuite,代码行数:18,代码来源:Dtmc2PrismTransformation.java


示例4: updateBuildProperties

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
void updateBuildProperties(XpandExecutionContext ctx) throws Exception {
	if (!updateBuildProperties || modelPluginID != null)
		return;
	Outlet rootOutlet = ctx.getOutput().getOutlet(org.eclipse.xtext.generator.Generator.PLUGIN_RT);
	Outlet modelOutlet = ctx.getOutput().getOutlet(org.eclipse.xtext.generator.Generator.MODEL);
	String buildPropertiesPath = rootOutlet.getPath() + "/build.properties";
	String modelPath = modelOutlet.getPath().substring(rootOutlet.getPath().length() + 1) + "/";
	Properties buildProperties = new Properties();
	Reader reader = new InputStreamReader(new FileInputStream(new File(buildPropertiesPath)), Charset.forName(rootOutlet.getFileEncoding()));
	try {
		String existingContent = CharStreams.toString(reader);
		// for encodign details, see Properties.load
		buildProperties.load(new StringInputStream(existingContent, "ISO-8859-1"));
		String binIncludes = buildProperties.getProperty("bin.includes");
		boolean changed = false;
		if (binIncludes == null) {
			existingContent += "bin.includes = " + modelPath + Strings.newLine()+ "               ";
			changed = true;
		} else if (!binIncludes.contains(modelPath)) {
			existingContent = existingContent.replace("bin.includes = ", "bin.includes = " + modelPath + ",\\" + Strings.newLine() +"               ");
			changed = true;
		}
		if (changed) {
			Writer writer = new OutputStreamWriter(new FileOutputStream(new File(buildPropertiesPath)), Charset.forName(rootOutlet.getFileEncoding()));
			writer.write(existingContent);
			writer.close();
		}
	} finally {
		reader.close();
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:32,代码来源:EMFGeneratorFragment.java


示例5: createOutlet

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected Outlet createOutlet(boolean append, String encoding, String name, boolean overwrite, String path) {
	Outlet outlet = new Outlet(append, encoding, name, overwrite, path);
	outlet.addPostprocessor(new NewlineNormalizer(getLineDelimiter()));
	for (PostProcessor pp : getPostProcessors()) {
		outlet.addPostprocessor(pp);
	}
	return outlet;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:9,代码来源:Generator.java


示例6: generate

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
@Override
public void generate(final Grammar grammar, XpandExecutionContext ctx) {
	final String templateName = getNewProjectTemplateName(grammar, getNaming());
	final Outlet outlet = ctx.getOutput().getOutlet(Generator.SRC_UI);
	final File templateFile = new File(new File(outlet.getPath()), templateName.replaceAll("::", "/") + '.' + XpandUtil.TEMPLATE_EXTENSION);
	final boolean templateExisted = templateFile.exists();
	List<Object> parameters = getParameters(grammar);
	parameters.add(outlet.getFileEncoding());
	XpandFacade.create(ctx).evaluate2(getTemplate()+"::generate", grammar, parameters);
	if (!templateExisted && templateFile.exists()) {
		LOG.info("A new template " + templateName + " has been generated into " + outlet.getPath() + ".");
		LOG.info("  Make sure to enable the Xtend/Xpand nature and JavaBeans metamodel to edit this template.");
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:15,代码来源:SimpleProjectWizardFragment.java


示例7: createOutlet

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
/**
 * Tweaks the generation of the {@link Generator#SRC_GEN Generator.SRC_GEN},
 * {@link Generator#SRC_GEN_IDE Generator.SRC_GEN_IDE}, and
 * {@link Generator#SRC_GEN_UI Generator.SRC_GEN_UI} outlets
 * and injects the {@link #getTmpPath()}.
 */
@Override
protected Outlet createOutlet(final boolean append, final String encoding, final String name, final boolean overwrite, final String path) {
  Outlet _xifexpression = null;
  if (((Objects.equal(name, Generator.SRC_GEN) || Objects.equal(name, Generator.SRC_GEN_IDE)) || Objects.equal(name, Generator.SRC_GEN_UI))) {
    _xifexpression = super.createOutlet(append, encoding, name, overwrite, this.getTmpFolder().getAbsolutePath());
  } else {
    _xifexpression = super.createOutlet(append, encoding, name, overwrite, path);
  }
  return _xifexpression;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:17,代码来源:XtextAntlrGeneratorComparisonFragment.java


示例8: createOutlet

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected Outlet createOutlet(final boolean append, final String encoding, final String name, final boolean overwrite, final String path) {
  final Outlet outlet = new Outlet(append, encoding, name, overwrite, path);
  String _lineDelimiter = this.codeConfig.getLineDelimiter();
  NewlineNormalizer _newlineNormalizer = new NewlineNormalizer(_lineDelimiter);
  outlet.addPostprocessor(_newlineNormalizer);
  for (final PostProcessor pp : this.postProcessors) {
    outlet.addPostprocessor(pp);
  }
  return outlet;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:FragmentAdapter.java


示例9: format

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
/**
 * Format code with PostProcessor (XPand style).
 */
public CharSequence format(String fileName, CharSequence code) {

	// create fileHandle with dummy outlet.
	File file = new File(fileName);
	FileHandle fileHandle = new FileHandleImpl(new Outlet(), file);
	fileHandle.setBuffer(code);

	// call postProcessor for formatting the code.
	csharpBeautifier.beforeWriteAndClose(fileHandle);

	// return formatted results.
	return fileHandle.getBuffer();

}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:18,代码来源:Beautifier.java


示例10: enhanceProject

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
	OutputImpl output = new OutputImpl();
	output.addOutlet(new Outlet(false, getEncoding(), null, true, project.getLocation().makeAbsolute().toOSString()));

	XpandExecutionContextImpl execCtx = new XpandExecutionContextImpl(output, null);
	execCtx.getResourceManager().setFileEncoding("UTF-8");
	execCtx.registerMetaModel(new JavaBeansMetaModel());

	XpandFacade facade = XpandFacade.create(execCtx);
	facade.evaluate("edu::byu::ee::phdl::ui::wizard::PhdlNewProject::main", getProjectInfo());

	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
 
开发者ID:timofonic,项目名称:PHDL,代码行数:14,代码来源:PhdlProjectCreator.java


示例11: setupOAWJob

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected void setupOAWJob(Generator generatorJob) {
	generatorJob.setExpand(expandExpression);
	generatorJob.setFileEncoding(fileEncoding);
	
	for (EPackage p : ePackages) {
		generatorJob.addMetaModel(new EmfMetaModel(p));
	}
	
	String prResolver = "";
	for (Outlet o : outlets) {
		generatorJob.addOutlet(o);
		prResolver += o.getPath() + ",";
	}
	prResolver = prResolver.substring(0,prResolver.length()-1);
	
	if (this.checkProtectedRegions) {
		generatorJob.setPrSrcPaths(prResolver);
		generatorJob.setPrExcludes(".svn");
	}
	
	for (String advice : this.advices) {
		generatorJob.addAdvice(advice);
	}
	
	if (beautifyCode) {
		ArrayList<PostProcessor> beautifier = new ArrayList<PostProcessor>();
		beautifier.add(new JavaBeautifier());
		beautifier.add(new XmlBeautifier());
		generatorJob.setBeautifier(beautifier);
	}
}
 
开发者ID:aciancone,项目名称:klapersuite,代码行数:32,代码来源:LazyXpand.java


示例12: enhanceProject

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
	OutputImpl output = new OutputImpl();
	output.addOutlet(new Outlet(false, getEncoding(), null, true, project.getLocation().makeAbsolute().toOSString()));

	XpandExecutionContextImpl execCtx = new XpandExecutionContextImpl(output, null);
	execCtx.getResourceManager().setFileEncoding("UTF-8");
	execCtx.registerMetaModel(new JavaBeansMetaModel());

	XpandFacade facade = XpandFacade.create(execCtx);
	facade.evaluate("org::xtext::example::hellobuck::ui::wizard::HelloBuckNewProject::main", getProjectInfo());

	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
 
开发者ID:LorenzoBettini,项目名称:Xtext-Xtend-Buckminster-Example,代码行数:14,代码来源:HelloBuckProjectCreator.java


示例13: enhanceProject

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
	OutputImpl output = new OutputImpl();
	output.addOutlet(new Outlet(false, getEncoding(), null, true, project.getLocation().makeAbsolute().toOSString()));

	XpandExecutionContextImpl execCtx = new XpandExecutionContextImpl(output, null);
	execCtx.getResourceManager().setFileEncoding("UTF-8");
	execCtx.registerMetaModel(new JavaBeansMetaModel());

	XpandFacade facade = XpandFacade.create(execCtx);
	facade.evaluate("com::euclideanspace::casl::ui::wizard::EditorNewProject::main", getProjectInfo());

	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
 
开发者ID:martinbaker,项目名称:caslEdit,代码行数:14,代码来源:EditorProjectCreator.java


示例14: enhanceProject

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
	OutputImpl output = new OutputImpl();
	output.addOutlet(new Outlet(false, getEncoding(), null, true, project.getLocation().makeAbsolute().toOSString()));

	XpandExecutionContextImpl execCtx = new XpandExecutionContextImpl(output, null);
	execCtx.getResourceManager().setFileEncoding("UTF-8");
	execCtx.registerMetaModel(new JavaBeansMetaModel());

	XpandFacade facade = XpandFacade.create(execCtx);
	facade.evaluate("com::crubier::lil::ui::wizard::LilNewProject::main", getProjectInfo());

	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
 
开发者ID:crubier,项目名称:lil,代码行数:14,代码来源:LilProjectCreator.java


示例15: enhanceProject

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
protected void enhanceProject(final IProject project, final IProgressMonitor monitor) throws CoreException {
	OutputImpl output = new OutputImpl();
	output.addOutlet(new Outlet(false, getEncoding(), null, true, project.getLocation().makeAbsolute().toOSString()));

	XpandExecutionContextImpl execCtx = new XpandExecutionContextImpl(output, null);
	execCtx.getResourceManager().setFileEncoding("UTF-8");
	execCtx.registerMetaModel(new JavaBeansMetaModel());

	XpandFacade facade = XpandFacade.create(execCtx);
	facade.evaluate("org::example::smalljava::ui::wizard::SmallJavaNewProject::main", getProjectInfo());

	project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
 
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:14,代码来源:SmallJavaProjectCreator.java


示例16: addOutlet

import org.eclipse.xpand2.output.Outlet; //导入依赖的package包/类
/**
 * Used to set outlet SRC_TEST or SRC_TEST_GEN - all other outlets are ignored.
 *
 * @param outlet
 *          the outlet
 */
public void addOutlet(final Outlet outlet) {
  if (METAMODEL_SRC_GEN_OUTLET.equals(outlet.getName())) {
    metamodelSrcGenOulet = outlet;
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:12,代码来源:LanguageConstantsFragment.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MapConfig类代码示例发布时间:2022-05-22
下一篇:
Java HadoopLocationWizard类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap