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

Java XpandFacade类代码示例

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

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



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

示例1: generatePluginXmlRt

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generatePluginXmlRt(List<LanguageConfig> configs, XpandExecutionContext ctx) {
	String filePath = fileExists(ctx, "plugin.xml", PLUGIN_RT) ? "plugin.xml_gen" : "plugin.xml";
	deleteFile(ctx, filePath, PLUGIN_RT);
	ctx.getOutput().openFile(filePath, PLUGIN_RT);
	ctx.getOutput().getOutlet(PLUGIN_RT).addVetoStrategy(new EmptyPluginXmlVeto());
	try {
		XpandFacade facade = XpandFacade.create(ctx);
		List<Grammar> grammars = getGrammars(configs);
		facade.evaluate("org::eclipse::xtext::generator::Plugin::pre", grammars);
		for (LanguageConfig conf : languageConfigs) {
			conf.addToPluginXmlRt(conf, ctx);
			if (isUiMergedIntoRt()) {
				conf.addToPluginXmlUi(conf, ctx);
			}
		}
		facade.evaluate("org::eclipse::xtext::generator::Plugin::post", grammars);
	} finally {
		ctx.getOutput().closeFile();
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:Generator.java


示例2: generatePluginXmlUi

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generatePluginXmlUi(List<LanguageConfig> configs, XpandExecutionContext ctx) {
	if (isUi() && !isUiMergedIntoRt()) {
		String filePath = fileExists(ctx, "plugin.xml", PLUGIN_UI) ? "plugin.xml_gen" : "plugin.xml";
		deleteFile(ctx, filePath, PLUGIN_UI);
		ctx.getOutput().openFile(filePath, PLUGIN_UI);
		try {
			XpandFacade facade = XpandFacade.create(ctx);
			List<Grammar> grammars = getGrammars(configs);
			facade.evaluate("org::eclipse::xtext::generator::Plugin::pre", grammars);
			for (LanguageConfig conf : languageConfigs) {
				conf.addToPluginXmlUi(conf, ctx);
			}
			facade.evaluate("org::eclipse::xtext::generator::Plugin::post", grammars);
		} finally {
			ctx.getOutput().closeFile();
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:19,代码来源:Generator.java


示例3: addToPluginXmlUi

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
@Override
public void addToPluginXmlUi(LanguageConfig config, XpandExecutionContext ctx) {
	Grammar grammar = config.getGrammar();
	List<Object> parameters = newArrayList();
	parameters.addAll(getParameters(grammar));
	parameters.add(config.getFileExtensions(grammar));
	XpandFacade.create(ctx).evaluate2(getTemplate() + "::addToPluginXmlUi", grammar, parameters);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:9,代码来源:GeneratorFragment.java


示例4: generate

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	if (log.isInfoEnabled()) {
		log.info("generating Java-based EValidator API");
	}
	XpandFacade.create(ctx).evaluate2(getTemplate() + "::generate", grammar, getParameters(grammar));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:8,代码来源:JavaValidatorFragment.java


示例5: addToStandaloneSetup

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void addToStandaloneSetup(LanguageConfig config, XpandExecutionContext ctx) {
	ctx.getOutput().openFile(naming.asPath(naming.setupImpl(config.getGrammar())) + ".java", SRC_GEN);
	try {
		XpandFacade facade = XpandFacade.create(ctx);
		facade.evaluate("org::eclipse::xtext::generator::StandaloneSetup::pre", config.getGrammar(), config.getFileExtensions(config.getGrammar()));
		config.addToStandaloneSetup(config, ctx);
		facade.evaluate("org::eclipse::xtext::generator::StandaloneSetup::post", config.getGrammar());
	} finally {
		ctx.getOutput().closeFile();
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:Generator.java


示例6: generateGuiceModuleRt

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generateGuiceModuleRt(LanguageConfig config, XpandExecutionContext ctx) {
	XpandFacade facade = XpandFacade.create(ctx);
	Set<Binding> bindings = config.getGuiceBindingsRt(config.getGrammar());
	String superClassName = config.getDefaultRuntimeModuleClassName(config.getGrammar());
	if (superClassName == null) {
		superClassName = "org.eclipse.xtext.service.DefaultRuntimeModule";
	}
	facade.evaluate("org::eclipse::xtext::generator::GuiceModuleRt::generate", config.getGrammar(), superClassName, bindings,
			config.getFileExtensions(config.getGrammar()));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:Generator.java


示例7: generateGuiceModuleUi

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generateGuiceModuleUi(LanguageConfig config, XpandExecutionContext ctx) {
	if (isUi()) {
		XpandFacade facade = XpandFacade.create(ctx);
		Set<Binding> bindings = config.getGuiceBindingsUi(config.getGrammar());
		String superClassName = config.getDefaultUiModuleClassName(config.getGrammar());
		if (superClassName == null) {
			superClassName = "org.eclipse.xtext.ui.DefaultUiModule";
		}
		facade.evaluate("org::eclipse::xtext::generator::GuiceModuleUi::generate", config.getGrammar(), superClassName, bindings);
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:12,代码来源:Generator.java


示例8: generateManifestRt

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generateManifestRt(List<LanguageConfig> configs, XpandExecutionContext ctx) {
	String manifestPath = "META-INF/MANIFEST.MF";

	Set<String> exported = new LinkedHashSet<String>();
	Set<String> requiredBundles = new LinkedHashSet<String>();
	Set<String> imported = new LinkedHashSet<String>();
	String activator = null;
	if (isUiMergedIntoRt())
		activator = getActivator();
	for (LanguageConfig config : configs) {
		exported.addAll(Arrays.asList(config.getExportedPackagesRt(config.getGrammar())));
		requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesRt(config.getGrammar())));
		imported.addAll(Arrays.asList(config.getImportedPackagesRt(config.getGrammar())));
		if (isUiMergedIntoRt()) {
			exported.addAll(Arrays.asList(config.getExportedPackagesUi(config.getGrammar())));
			imported.addAll(Arrays.asList(config.getImportedPackagesUi(config.getGrammar())));
			requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesUi(config.getGrammar())));
		}
		if (isIdeMergedIntoRt()) {
			exported.addAll(Arrays.asList(config.getExportedPackagesIde(config.getGrammar())));
			imported.addAll(Arrays.asList(config.getImportedPackagesIde(config.getGrammar())));
			requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesIde(config.getGrammar())));
		}
	}
	if (isMergeManifest()) {
		String path = ctx.getOutput().getOutlet(PLUGIN_RT).getPath() + "/" + manifestPath;
		mergeManifest(getProjectNameRt(), path, exported, requiredBundles, imported, activator);
	} else {
		manifestPath = manifestPath + "_gen";
		deleteFile(ctx, manifestPath, PLUGIN_RT);
		ctx.getOutput().openFile(manifestPath, PLUGIN_RT);
		try {
			XpandFacade facade = XpandFacade.create(ctx);
			generateManifest(facade, getProjectNameRt(), getProjectNameRt(), getBundleVersion(), exported,
					requiredBundles, imported, activator);
		} finally {
			ctx.getOutput().closeFile();
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:41,代码来源:Generator.java


示例9: generateManifestUi

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generateManifestUi(List<LanguageConfig> configs, XpandExecutionContext ctx) {
	if (isUi() && !isUiMergedIntoRt()) {
		String manifestPath = "META-INF/MANIFEST.MF";
		Set<String> exported = new LinkedHashSet<String>();
		Set<String> imported = new LinkedHashSet<String>();
		Set<String> requiredBundles = new LinkedHashSet<String>();
		for (LanguageConfig config : languageConfigs) {
			exported.addAll(Arrays.asList(config.getExportedPackagesUi(config.getGrammar())));
			imported.addAll(Arrays.asList(config.getImportedPackagesUi(config.getGrammar())));
			requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesUi(config.getGrammar())));
			if (!isIde()) {
				exported.addAll(Arrays.asList(config.getExportedPackagesIde(config.getGrammar())));
				imported.addAll(Arrays.asList(config.getImportedPackagesIde(config.getGrammar())));
				requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesIde(config.getGrammar())));
			}
		}

		if (isMergeManifest()) {
			String path = ctx.getOutput().getOutlet(PLUGIN_UI).getPath() + "/" + manifestPath;
			mergeManifest(getProjectNameUi(), path, exported, requiredBundles, imported, getActivator());
		} else {
			manifestPath = manifestPath + "_gen";
			deleteFile(ctx, manifestPath, PLUGIN_UI);
			ctx.getOutput().openFile(manifestPath, PLUGIN_UI);
			try {
				XpandFacade facade = XpandFacade.create(ctx);
				generateManifest(facade, getProjectNameUi(), getProjectNameUi(), getBundleVersion(), exported,
						requiredBundles, imported, getActivator());
			} finally {
				ctx.getOutput().closeFile();
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:35,代码来源:Generator.java


示例10: generateManifestIde

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generateManifestIde(List<LanguageConfig> configs, XpandExecutionContext ctx) {
	if (isIde() && !isIdeMergedIntoRt() ) {
		String manifestPath = "META-INF/MANIFEST.MF";
		Set<String> exported = new LinkedHashSet<String>();
		Set<String> imported = new LinkedHashSet<String>();
		Set<String> requiredBundles = new LinkedHashSet<String>();
		for (LanguageConfig config : languageConfigs) {
			exported.addAll(Arrays.asList(config.getExportedPackagesIde(config.getGrammar())));
			imported.addAll(Arrays.asList(config.getImportedPackagesIde(config.getGrammar())));
			requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesIde(config.getGrammar())));
		}

		if (isMergeManifest()) {
			String path = ctx.getOutput().getOutlet(PLUGIN_IDE).getPath() + "/" + manifestPath;
			mergeManifest(getProjectNameIde(), path, exported, requiredBundles, imported, null);
		} else {
			manifestPath = manifestPath + "_gen";
			deleteFile(ctx, manifestPath, PLUGIN_IDE);
			ctx.getOutput().openFile(manifestPath, PLUGIN_IDE);
			try {
				XpandFacade facade = XpandFacade.create(ctx);
				generateManifest(facade, getProjectNameIde(), getProjectNameIde(), getBundleVersion(), exported,
						requiredBundles, imported, null);
			} finally {
				ctx.getOutput().closeFile();
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:30,代码来源:Generator.java


示例11: generateManifestTests

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
private void generateManifestTests(List<LanguageConfig> configs, XpandExecutionContext ctx) {
	if (isTest()) {
		String manifestPath = "META-INF/MANIFEST.MF";
		Set<String> exported = new LinkedHashSet<String>();
		Set<String> imported = new LinkedHashSet<String>();
		Set<String> requiredBundles = new LinkedHashSet<String>();
		for (LanguageConfig config : languageConfigs) {
			exported.addAll(Arrays.asList(config.getExportedPackagesTests(config.getGrammar())));
			imported.addAll(Arrays.asList(config.getImportedPackagesTests(config.getGrammar())));
			requiredBundles.addAll(Arrays.asList(config.getRequiredBundlesTests(config.getGrammar())));
		}

		if (isMergeManifest()) {
			String path = ctx.getOutput().getOutlet(PLUGIN_TEST).getPath() + "/" + manifestPath;
			mergeManifest(getProjectNameTests(), path, exported, requiredBundles, imported, null);
		} else {
			manifestPath = manifestPath + "_gen";
			deleteFile(ctx, manifestPath, PLUGIN_TEST);
			ctx.getOutput().openFile(manifestPath, PLUGIN_TEST);
			try {
				XpandFacade facade = XpandFacade.create(ctx);
				generateManifest(facade, getProjectNameTests(), getProjectNameTests(), getBundleVersion(),
						exported, requiredBundles, imported, getActivator());
			} finally {
				ctx.getOutput().closeFile();
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:30,代码来源:Generator.java


示例12: generate

import org.eclipse.xpand2.XpandFacade; //导入依赖的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


示例13: generate

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void generate(final Grammar grammar, final XpandExecutionContext ctx) {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info(NLS.bind(Messages.EXECUTING_GENERATE, getClass().getName()));
  }

  ValidStandaloneSetup.doSetup();

  final ValidModel validModel = getValidModel(grammar);
  grammar.eResource().getResourceSet().getResources().add(validModel.eResource());
  grammar.eResource().getResourceSet().getResources().add(validModel.getImports().get(0).eResource());

  // profile for generator is:
  // <<DEFINE generate(List[String] packageQNames, List[String] composedChecks, ValidModel validModel) FOR Grammar>>
  XpandFacade.create(ctx).evaluate(getTemplate() + "::generate", // template //$NON-NLS-1$
  grammar, // this (the grammar)
  getParameters(grammar).get(0), // package Qualified Names (first parameter of the argument list is the 'list of
                                 // packages')
  this.composedChecks, // composed checks
  validModel); // validModel

  if (generateTests) {
    XpandFacade.create(ctx).evaluate("com::avaloq::tools::ddk::xtext::valid::generator::ValidatorTests::generate", // template //$NON-NLS-1$
    grammar, // this (the grammar)
    validModel); // validModel
    XpandFacade.create(ctx).evaluate("com::avaloq::tools::ddk::xtext::valid::generator::QuickfixTests::generate", // template //$NON-NLS-1$
    grammar, // this (the grammar)
    validModel); // validModel
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:32,代码来源:ValidValidatorFragment.java


示例14: enhanceProject

import org.eclipse.xpand2.XpandFacade; //导入依赖的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


示例15: enhanceProject

import org.eclipse.xpand2.XpandFacade; //导入依赖的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


示例16: enhanceProject

import org.eclipse.xpand2.XpandFacade; //导入依赖的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


示例17: enhanceProject

import org.eclipse.xpand2.XpandFacade; //导入依赖的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


示例18: enhanceProject

import org.eclipse.xpand2.XpandFacade; //导入依赖的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


示例19: generate

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
@Override
public void generate(Grammar grammar, XpandExecutionContext ctx) {
	XpandFacade.create(ctx).evaluate2(getTemplate() + "::generate", grammar, getParameters(grammar));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:5,代码来源:AbstractGeneratorFragment.java


示例20: addToPluginXmlRt

import org.eclipse.xpand2.XpandFacade; //导入依赖的package包/类
@Override
public void addToPluginXmlRt(Grammar grammar, XpandExecutionContext ctx) {
	XpandFacade.create(ctx).evaluate2(getTemplate() + "::addToPluginXmlRt", grammar, getParameters(grammar));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:5,代码来源:AbstractGeneratorFragment.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Binding类代码示例发布时间:2022-05-22
下一篇:
Java GroupPrincipal类代码示例发布时间: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