當前位置: 首頁>>代碼示例>>Java>>正文


Java BindFactory.addConfiguredBinding方法代碼示例

本文整理匯總了Java中org.eclipse.xtext.generator.BindFactory.addConfiguredBinding方法的典型用法代碼示例。如果您正苦於以下問題:Java BindFactory.addConfiguredBinding方法的具體用法?Java BindFactory.addConfiguredBinding怎麽用?Java BindFactory.addConfiguredBinding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.xtext.generator.BindFactory的用法示例。


在下文中一共展示了BindFactory.addConfiguredBinding方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	BindFactory factory = new BindFactory();
	if (!XbaseGeneratorFragment.doesUseXbase(grammar)) {
		if(isGenerateStub) {
			factory.addTypeToType(IScopeProvider.class.getName(), getScopeProviderName(grammar, getNaming()));
		} else {
			factory.addTypeToType(IScopeProvider.class.getName(), getLocalScopeProvider().getName());
		}
		factory.addConfiguredBinding(
				IScopeProvider.class.getName() + "Delegate",
				"binder.bind(" + IScopeProvider.class.getName() + ".class"
						+ ").annotatedWith(com.google.inject.name.Names.named("
						+ AbstractDeclarativeScopeProvider.class.getName() + ".NAMED_DELEGATE" + ")).to("
						+ getLocalScopeProvider().getName() + ".class)");
		factory.addTypeToType(IGlobalScopeProvider.class.getName(), getGlobalScopeProvider().getName());
	}
	factory.addConfiguredBinding(IgnoreCaseLinking.class.getSimpleName(), "binder.bindConstant().annotatedWith("
			+ IgnoreCaseLinking.class.getName() + ".class).to(" + isIgnoreCase() + ")");
	return factory.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:22,代碼來源:AbstractScopingFragment.java

示例2: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bind = new BindFactory();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class)");
    _builder.newLine();
    _builder.append(".annotatedWith(com.google.inject.name.Names.named(\"taskTagPreferenceInitializer\"))");
    _builder.newLine();
    _builder.append(".to(org.eclipse.xtext.ui.tasks.preferences.TaskTagPreferenceInitializer.class)");
    _builder.newLine();
    bind.addConfiguredBinding(
      "TaskTagPreferenceStoreInitializer", _builder.toString());
    _xblockexpression = bind.getBindings();
  }
  return _xblockexpression;
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:19,代碼來源:TaskTagPreferencePageFragment.java

示例3: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final StringBuilder cfg = new StringBuilder();
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("binder.bind(");
  String _name = IPreferenceValuesProvider.class.getName();
  _builder.append(_name);
  _builder.append(".class)");
  cfg.append(_builder);
  StringConcatenation _builder_1 = new StringConcatenation();
  _builder_1.append(".annotatedWith(");
  String _name_1 = FormatterPreferences.class.getName();
  _builder_1.append(_name_1);
  _builder_1.append(".class)");
  cfg.append(_builder_1);
  StringConcatenation _builder_2 = new StringConcatenation();
  _builder_2.append(".to(");
  String _name_2 = FormatterPreferenceValuesProvider.class.getName();
  _builder_2.append(_name_2);
  _builder_2.append(".class);");
  cfg.append(_builder_2);
  final BindFactory bf = new BindFactory();
  bf.addTypeToType(IFormatter2.class.getName(), this.stubGenerator.getStubQualifiedName());
  bf.addConfiguredBinding(FormatterPreferences.class.getName(), cfg.toString());
  return bf.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:27,代碼來源:Formatter2Fragment.java

示例4: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  final Set<Binding> bindings = super.getGuiceBindingsUi(grammar);
  final BindFactory factory = new BindFactory();
  factory.addConfiguredBinding(IResourceDescriptions.class.getName() + "BuilderScope", "binder.bind(" + IResourceDescriptions.class.getName() + ".class"
      + ").annotatedWith(com.google.inject.name.Names.named(" + ResourceDescriptionsProvider.class.getName() + ".NAMED_BUILDER_SCOPE)).to("
      + "com.avaloq.tools.ddk.xtext.builder.CurrentDescriptions2.ResourceSetAware.class)");
  final Set<Binding> result = factory.getBindings();
  result.addAll(bindings);
  return result;
}
 
開發者ID:dsldevkit,項目名稱:dsl-devkit,代碼行數:13,代碼來源:BuilderIntegrationFragment.java

示例5: getGuiceBindingsRt

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	if (!usesXbaseGrammar(grammar))
		return emptySet();
	BindFactory config = new BindFactory()
					
			// overrides binding from org.eclipse.xtext.generator.exporting.QualifiedNamesFragment
			.addTypeToType(IQualifiedNameProvider.class.getName(),
							"org.eclipse.xtext.xbase.scoping.XbaseQualifiedNameProvider");
			
	if (useInferredJvmModel) {
		config = config
				.addTypeToType(ILocationInFileProvider.class.getName(),
						"org.eclipse.xtext.xbase.jvmmodel.JvmLocationInFileProvider")
				.addTypeToType(IGlobalScopeProvider.class.getName(),
						"org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider")
				.addTypeToType("org.eclipse.xtext.xbase.validation.FeatureNameValidator",
						"org.eclipse.xtext.xbase.validation.LogicalContainerAwareFeatureNameValidator")
				.addTypeToType("org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver",
						"org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareBatchTypeResolver")
				.addTypeToType("org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver",
						"org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver")
				.addTypeToType(IResourceValidator.class.getCanonicalName(), 
						"org.eclipse.xtext.xbase.annotations.validation.DerivedStateAwareResourceValidator");
		if(generateXtendInferrer) {
			config = config
				.addTypeToType("org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer",
					getJvmModelInferrerName(grammar, getNaming()));
		}
	} else {
		config = config
				.addTypeToType(ILocationInFileProvider.class.getName(),
							"org.eclipse.xtext.xbase.resource.XbaseLocationInFileProvider");

	}
	if (usesXImportSection(grammar)) {
		config = config.addConfiguredBinding(
				IScopeProvider.class.getName() + "Delegate",
				"binder.bind("
						+ IScopeProvider.class.getName()
						+ ".class).annotatedWith(com.google.inject.name.Names.named("
						+ AbstractDeclarativeScopeProvider.class.getName()
						+ ".NAMED_DELEGATE)).to("+ getImportScopeProvider(grammar)+")");
	}
	return config.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:47,代碼來源:XbaseGeneratorFragment.java

