org.eclipse.xtext.formatting2.FormatterPreferences Java Examples

The following examples show how to use org.eclipse.xtext.formatting2.FormatterPreferences. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Formatter2Fragment.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
	StringBuilder cfg = new StringBuilder();
	cfg.append("binder.bind(");
	cfg.append(IPreferenceValuesProvider.class.getName());
	cfg.append(".class)");
	cfg.append(".annotatedWith(");
	cfg.append(FormatterPreferences.class.getName());
	cfg.append(".class)");
	cfg.append(".to(");
	cfg.append(FormatterPreferenceValuesProvider.class.getName());
	cfg.append(".class);");
	BindFactory bf = new BindFactory();
	bf.addTypeToType(IFormatter2.class.getName(), stubGenerator.getStubQualifiedName());
	bf.addConfiguredBinding(FormatterPreferences.class.getName(), cfg.toString());
	return bf.getBindings();
}
 
Example #2
Source File: N4JSRuntimeModule.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/** Configures the formatter preference value provider */
@Override
public void configureFormatterPreferences(Binder binder) {
	binder
			.bind(IPreferenceValuesProvider.class)
			.annotatedWith(FormatterPreferences.class)
			.to(N4JSSimpleFormattingPreferenceProvider.class);
}
 
Example #3
Source File: Formatter2Fragment2.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void generate() {
  boolean _isGenerateStub = this.isGenerateStub();
  boolean _not = (!_isGenerateStub);
  if (_not) {
    return;
  }
  StringConcatenationClient _client = new StringConcatenationClient() {
    @Override
    protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
      _builder.append("binder.bind(");
      _builder.append(IPreferenceValuesProvider.class);
      _builder.append(".class).annotatedWith(");
      _builder.append(FormatterPreferences.class);
      _builder.append(".class).to(");
      _builder.append(FormatterPreferenceValuesProvider.class);
      _builder.append(".class);");
    }
  };
  final StringConcatenationClient statement = _client;
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(IFormatter2.class), this.getFormatter2Stub(this.getLanguage().getGrammar())).addConfiguredBinding(FormatterPreferences.class.getSimpleName(), statement).contributeTo(this.getLanguage().getRuntimeGenModule());
  new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.editor.formatting.IContentFormatterFactory"), 
    TypeReference.typeRef("org.eclipse.xtext.ui.editor.formatting2.ContentFormatterFactory")).contributeTo(this.getLanguage().getEclipsePluginGenModule());
  ManifestAccess _manifest = this.getProjectConfig().getRuntime().getManifest();
  boolean _tripleNotEquals = (_manifest != null);
  if (_tripleNotEquals) {
    Set<String> _exportedPackages = this.getProjectConfig().getRuntime().getManifest().getExportedPackages();
    String _runtimeBasePackage = this._xtextGeneratorNaming.getRuntimeBasePackage(this.getGrammar());
    String _plus = (_runtimeBasePackage + ".formatting2");
    _exportedPackages.add(_plus);
  }
  this.doGenerateStubFile();
}
 
Example #4
Source File: AbstractDomainmodelRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #5
Source File: AbstractSARLRuntimeModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #6
Source File: AbstractNoJdtTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #7
Source File: AbstractExBeeLangTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #8
Source File: AbstractBeeLangTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #9
Source File: AbstractSimpleBeeLangTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #10
Source File: AbstractFileAwareTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #11
Source File: AbstractPartialSerializationTestLanguageRuntimeModule.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #12
Source File: AbstractXtendRuntimeModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #13
Source File: AbstractRuleEngineRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #14
Source File: AbstractStatemachineRuntimeModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #15
Source File: AbstractTypeExpressionsRuntimeModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #16
Source File: AbstractEntitiesRuntimeModule.java    From xtext-web with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #17
Source File: AbstractStatemachineRuntimeModule.java    From xtext-web with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #18
Source File: AbstractXtypeRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #19
Source File: AbstractXbaseWithAnnotationsRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #20
Source File: AbstractXbaseRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #21
Source File: AbstractPureXbaseRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #22
Source File: AbstractJSONRuntimeModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
 
Example #23
Source File: AbstractN4JSRuntimeModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public void configureFormatterPreferences(Binder binder) {
	binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}