@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(); }
@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(); }
public Class<? extends ITokenDefProvider> bindITokenDefProvider() { return AntlrTokenDefProvider.class; }
public void configureHighlightingTokenDefProvider(Binder binder) { binder.bind(ITokenDefProvider.class) .annotatedWith(Names.named(LexerIdeBindings.HIGHLIGHTING)) .to(AntlrTokenDefProvider.class); }