jrubyfx
jrubyfx copied to clipboard
Override enum & enum-like value comparison
> jfxObject.enum_prop = :enum_value
> jfxObject.enum_prop == :enum_value
false
> jfxObject.enum_prop == EnumType::EnumValue
true
This is the current behavior pattern of enums. We need to override comparisons so that it meets expectations. This can probbably go with the enum injection code in dsl.rb. Annoys me the most often with KeyCodes
This is also a problem for all symbol-based values or at least we might also consider those to be a problem. Should:
button(fill: :gree)
#...
button.fill == :green
I know this is a specific issue only for enums but we might want to consider tackling all values or at least why enums make more sense to work than values themselves.
Yes, I meant everything that uses that style