[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [e4-dev] IEclipseContext usage (Re: [Proposal] Locale switching)
|
... and explained a bit at:
http://tomsondev.bestsolution.at/2013/11/21/writing-ieclipsecontext-less-code/
http://tomsondev.bestsolution.at/2013/11/21/what-ieclipsecontextdeclaremodifiable-is-good-for/
Tom
On 21.11.13 00:22, Tom Schindl wrote:
> Hi Markus,
>
> I've pushed my first implementation to
> http://git.eclipse.org/c/efxclipse/org.eclipse.efxclipse.git/
>
> You are interested in:
>
> - Annotations: bundles/runtime/org.eclipse.fx.core.di
> - IEclipseContext-Impl: bundles/runtime/org.eclipse.fx.core.di.context
> - JUnit-Tests: bundles/runtime/org.eclipse.fx.core.di.context.tests
>
> The following injections are working as of now:
>
>> public static class SimpleInject {
>> @Inject
>> @ContextValue(contextKey="simpleValue")
>> public ContextBoundValue<String> value;
>> }
>>
>> public static class ObservableInject {
>> @Inject
>> @ContextValue(contextKey="simpleValue")
>> public ContextBoundValue<String> value;
>>
>> public IObservableValue observableValue;
>>
>> @Inject
>> @Named("simpleValue")
>> @Optional
>> public String injectedValue;
>>
>> @PostConstruct
>> void makeObservable() {
>> observableValue = value.adaptTo(IObservableValue.class);
>> }
>> }
>>
>> public static class DirectObservableInject {
>> @Inject
>> @ContextValue(contextKey="simpleValue")
>> public IObservableValue value;
>> }
>
> See
> http://git.eclipse.org/c/efxclipse/org.eclipse.efxclipse.git/tree/bundles/runtime/org.eclipse.fx.core.di.context.tests/src/org/eclipse/fx/core/di/context/tests/ContextBoundValueTestCase.java
>
> The system also needs org.eclipse.fx.core-bundle which holds the adapter
> system. I'm not using the one from the platform but it is fairly easy to
> contribute a higher-ranked one through the OSGi-Registry which does
> query the IAdapterManager if one thinks it is needed.
>
> Eclipse Databinding & JavaFX property support as optional and provided
> through the adapter system, additional adapters can be implemented
> fairly easy ;-)
>
> Tom
>
> On 20.11.13 11:12, Tom Schindl wrote:
>> [...]
>>
>>> Hi Tom,
>>>
>>> is this code available somewhere to toy with?
>>>
>>
>> No not yet. The implementation is not yet fully done ;-)
>>
>>> How do consumers decide/define which IEC is the tracking context? Or is
>>> it intentionally limited to the most specific context?
>>>
>>
>> Context changes are pushed *not* via set() but through modify() which
>> searches for the context in which the variable is declared modifiable.
>>
>> I'll keep you posted when I've pushed it to e(fx)clipse repo.
>>
>> Tom
>> _______________________________________________
>> e4-dev mailing list
>> e4-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/e4-dev
>>
>
> _______________________________________________
> e4-dev mailing list
> e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/e4-dev
>