Skip to main content



      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 07:04 Go to next message
Eclipse UserFriend
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 09:16 Go to previous messageGo to next message
Eclipse UserFriend
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>  
Re: Defining a customized IBuilderState [message #1220403 is a reply to message #1220402] Wed, 11 December 2013 09:21 Go to previous messageGo to next message
Eclipse UserFriend
p:S: the change will be global
Re: Defining a customized IBuilderState [message #1220419 is a reply to message #1220403] Wed, 11 December 2013 11:16 Go to previous message
Eclipse UserFriend
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: Sun Jul 20 12:35:01 EDT 2025

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

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

Back to the top