开发者

SWT DataBinding for DateTime

I want to display a java.util.Date using two DateTime controls - one displaying the date and one the time.

I try to use databinding here to set the values entered in the controls. I try to bind the controls to the date as follows:

IObservableValue getPostponeDateDayObserveValue = SWTObservables.observeSelection(getPostponeDate());
IObservableValue getPostponeTargetDateDateObserveValue = PojoObservables.observeValue(this, "postponeTargetDate");
bindingContext.bindValue(getPostponeDateDayObserveValue, getPostponeTargetDateDateObserveValue, null, null);
    //
IObservableValue getPostponeTimeSecondsObserveValue = SWTObservables.observeSelection(getPostponeTime());
IObservableValue postponeTargetDateSecondsObserveValue = PojoObservables.observeValue(this, "postponeTargetDate");
bindingContext.bindValue(getPostponeTimeSecondsObserveValue, postponeTargetDateSecondsObserveValue, nul开发者_开发知识库l, null);

What happens here is that the date corries the correct date or the correct time depending on which control was changed later. Is there a possibility to bind two datetime controls (one for date one for time) to the same date.

Thanks for your support.


just overlooked the class that helps here: DateAndTimeObservableValue

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