Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[xtext-dev] org.eclipse.xtext.ui.shared and guice 2 module overrides

Hi all,

I've extracted the global state from the builder and ui project and moved it to newly introduced bundle called 'org.eclipse.xtext.ui.shared'.

It contains the module used to instantiate the code from the other two mentioned projects and it holds and maintains the corresponding singletons. A new module for clients (SharedStateModule) is used to bind the singletons from the shared state to your specific language infrastructure.

An extension point has been introduced to allow overriding the default module of the ui.shared bundle. Note that this is not intended to be a typically scenario, but only an enabler for very specific requirements (You're modifying the shared state, which might be used by other plugins as well).

I also changed the module hierarchy so that we now again have two parallel hierarchies for runtime and ui stuff. So we have a DefaultUiModule again, where we can add ui-specific default bindings (I moved lots of bindings from the ImplicitUiFragment to that module).

The activator now creates a module by combining the RuntimeModule, UiModule and SharedStateModule using Guice's new Modules.override capabilties. That is UiModule overrides RuntimeModule and SharedStateModule overrides UiModule.

The generated activator contains three methods (one for each module), which can be overridden in order to change this.

Cheers,
Sven



Back to the top