The trouble with Skins

Tom Eugelink tbee at
Tue Mar 24 22:47:11 UTC 2015

On 22-3-2015 13:53, John Hendrikx wrote:
> On 22/03/2015 09:59, Tom Eugelink wrote:
>> On 22-3-2015 00:12, John Hendrikx wrote:
>>> What I do need however is a way to restore the control to the exact same state it was in before (the same amount of pixels scrolled, the same item at the top, the same item at the bottom).

I was thinking; maybe you are approaching this from the wrong angle by trying to break open the controls. How about inspecting the node tree, after it has been constructed (all skins have created their nodes)? After all, a ListView will insert a scrollpane into the tree, which will insert a scrollbar. You could analyze the resulting node tree and search for the scrollbars, then record their scroll values.

The trick would be to identify the correct one again to reset the value. You may be able to derrive an identifier from the tree path to the scrollbar, assuming it would be identical before and after. Or maybe better, you could place a UUID in the node's properties and also use that UUID for storing the recorded values. Could that work?


More information about the openjfx-dev mailing list