Java 类org.eclipse.xtext.preferences.IPreferenceValuesProvider 实例源码

项目:xtext-extras    文件:Formatter2Fragment.java   
@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();
}
项目:sadlos2    文件:SadlActionHandler.java   
protected Map<String,String> getPreferences() {
    Injector reqInjector = safeGetInjector(SadlActivator.COM_GE_RESEARCH_SADL_SADL);
    IPreferenceValuesProvider pvp = reqInjector.getInstance(IPreferenceValuesProvider.class);
    org.eclipse.emf.ecore.resource.Resource resource = new ResourceImpl();
    resource.setURI(org.eclipse.emf.common.util.URI.createFileURI("/"));

    IPreferenceValues preferenceValues = pvp.getPreferenceValues(resource);
    if (preferenceValues != null) {
        Map<String, String> map = new HashMap<String, String>();
        boolean bval = Boolean.parseBoolean(preferenceValues.getPreference(SadlPreferences.SHOW_TIMING_INFORMATION));
        if (bval) {
            map.put(SadlPreferences.SHOW_TIMING_INFORMATION.getId(), "true");
        }
        else {
            map.put(SadlPreferences.SHOW_TIMING_INFORMATION.getId(), "false");
        }
        bval = Boolean.parseBoolean(preferenceValues.getPreference(SadlPreferences.VALIDATE_BEFORE_TEST));
        if (bval) {
            map.put(SadlPreferences.VALIDATE_BEFORE_TEST.getId(), "true");
        }
        else {
            map.put(SadlPreferences.VALIDATE_BEFORE_TEST.getId(), "false");
        }           return map;
    }
    return null;
}
项目:n4js    文件:N4JSHeadlessGeneratorModule.java   
@Override
public void configure(Binder binder) {
    if (propertiesFile != null) {
        binder.bind(IPreferenceValuesProvider.class).toInstance(
                new PropertiesFileBasedValuesProvider(propertiesFile));
    }

}
项目:n4js    文件:N4JSRuntimeModule.java   
/** Configures the formatter preference value provider */
@Override
public void configureFormatterPreferences(Binder binder) {
    binder
            .bind(IPreferenceValuesProvider.class)
            .annotatedWith(FormatterPreferences.class)
            .to(N4JSSimpleFormattingPreferenceProvider.class);
}
项目:xtext-core    文件:Formatter2Fragment2.java   
@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();
}
项目:sadlos2    文件:OntologyGraphGeneratorHandler.java   
protected Map<String,Boolean> getOntologyGraphPreferences() {
    Injector sadlInjector = safeGetInjector(SadlActivator.COM_GE_RESEARCH_SADL_SADL);
    IPreferenceValuesProvider pvp = sadlInjector.getInstance(IPreferenceValuesProvider.class);
    org.eclipse.emf.ecore.resource.Resource resource = new ResourceImpl();
    resource.setURI(org.eclipse.emf.common.util.URI.createFileURI("/"));

    IPreferenceValues preferenceValues = pvp.getPreferenceValues(resource);
    if (preferenceValues != null) {
        Map<String, Boolean> map = new HashMap<String, Boolean>();
        boolean bval = Boolean.parseBoolean(preferenceValues.getPreference(SadlPreferences.GRAPH_IMPLICIT_ELEMENTS));
        if (bval) {
            map.put(SadlPreferences.GRAPH_IMPLICIT_ELEMENTS.getId(), true);
        }
        else {
            map.put(SadlPreferences.GRAPH_IMPLICIT_ELEMENTS.getId(), false);
        }
        bval = Boolean.parseBoolean(preferenceValues.getPreference(SadlPreferences.GRAPH_IMPLICIT_ELEMENT_INSTANCES));
        if (bval) {
            map.put(SadlPreferences.GRAPH_IMPLICIT_ELEMENT_INSTANCES.getId(), true);
        }
        else {
            map.put(SadlPreferences.GRAPH_IMPLICIT_ELEMENT_INSTANCES.getId(), false);
        }           
        return map;
    }
    return null;
}
项目:n4js    文件:AbstractTypeExpressionsRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:n4js    文件:AbstractN4JSRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:n4js    文件:N4JSIssueSeveritiesProvider.java   
@Override
protected IPreferenceValuesProvider getValuesProvider() {
    return valuesProvider;
}
项目:n4js    文件:AbstractN4MFRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:n4js    文件:N4MFIssueSeveritiesProvider.java   
@Override
protected IPreferenceValuesProvider getValuesProvider() {
    return valuesProvider;
}
项目:lcdsl    文件:AbstractLcDslRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:gemoc-studio    文件:AbstractDslRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:org.xtext.dsl.restaurante    文件:AbstractRestauranteRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:OCCI-Studio    文件:AbstractOCCIRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-extras    文件:AbstractPureXbaseRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-extras    文件:AbstractXbaseRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-extras    文件:AbstractXbaseWithAnnotationsRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-extras    文件:AbstractXtypeRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-extras    文件:XbaseInjectorProvider.java   
public Class<? extends IPreferenceValuesProvider> bindIPreferenceValuesProvider() {
    return SingletonPreferenceValuesProvider.class;
}
项目:xtext-extras    文件:CodeStyleValidationTest.java   
@Inject
public MapBasedPreferenceValues setPreferences(final IPreferenceValuesProvider.SingletonPreferenceValuesProvider prefProvider) {
  return this.preferences = prefProvider.getPreferenceValues(null);
}
项目:xtext-extras    文件:CheckExceptionValidationTest.java   
@Inject
public void setPreferences(final IPreferenceValuesProvider.SingletonPreferenceValuesProvider prefProvider) {
  this.preferences = prefProvider.getPreferenceValues(null);
}
项目:xtext-core    文件:IssueSeveritiesProvider.java   
protected IPreferenceValuesProvider getValuesProvider() {
    return valuesProvider;
}
项目:xtext-core    文件:PreferenceTaskTagProvider.java   
@Inject
public void setPreferenceValuesProvider(final IPreferenceValuesProvider preferenceValuesProvider) {
  this.preferenceValuesProvider = preferenceValuesProvider;
}
项目:xtext-core    文件:AbstractPartialSerializationTestLanguageRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-core    文件:AbstractFileAwareTestLanguageRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-core    文件:AbstractSimpleBeeLangTestLanguageRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-core    文件:AbstractBeeLangTestLanguageRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-core    文件:AbstractExBeeLangTestLanguageRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:xtext-core    文件:AbstractNoJdtTestLanguageRuntimeModule.java   
public void configureFormatterPreferences(Binder binder) {
    binder.bind(IPreferenceValuesProvider.class).annotatedWith(FormatterPreferences.class).to(FormatterPreferenceValuesProvider.class);
}
项目:bts    文件:DefaultUiModule.java   
/**
 * @since 2.4
 */
public Class<? extends IPreferenceValuesProvider> bindIPreferenceValuesProvider() {
    return EclipsePreferencesProvider.class;
}