JFXtras / jfxtras

A supporting library for JavaFX, containing helper classes, extended layouts, controls and other interesting widgets.
http://jfxtras.org
Other
599 stars 123 forks source link

expose isXXXChanging properties on LocalDateTimePicker #6

Closed millmanorama closed 10 years ago

millmanorama commented 10 years ago

I need to know when a user has chosen a new LocalDateTime, but not be notified of every intermediate LocalDateTime before the user dismisses the popup. It would be nice if a isChanging property were exposed like for sliders.

tbee commented 10 years ago

You are talking about the LocaleDateTimeTextField I assume. And you want to know each date/time combination that was selected. The problem with that is that using the time sliders, each position / time the cursor halts on (but the mouse is not released) is considered a selected time. So this will result in a lot of "isChanging" times...

Tom

On 2014-5-2 19:51, jonathan millman wrote:

I need to know when a user has chosen a new LocalDateTime, but be notified of every intermediate LocalDateTime before the user dismisses the popup. It would be nice if a isChanging property were exposed like for sliders.

— Reply to this email directly or view it on GitHub https://github.com/JFXtras/jfxtras/issues/6.

millmanorama commented 10 years ago

sorry, I missed a 'not'. I don't want to be notified of all the intermediate times selected with the slider. Currenlty, each time the mouse stops but is not released i get a change notification on the selected date/time, but i have no way of knowing if that is an intermediate one or not(as far as i can tell). I thought if a isChanging property was exposed like for a slider i could check this in my handler and ignore spurious notifications of non final selections.

tbee commented 10 years ago

Ok. This continuous updating was in fact something that I ignored; didn't like, but it wasn't incorrect either. Your remark finally triggered me to look into it. I've decided to hide the "is changing" events; so the value is only set after the mouse is released. The intermediate events only update the screen. I do not want to expose how the UI renders the time and that coincidentally the slider has all these "while changing" events.

millmanorama commented 10 years ago

I just pulled the 8.0-r2-SNAPSHOT and this seems to be working now. Thanks. I think there is a regression, but I will file a separate bug.