示例6: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
	BindFactory binder = new BindFactory();
	if(getNaming().hasIde()){
		binder.addTypeToType(
				"org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext.Factory",
				"org.eclipse.xtext.ui.editor.contentassist.antlr.DelegatingContentAssistContextFactory")
		.addTypeToType(
				"org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser",
				getFragmentHelper().getContentAssistParserClassName(grammar));
	} else {
		binder.addTypeToType(
				"org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext.Factory",
				"org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory")
		.addTypeToType(
				"org.eclipse.xtext.ui.editor.contentassist.antlr.IContentAssistParser",
				getFragmentHelper().getContentAssistParserClassName(grammar));
	}
	binder.addConfiguredBinding("ContentAssistLexerProvider",
			"binder.bind(" + getFragmentHelper().getInternalContentAssistLexerClassName(grammar) +".class)"+
			".toProvider(org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getFragmentHelper().getInternalContentAssistLexerClassName(grammar) + ".class))");
	if(getNaming().hasIde()){
		binder.addConfiguredBinding("ContentAssistLexer",
				"binder.bind(org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer.class)"+
				".annotatedWith(com.google.inject.name.Names.named(" +
				"org.eclipse.xtext.ide.LexerIdeBindings.CONTENT_ASSIST" +
				")).to(" + getFragmentHelper().getInternalContentAssistLexerClassName(grammar) +".class)");
	} else {
		binder.addConfiguredBinding("ContentAssistLexer",
				"binder.bind(org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.class)"+
				".annotatedWith(com.google.inject.name.Names.named(" +
				"org.eclipse.xtext.ui.LexerUIBindings.CONTENT_ASSIST" +
				")).to(" + getFragmentHelper().getInternalContentAssistLexerClassName(grammar) +".class)");
	}
	if (partialParsing) {
		if(getNaming().hasIde()){
			binder.addTypeToType(
				"org.eclipse.xtext.ide.editor.contentassist.antlr.ContentAssistContextFactory", 
				"org.eclipse.xtext.ide.editor.contentassist.antlr.PartialContentAssistContextFactory");
		} else {
			binder.addTypeToType(
				"org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.StatefulFactory", 
				"org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.PartialStatefulFactory");
		}
	}
	return binder.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:48,代碼來源:ContentAssistParserGeneratorFragment.java

示例7: getGuiceBindingsUi

import org.eclipse.xtext.generator.BindFactory; //導入方法依賴的package包/類
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
	BindFactory binder = new BindFactory();
		if(getNaming().hasIde()){
			binder.addTypeToType(
					"org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext.Factory",
					"org.eclipse.xtext.ui.editor.contentassist.antlr.DelegatingContentAssistContextFactory");
			binder.addTypeToType(
					"org.eclipse.xtext.ide.editor.contentassist.antlr.IContentAssistParser",
					getParserClassName(grammar, getNaming()));
		} else {
			binder.addTypeToType(
					"org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext.Factory",
					"org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory");
			binder.addTypeToType(
					"org.eclipse.xtext.ui.editor.contentassist.antlr.IContentAssistParser",
					getParserClassName(grammar, getNaming()));
		}
		binder.addConfiguredBinding("ContentAssistLexerProvider",
				"binder.bind(" + getInternalLexerClassName(grammar, getNaming()) +".class)"+
				".toProvider(org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getInternalLexerClassName(grammar, getNaming()) + ".class))");
		if(getNaming().hasIde()){
			binder.addConfiguredBinding("ContentAssistLexer",
					"binder.bind(org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer.class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ide.LexerIdeBindings.CONTENT_ASSIST" +
					")).to(" + getInternalLexerClassName(grammar, getNaming()) +".class)");
		} else {
			binder.addConfiguredBinding("ContentAssistLexer",
					"binder.bind(org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.class)"+
					".annotatedWith(com.google.inject.name.Names.named(" +
					"org.eclipse.xtext.ui.LexerUIBindings.CONTENT_ASSIST" +
					")).to(" + getInternalLexerClassName(grammar, getNaming()) +".class)");
		}
	if (partialParsing) {
		if(getNaming().hasIde()){
			binder.addTypeToType(
				"org.eclipse.xtext.ide.editor.contentassist.antlr.ContentAssistContextFactory", 
				"org.eclipse.xtext.ide.editor.contentassist.antlr.PartialContentAssistContextFactory");
		} else {
			binder.addTypeToType(
				 "org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.StatefulFactory", 
				 "org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.PartialStatefulFactory");
		}
	}
	return binder.getBindings();
}
 
開發者ID:eclipse,項目名稱:xtext-extras,代碼行數:48,代碼來源:XtextAntlrUiGeneratorFragment.java


注:本文中的org.eclipse.xtext.generator.BindFactory.addConfiguredBinding方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。