本文整理汇总了Java中org.eclipse.xtext.formatting2.IFormatter2类的典型用法代码示例。如果您正苦于以下问题:Java IFormatter2类的具体用法?Java IFormatter2怎么用?Java IFormatter2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFormatter2类属于org.eclipse.xtext.formatting2包,在下文中一共展示了IFormatter2类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getGuiceBindingsRt
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的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
示例2: format2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
protected List<ITextReplacement> format2(final XtextResource resource, final ITextRegion selection, final ITypedPreferenceValues preferences) {
final FormatterRequest request = this.formatterRequestProvider.get();
request.setAllowIdentityEdits(false);
request.setFormatUndefinedHiddenRegionsOnly(false);
if ((selection != null)) {
request.setRegions(Collections.<ITextRegion>unmodifiableList(CollectionLiterals.<ITextRegion>newArrayList(selection)));
}
if ((preferences != null)) {
request.setPreferences(preferences);
}
final ITextRegionAccess regionAccess = this.regionBuilder.forNodeModel(resource).create();
request.setTextRegionAccess(regionAccess);
final IFormatter2 formatter2 = this.formatter2Provider.get();
final List<ITextReplacement> replacements = formatter2.format(request);
return replacements;
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:17,代码来源:FormattingService.java
示例3: createInjector
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
@Override
public Injector createInjector() {
return Guice.createInjector(new XbaseTestRuntimeModule() {
@Override
public void configure(com.google.inject.Binder binder) {
super.configure(binder);
binder.bind(IFormatter2.class).to(XbaseFormatter.class);
}
});
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:11,代码来源:XbaseFormatterTestInjectorProvider.java
示例4: serialize
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
protected void serialize(EObject obj, Appendable appendable, SaveOptions options) throws IOException {
ITextRegionAccess regionAccess = serializeToRegions(obj);
FormatterRequest request = formatterRequestProvider.get();
request.setFormatUndefinedHiddenRegionsOnly(!options.isFormatting());
request.setTextRegionAccess(regionAccess);
IFormatter2 formatter2 = formatter2Provider.get();
List<ITextReplacement> replacements = formatter2.format(request);
regionAccess.getRewriter().renderToAppendable(replacements, appendable);
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:10,代码来源:Serializer.java
示例5: generate
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
@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();
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:34,代码来源:Formatter2Fragment2.java
示例6: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return TypeExpressionsFormatter.class;
}
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:AbstractTypeExpressionsRuntimeModule.java
示例7: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return N4JSFormatter.class;
}
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:AbstractN4JSRuntimeModule.java
示例8: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return N4MFFormatter.class;
}
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:AbstractN4MFRuntimeModule.java
示例9: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return LcDslFormatter.class;
}
开发者ID:mduft,项目名称:lcdsl,代码行数:4,代码来源:AbstractLcDslRuntimeModule.java
示例10: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return DslFormatter.class;
}
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:4,代码来源:AbstractDslRuntimeModule.java
示例11: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return RestauranteFormatter.class;
}
开发者ID:vicegd,项目名称:org.xtext.dsl.restaurante,代码行数:4,代码来源:AbstractRestauranteRuntimeModule.java
示例12: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return OCCIFormatter.class;
}
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:4,代码来源:AbstractOCCIRuntimeModule.java
示例13: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return PureXbaseFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:AbstractPureXbaseRuntimeModule.java
示例14: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return XbaseFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:AbstractXbaseRuntimeModule.java
示例15: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return XbaseWithAnnotationsFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:AbstractXbaseWithAnnotationsRuntimeModule.java
示例16: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return XtypeFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:4,代码来源:AbstractXtypeRuntimeModule.java
示例17: createFormatter
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
protected IFormatter2 createFormatter(FormatterTestRequest request) {
checkNotNull(formatter, "There is a Guice Binding missing for " + IFormatter2.class.getName());
return formatter.get();
}
开发者ID:eclipse,项目名称:xtext-extras,代码行数:5,代码来源:FormatterTester.java
示例18: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return TestLanguageFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:TestLanguageRuntimeModule.java
示例19: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return PartialSerializationTestLanguageFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:AbstractPartialSerializationTestLanguageRuntimeModule.java
示例20: bindIFormatter2
import org.eclipse.xtext.formatting2.IFormatter2; //导入依赖的package包/类
public Class<? extends IFormatter2> bindIFormatter2() {
return FileAwareTestLanguageFormatter.class;
}
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:AbstractFileAwareTestLanguageRuntimeModule.java
注:本文中的org.eclipse.xtext.formatting2.IFormatter2类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论