Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Defining a customized IBuilderState(I fail to make xtext use my customized IBuilderState)
Defining a customized IBuilderState [message #1220382] Wed, 11 December 2013 12:04 Go to next message
Flo Plateau is currently offline Flo PlateauFriend
Messages: 16
Registered: December 2013
Junior Member
Dear Xtext Community,

I'm trying to plug a customized IBuilderState, but ClusteringBuilderState is always injected in XtextBuilder instead of my customized class (myDslBuilderState). I tried the following methods:
1. I added some bindings in myDslRuntimeModule and myDslUiModule from IBuilderState to myDslBuilderState.
2. I also tried to define my proper builder fragment: I copy-pasted BuilderIntegrationFragment to myDslBuilderIntegrationFragment, added the bindings from IBuilderState to myDslBuilderState in myDslBuilderIntegrationFragment and replaced in GenerateMyDsl.mwe2 the reference to BuilderIntegrationFragment by a reference to myDslBuilderIntegrationFragment.

When I search for the string "ClusteringBuilderState" in my modified code, it appears nowhere, thus I don't understand how it can still be injected in builderState field of XtextBuilder.

Has someone an idea on how to proceed ?

Thanks in advance for your help,
Florence

Re: Defining a customized IBuilderState [message #1220402 is a reply to message #1220382] Wed, 11 December 2013 14:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13669
Registered: July 2009
Senior Member
Hi,

you have to use an extra guice module

public class YourBuilderModule extends AbstractGenericModule {
  //bind here
}


  <extension
        point="org.eclipse.xtext.ui.shared.overridingGuiceModule">
     <module
           class="xxxx.ui.YourBuilderModule">
     </module>
  </extension>  


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Defining a customized IBuilderState [message #1220403 is a reply to message #1220402] Wed, 11 December 2013 14:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13669
Registered: July 2009
Senior Member
p:S: the change will be global

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Defining a customized IBuilderState [message #1220419 is a reply to message #1220403] Wed, 11 December 2013 16:16 Go to previous message
Flo Plateau is currently offline Flo PlateauFriend
Messages: 16
Registered: December 2013
Junior Member
It works, thanks a lot for your quick answer !
Previous Topic:Create a custom mapping from mydsl to JVM concepts
Next Topic:breakpoints in xtend files
Goto Forum:
  


Current Time: Sat Dec 05 00:57:59 GMT 2020

Powered by FUDForum. Page generated in 0.01560 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top