Hacker News new | ask | show | jobs
by kitd 1267 days ago
This looks really cool. Applying a thin layer over parts of the standard library is a very good idea IMO. Reduces the dependency tree but a lot.

One question (my Swing knowledge is at least 15 years old!): what's the simplest way to handle events using this? Eg taking the FormTest [1] example, how might one simply bind a model object to the UI elements?

[1] https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...

3 comments

Added an example demonstrating how to add an action listener to a button:

https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...

I'm not sure it's exactly what you were looking for, but hopefully it is similar enough.

That's great! As I say, my swing experience is very old and it's probably just a case of remembering the basic action framework more than anything else.

But that fits in very nicely with how your library works using with().

Great question. You can do this with a cell consumer (i.e. the with() method). See OrientationTest for an example (e.g. leftToRightButton, rightToLeftButton):

https://github.com/HTTP-RPC/Sierra/blob/master/sierra-test/s...

I should probably add a better example.

I wish there was CDI integration with Swing or JavaFX and you can annotate handlers