jrubyfx icon indicating copy to clipboard operation
jrubyfx copied to clipboard

Override enum & enum-like value comparison

Open byteit101 opened this issue 12 years ago • 2 comments

> 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

byteit101 avatar Apr 20 '13 17:04 byteit101

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.

enebo avatar Apr 22 '13 14:04 enebo

Yes, I meant everything that uses that style

byteit101 avatar Apr 22 '13 14:04 byteit101