Java 类org.eclipse.xtext.generator.Binding 实例源码

项目:xtext-extras    文件:XtextAntlrGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    BindFactory factory = new BindFactory()
        .addTypeToType(IParser.class.getName(),getParserClassName(grammar, getNaming()))
        .addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
        .addTypeToType(IAntlrTokenFileProvider.class.getName(),getAntlrTokenFileProviderClassName(grammar, getNaming()))
        .addTypeToType(Lexer.class.getName(), getLexerClassName(grammar, getNaming()))
        .addTypeToProviderInstance(getLexerClassName(grammar, getNaming()), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getLexerClassName(grammar, getNaming()) + ".class)")
        .addConfiguredBinding("RuntimeLexer",
                "binder.bind(" + Lexer.class.getName() + ".class)"+
                ".annotatedWith(com.google.inject.name.Names.named(" +
                "org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
                ")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
        .addTypeToType(ITokenDefProvider.class.getName(), AntlrTokenDefProvider.class.getName());
    if (containsUnorderedGroup(grammar))
        factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
    return factory.getBindings();
}
项目:xtext-extras    文件:AntlrGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    BindFactory factory = new BindFactory()
        .addTypeToType(IParser.class.getName(),getFragmentHelper().getParserClassName(grammar))
        .addTypeToType(ITokenToStringConverter.class.getName(),AntlrTokenToStringConverter.class.getName())
        .addTypeToType(IAntlrTokenFileProvider.class.getName(),getFragmentHelper().getAntlrTokenFileProviderClassName(grammar))
        .addTypeToType(Lexer.class.getName(), getFragmentHelper().getLexerClassName(grammar))
        .addTypeToProviderInstance(getFragmentHelper().getLexerClassName(grammar), "org.eclipse.xtext.parser.antlr.LexerProvider.create(" + getFragmentHelper().getLexerClassName(grammar) + ".class)")
        .addConfiguredBinding("RuntimeLexer",
                "binder.bind(" + Lexer.class.getName() + ".class)"+
                ".annotatedWith(com.google.inject.name.Names.named(" +
                "org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
                ")).to(" + getFragmentHelper().getLexerClassName(grammar) +".class)")
        .addTypeToType(ITokenDefProvider.class.getName(),AntlrTokenDefProvider.class.getName());
    if (containsUnorderedGroup(grammar))
        factory = factory.addTypeToType(IUnorderedGroupHelper.class.getName(), UnorderedGroupHelper.class.getName());
    if (getOptions().isIgnoreCase()) {
        factory = factory
            .addTypeToType(ITokenSerializer.IKeywordSerializer.class.getName(), IgnoreCaseKeywordSerializer.class.getName())
            .addTypeToType(AbstractIDValueConverter.class.getName(), IgnoreCaseIDValueConverter.class.getName());
    }
    return factory.getBindings();
}
项目:xtext-extras    文件:AntlrGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
        .addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper", "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper")
        .addConfiguredBinding("HighlightingLexer",
                "binder.bind(" + Lexer.class.getName() + ".class)"+
                ".annotatedWith(com.google.inject.name.Names.named(" +
                "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
                ")).to(" + getFragmentHelper().getLexerClassName(grammar) +".class)")
        .addConfiguredBinding("HighlightingTokenDefProvider",
                "binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
                ".annotatedWith(com.google.inject.name.Names.named(" +
                "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
                ")).to(" + AntlrTokenDefProvider.class.getName() +".class)")
        .getBindings();
}
项目:xtext-extras    文件:EMFGeneratorFragment.java   
/**
 * @since 2.11
 */
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    if (isBindEPackageAndEFactory()) {
        BindFactory bindFactory = new BindFactory();
        // Register generated EPackage and EFactory instances in the runtime module
        for (EPackage pkg: getGeneratedEPackages(grammar)) {
            GenPackage genPkg = GenModelUtil2.getGenPackage(pkg, grammar.eResource().getResourceSet());
            bindFactory
                .addTypeToInstance(genPkg.getQualifiedPackageInterfaceName(), genPkg.getQualifiedPackageInterfaceName()+".eINSTANCE")
                .addTypeToInstance(genPkg.getQualifiedFactoryInterfaceName(), genPkg.getQualifiedFactoryInterfaceName()+".eINSTANCE");
        }
        return bindFactory.getBindings();
    } else {
        return Collections.emptySet();
    }
}
项目:xtext-extras    文件:AbstractScopingFragment.java   
@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();
}
项目:xtext-extras    文件:BuilderIntegrationFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    return new BindFactory()
    .addTypeToType(IContainer.Manager.class.getName(), StateBasedContainerManager.class.getName())
    .addTypeToType(IAllContainersState.Provider.class.getName(),
            org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider.class.getName())
    .addConfiguredBinding(
                IResourceDescriptions.class.getName(),
                "binder.bind(" + IResourceDescriptions.class.getName() + ".class"
                        + ").to("
                        + ResourceSetBasedResourceDescriptions.class.getName() + ".class)")
        .addConfiguredBinding(
                IResourceDescriptions.class.getName() + "Persisted",
                "binder.bind("+ IResourceDescriptions.class.getName() + ".class"
                        + ").annotatedWith(com.google.inject.name.Names.named("
                        + "org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to("
                        + ResourceSetBasedResourceDescriptions.class.getName() + ".class)")
        .getBindings();
}
项目:xtext-extras    文件:BuilderIntegrationFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
        .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("
                        + "org.eclipse.xtext.builder.clustering.CurrentDescriptions.ResourceSetAware.class)")
        .addTypeToType("org.eclipse.xtext.ui.editor.IXtextEditorCallback", "org.eclipse.xtext.builder.nature.NatureAddingEditorCallback")
        .addTypeToType("org.eclipse.xtext.generator.IContextualOutputConfigurationProvider", "org.eclipse.xtext.builder.EclipseOutputConfigurationProvider")
        .addConfiguredBinding(
                IResourceDescriptions.class.getName() + "Persisted",
                "binder.bind("+ IResourceDescriptions.class.getName() + ".class"
                        + ").annotatedWith(com.google.inject.name.Names.named("
                        + "org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to("
                        + "org.eclipse.xtext.builder.builderState.IBuilderState.class)")
        .addTypeToType("org.eclipse.xtext.ui.editor.DocumentBasedDirtyResource", "org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource")
        .getBindings();
}
项目:xtext-extras    文件:LabelProviderFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    BindFactory bindFactory = new BindFactory();
    if(isGenerateStub())
        bindFactory
            .addTypeToType("org.eclipse.jface.viewers.ILabelProvider", getEObjectLabelProviderQualifiedName(grammar, getNaming()))
            .addConfiguredBinding("ResourceUIServiceLabelProvider",
                "binder.bind(org.eclipse.jface.viewers.ILabelProvider.class)" +
                ".annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class)" +
                ".to(" + getDescriptionLabelProviderQualifiedName(grammar, getNaming()) + ".class)");
    else if(doesUseXbase(grammar))
        bindFactory.addTypeToType("org.eclipse.jface.viewers.ILabelProvider", "org.eclipse.xtext.xbase.ui.labeling.XbaseLabelProvider")
            .addConfiguredBinding("ResourceUIServiceLabelProvider",
                    "binder.bind(org.eclipse.jface.viewers.ILabelProvider.class)" +
                            ".annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class)" +
                            ".to(org.eclipse.xtext.xbase.ui.labeling.XbaseDescriptionLabelProvider.class)");
    return bindFactory.getBindings();
}
项目:xtext-extras    文件:ValidatorFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bindFactory = new BindFactory();
    if (this.generateStub) {
      bindFactory.addTypeToTypeEagerSingleton(
        this._validatorNaming.getValidatorName(grammar), 
        this._validatorNaming.getValidatorName(grammar));
    } else {
      bindFactory.addTypeToTypeEagerSingleton(
        this._validatorNaming.getAbstractValidatorName(), 
        this._validatorNaming.getAbstractValidatorName());
    }
    _xblockexpression = bindFactory.getBindings();
  }
  return _xblockexpression;
}
项目:xtext-extras    文件:TaskTagPreferencePageFragment.java   
@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;
}
项目:xtext-extras    文件:FragmentAdapter.java   
private void generateGuiceModuleRt(final LanguageConfig config1, final XpandExecutionContext ctx) {
  final IXtextGeneratorLanguage config2 = this.getLanguage();
  final Set<Binding> bindings = this.fragment.getGuiceBindingsRt(config1.getGrammar());
  if ((bindings != null)) {
    final Function1<Binding, GuiceModuleAccess.Binding> _function = (Binding it) -> {
      return this.translateBinding(it);
    };
    config2.getRuntimeGenModule().addAll(IterableExtensions.<Binding, GuiceModuleAccess.Binding>map(bindings, _function));
  }
  if ((this.fragment instanceof IGeneratorFragmentExtension4)) {
    final String superClass = ((IGeneratorFragmentExtension4)this.fragment).getDefaultRuntimeModuleClassName(config1.getGrammar());
    if ((superClass != null)) {
      GuiceModuleAccess _runtimeGenModule = config2.getRuntimeGenModule();
      TypeReference _typeReference = new TypeReference(superClass);
      _runtimeGenModule.setSuperClass(_typeReference);
    }
  }
}
项目:xtext-extras    文件:FragmentAdapter.java   
private void generateGuiceModuleUi(final LanguageConfig config1, final XpandExecutionContext ctx) {
  final IXtextGeneratorLanguage config2 = this.getLanguage();
  final Set<Binding> bindings = this.fragment.getGuiceBindingsUi(config1.getGrammar());
  if ((bindings != null)) {
    final Function1<Binding, GuiceModuleAccess.Binding> _function = (Binding it) -> {
      return this.translateBinding(it);
    };
    config2.getEclipsePluginGenModule().addAll(IterableExtensions.<Binding, GuiceModuleAccess.Binding>map(bindings, _function));
  }
  if ((this.fragment instanceof IGeneratorFragmentExtension4)) {
    final String superClass = ((IGeneratorFragmentExtension4)this.fragment).getDefaultUiModuleClassName(config1.getGrammar());
    if ((superClass != null)) {
      GuiceModuleAccess _eclipsePluginGenModule = config2.getEclipsePluginGenModule();
      TypeReference _typeReference = new TypeReference(superClass);
      _eclipsePluginGenModule.setSuperClass(_typeReference);
    }
  }
}
项目: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();
}
项目:xtext-extras    文件:ContentAssistFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bindFactory = new BindFactory();
    if (this.generateStub) {
      bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider", 
        this.getProposalProviderName(grammar));
    } else {
      bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider", 
        this.getGenProposalProviderName());
    }
    _xblockexpression = bindFactory.getBindings();
  }
  return _xblockexpression;
}
项目:antlr4ide    文件:AntlrGeneratorFragmentWithCustomLexer.java   
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  return new BindFactory()
      .addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper",
          "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper")
      .addConfiguredBinding("HighlightingLexer",
          "binder.bind(" + Lexer.class.getName() + ".class)" +
              ".annotatedWith(com.google.inject.name.Names.named(" +
              "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
              ")).to(" + getFragmentHelper().getLexerClassName(grammar) + ".class)")
      .addConfiguredBinding("HighlightingTokenDefProvider",
          "binder.bind(" + ITokenDefProvider.class.getName() + ".class)" +
              ".annotatedWith(com.google.inject.name.Names.named(" +
              "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
              ")).to(" + AntlrTokenDefProvider.class.getName() + ".class)")
      .getBindings();
}
项目:xtext-extras    文件:GeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
    .addTypeToType("org.eclipse.xtext.builder.IXtextBuilderParticipant", "org.eclipse.xtext.builder.BuilderParticipant")
    .addTypeToInstance("org.eclipse.core.resources.IWorkspaceRoot", "org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot()")
    .addConfiguredBinding(
                    "BuilderPreferenceStoreInitializer",
                    "binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class)" +
                    ".annotatedWith(com.google.inject.name.Names.named(\"builderPreferenceInitializer\"))" +
                    ".to(org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess.Initializer.class)")
    .getBindings();
}
项目:xtext-extras    文件:QualifiedNamesFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
            .addTypeToType("org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher",
                    "org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher")
            .addTypeToType("org.eclipse.xtext.ui.refactoring.IDependentElementsCalculator",
                    "org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator")
            .getBindings();
}
项目:xtext-extras    文件:SimpleNamesFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
    .addTypeToType("org.eclipse.xtext.ui.refactoring.IDependentElementsCalculator",
            "org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator")
    .getBindings();
}
项目:xtext-extras    文件:XtextAntlrGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    BindFactory binder = new BindFactory();
        binder.addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IProposalConflictHelper", "org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper");
        if(getNaming().hasIde()){
            binder.addConfiguredBinding("HighlightingLexer",
                    "binder.bind(" + Lexer.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
                    ")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
                   .addConfiguredBinding("HighlightingTokenDefProvider",
                    "binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ide.LexerIdeBindings.HIGHLIGHTING" +
                    ")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
        } else {
            binder.addConfiguredBinding("HighlightingLexer",
                    "binder.bind(" + Lexer.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
                    ")).to(" + getLexerClassName(grammar, getNaming()) +".class)")
                   .addConfiguredBinding("HighlightingTokenDefProvider",
                    "binder.bind(" + ITokenDefProvider.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING" +
                    ")).to(" + AntlrTokenDefProvider.class.getName() +".class)");
        }
        return binder.getBindings();
}
项目:xtext-extras    文件:ExternalAntlrLexerFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    if (runtime)
        return new BindFactory()
            .addConfiguredBinding("RuntimeLexer",
                    "binder.bind(" + Lexer.class.getName() + ".class)"+
                    ".annotatedWith(com.google.inject.name.Names.named(" +
                    "org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME" +
                    ")).to(" + lexerGrammar +".class)")
            .getBindings();
    return Collections.emptySet();
}
项目:xtext-extras    文件:TypesGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
         // overrides binding from org.eclipse.xtext.generator.exporting.QualifiedNamesFragment
         .addTypeToType("org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher",
                    "org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher")
         .getBindings();
}
项目:xtext-extras    文件:GrammarAccessFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    BindFactory bindFactory = new BindFactory();
    // generating this binding for terminals will break existing languages
    if(!equal("org.eclipse.xtext.common.Terminals", grammar.getName())) {
        bindFactory
            .addTypeToInstance(ClassLoader.class.getName(), "getClass().getClassLoader()");
    }
    bindFactory.addTypeToType(IGrammarAccess.class.getName(), GrammarAccessUtil.getGrammarAccessFQName(grammar, getNaming()));
    return bindFactory.getBindings();
}
项目:xtext-extras    文件:FormatterFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(Grammar grammar) {
    if(isGenerateStub())
        return new BindFactory().addTypeToType(IFormatter.class.getName(), getFormatterName(grammar, getNaming()))
            .getBindings();
    else
        return emptySet();
}
项目:xtext-extras    文件:OutlineTreeProviderFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    if(isGenerateStub())
        return new BindFactory()
            .addTypeToType("org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider",
                    getQualifiedName(grammar, getNaming()))
            .addTypeToType("org.eclipse.xtext.ui.editor.outline.impl.IOutlineTreeStructureProvider",
                    getQualifiedName(grammar, getNaming()))
            .getBindings();
    else 
        return emptySet();
}
项目:xtext-extras    文件:CodetemplatesGeneratorFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    if(getNaming().hasIde()){
        return new BindFactory()
            .addTypeToProviderInstance("org.eclipse.xtext.ui.codetemplates.ui.preferences.TemplatesLanguageConfiguration", 
                "org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getTemplatesLanguageConfigurationProvider()")
            .addTypeToProviderInstance("org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistry", 
                "org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getLanguageRegistry()")
            .addTypeToTypeEagerSingleton("org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar",
                "org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar")
            .addTypeToType("org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage", 
                "org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage")
            .addTypeToType("org.eclipse.xtext.ide.editor.partialEditing.IPartialEditingContentAssistParser",
                getPartialContentAssistParser(grammar, getNaming()))
            .addTypeToType("org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialEditingContentAssistContextFactory", 
                    "org.eclipse.xtext.ui.codetemplates.ui.partialEditing.PartialEditingContentAssistContextFactory")
            .getBindings();
    } else {
        return new BindFactory()
        .addTypeToProviderInstance("org.eclipse.xtext.ui.codetemplates.ui.preferences.TemplatesLanguageConfiguration", 
            "org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getTemplatesLanguageConfigurationProvider()")
        .addTypeToProviderInstance("org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistry", 
            "org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getLanguageRegistry()")
        .addTypeToTypeEagerSingleton("org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar",
            "org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar")
        .addTypeToType("org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage", 
            "org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage")
        .addTypeToType("org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser",
            getPartialContentAssistParser(grammar, getNaming()))
        .getBindings(); 
    }
}
项目:xtext-extras    文件:JavaBasedContentAssistFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
        .addTypeToType("org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider",
                getProposalProviderClassName(grammar))
        .getBindings();
}
项目:xtext-extras    文件:CompareFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    String simpleName = GrammarUtil.getSimpleName(grammar);
    String statement =
            "binder.bind(String.class).annotatedWith("
            + "com.google.inject.name.Names.named(org.eclipse.xtext.ui.UIBindings.COMPARE_VIEWER_TITLE))"
            + ".toInstance(\""+simpleName+" Compare\");";
    return new BindFactory().addTypeToType("org.eclipse.compare.IViewerCreator",
            "org.eclipse.xtext.ui.compare.DefaultViewerCreator").addConfiguredBinding("CompareViewerTitle", statement).getBindings();
}
项目:xtext-extras    文件:ImplicitUiFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    BindFactory bindFactory = new BindFactory()
        .addTypeToProviderInstance(
                IAllContainersState.class.getName(),
                "org.eclipse.xtext.ui.shared.Access.getJavaProjectsState()");
    if (XbaseGeneratorFragment.doesUseXbase(grammar)) {
        bindFactory = bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.XtextEditor", "org.eclipse.xtext.xbase.ui.editor.XbaseEditor");
        bindFactory = bindFactory.addTypeToType("org.eclipse.xtext.ui.editor.model.XtextDocumentProvider", "org.eclipse.xtext.xbase.ui.editor.XbaseDocumentProvider");
        bindFactory = bindFactory.addTypeToType("org.eclipse.xtext.ui.generator.trace.OpenGeneratedFileHandler", "org.eclipse.xtext.xbase.ui.generator.trace.XbaseOpenGeneratedFileHandler");
    }
    return bindFactory.getBindings();
}
项目:xtext-extras    文件:SimpleProjectWizardFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    return new BindFactory()
        .addTypeToType("org.eclipse.xtext.ui.wizard.IProjectCreator",
                    getNaming().basePackageUi(grammar)+".wizard." + GrammarUtil.getSimpleName(grammar) + "ProjectCreator")
        .getBindings();
}
项目:xtext-extras    文件:QuickfixProviderFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(Grammar grammar) {
    BindFactory bindFactory = new BindFactory();
    if(isGenerateStub()) {
         bindFactory
            .addTypeToType("org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider", getQuickfixProviderName(grammar, getNaming()));
    } else {
         bindFactory
            .addTypeToType("org.eclipse.xtext.ui.editor.quickfix.IssueResolutionProvider", getQuickfixProviderSuperClassName(grammar));
    }
    return bindFactory.getBindings();
}
项目:xtext-extras    文件:TaskTagPreferencePageFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  Set<Binding> _xblockexpression = null;
  {
    final BindFactory bind = new BindFactory();
    bind.addTypeToType("org.eclipse.xtext.tasks.ITaskTagProvider", 
      "org.eclipse.xtext.tasks.PreferenceTaskTagProvider");
    _xblockexpression = bind.getBindings();
  }
  return _xblockexpression;
}
项目:xtext-extras    文件:SerializerFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bf = new BindFactory();
  bf.addTypeToType(ISemanticSequencer.class.getName(), this.names.getSemanticSequencer().getQualifiedName());
  bf.addTypeToType(ISyntacticSequencer.class.getName(), this.names.getSyntacticSequencer().getQualifiedName());
  bf.addTypeToType(ISerializer.class.getName(), Serializer.class.getName());
  return bf.getBindings();
}
项目:xtext-extras    文件:Formatter2Fragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  final BindFactory bf = new BindFactory();
  bf.addTypeToType(
    "org.eclipse.xtext.ui.editor.formatting.IContentFormatterFactory", 
    "org.eclipse.xtext.ui.editor.formatting2.ContentFormatterFactory");
  return bf.getBindings();
}
项目:dsl-devkit    文件:ExportFragment.java   
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bindFactory = new BindFactory();
  final String namingPrefix = GrammarUtil.getNamespace(grammar) + ".naming." + GrammarUtil.getName(grammar); //$NON-NLS-1$
  final String resourcePrefix = GrammarUtil.getNamespace(grammar) + ".resource." + GrammarUtil.getName(grammar); //$NON-NLS-1$

  ExportModel m = getModel(grammar);
  if (m != null) {
    bindFactory.addTypeToType(IQualifiedNameProvider.class.getName(), namingPrefix + "ExportedNamesProvider"); //$NON-NLS-1$
    if (!m.getInterfaces().isEmpty()) {
      bindFactory.addTypeToType(IFingerprintComputer.class.getName(), resourcePrefix + "FingerprintComputer"); //$NON-NLS-1$
    }
    if (!m.getExports().isEmpty()) {
      bindFactory.addTypeToType(IDefaultResourceDescriptionStrategy.class.getName(), resourcePrefix + "ResourceDescriptionStrategy"); //$NON-NLS-1$
    }
    if (Iterables.any(m.getExports(), new Predicate<Export>() {
      @Override
      public boolean apply(final Export input) {
        return input.isFingerprint() && input.getFragmentAttribute() != null;
      }
    })) {
      bindFactory.addTypeToType(IFragmentProvider.class.getName(), resourcePrefix + "FragmentProvider");
    }
  }
  bindFactory.addTypeToType(IResourceDescription.Manager.class.getName(), resourcePrefix + "ResourceDescriptionManager"); //$NON-NLS-1$
  return bindFactory.getBindings();
}
项目:dsl-devkit    文件:FormatFragment.java   
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bindFactory = new BindFactory();
  bindFactory.addTypeToType(IFormatter.class.getName(), FormatGeneratorUtil.getFormatterName(grammar, ""));
  bindFactory.addTypeToType(INodeModelFormatter.class.getName(), RegionNodeModelFormatter.class.getName());
  bindFactory.addTypeToType(INodeModelStreamer.class.getName(), DirectNodeModelStreamer.class.getName());
  return bindFactory.getBindings();
}
项目:dsl-devkit    文件:ScopingFragment.java   
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final BindFactory bindFactory = new BindFactory();
  final String prefix = GrammarUtil.getNamespace(grammar) + ".scoping." + GrammarUtil.getName(grammar);

  bindFactory.addTypeToType(IScopeProvider.class.getName(), prefix + "ScopeProvider");
  bindFactory.addTypeToType(IScopeNameProvider.class.getName(), prefix + "ScopeNameProvider");
  bindFactory.addTypeToType(ILinkingService.class.getName(), "com.avaloq.tools.ddk.xtext.linking.LinkingService");

  return bindFactory.getBindings();
}
项目:dsl-devkit    文件:ValidValidatorFragment.java   
/** {@inheritDoc} */
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  if (hasQuickfixes(getValidModel(grammar))) {
    final BindFactory addTypeToInstance = new BindFactory().addTypeToType(IssueResolutionProvider.class.getName(), getQuickfixProviderName(grammar, getNaming()));
    return addTypeToInstance.getBindings();
  } else {
    return Collections.emptySet();
  }
}
项目:dsl-devkit    文件:ModelInferenceFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  BindFactory factory = new BindFactory();
  if (generateModelInference) {
    factory.addTypeToTypeSingleton(IInferredModelAssociations.class.getName(), InferredModelAssociator.class.getName());
    factory.addTypeToTypeSingleton(IInferredModelAssociator.class.getName(), InferredModelAssociator.class.getName());
    factory.addTypeToTypeSingleton(IDerivedStateComputer.class.getName(), InferredModelAssociator.class.getName());
  }
  return factory.getBindings();
}
项目:dsl-devkit    文件:ModelInferenceFragment.java   
@Override
public Set<Binding> getGuiceBindingsUi(final Grammar grammar) {
  BindFactory factory = new BindFactory();
  if (generateModelInference) {
    factory.addTypeToType(ReferenceQueryExecutor.class.getName(), InferredModelReferenceQueryExecutor.class.getName());
  }
  return factory.getBindings();
}
项目:dsl-devkit    文件:BuilderIntegrationFragment.java   
@Override
public Set<Binding> getGuiceBindingsRt(final Grammar grammar) {
  final Set<Binding> bindings = super.getGuiceBindingsRt(grammar);
  final BindFactory factory = new BindFactory();
  factory.addTypeToType(IContainer.Manager.class.getName(), "com.avaloq.tools.ddk.xtext.builder.CachingStateBasedContainerManager");
  factory.addTypeToType(LazyLinkingResource.class.getName(), LazyLinkingResource2.class.getName());
  factory.addTypeToType(LazyURIEncoder.class.getName(), FastLazyURIEncoder.class.getName());
  final Set<Binding> result = factory.getBindings();
  result.addAll(bindings);
  return result;
}