[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[e4-dev] IEclipseContext usage (Re: [Proposal] Locale switching)
|
On 11/20/2013 01:14 AM, Tom Schindl wrote:
>> > If yes, then it certainly makes sense to use variant a) to hide IEC from
>> > consumer API. OTOH I'm skeptical that IEC can be hidden from consumer
>> > API generally and will simply leak into consumer code because it is
>> > neither internal nor marked @noreference.
> It is ok in certain situations but it should be generally avoided in our
> APIs. Most of the time people currently access the IEC is when they need
> to publish stuff. I have experimental work in my workspace which frees
> you from this by representing the value as an observable (IObservable /
> JavaFX-ObjectProperty).
>
> The idea is that you can write code like this in future:
>
> @Inject
> @ContextValue(contextKey="currentPerson")
> ContextBoundValue<Person> contextValue;
>
> ListViewer v;
>
> public void binding(DatabindingContext dbc) {
> dbc.bindValue(
> ViewerProperties.singleSelection().observe(v),
> contextValue.adapt(IObservableValue.class)
> );
> }
>
> or maybe even
>
> @Inject
> @ContextValue(contextKey="currentPerson")
> IObservableValue contextValue;
Hi Tom,
is this code available somewhere to toy with?
How do consumers decide/define which IEC is the tracking context? Or is
it intentionally limited to the most specific context?
Thanks
M.