>> You should call:
>>
>> tabData.setText("New text for tab");
>> TabPane.setTabData(component, tabData);
>>
>> That will fire the appropriate event.
>
> That's the first thing I tried. It doesn't work because TabPane#setTabData
> will only call the listeners if previousTabData != tabData. I don't change
> the TabData (ButtonData) object, I just change the text property.
That's a good one!
There is a similar issue with List#update(), but there the event is always
fired regardless of equality. I wonder if TabPane#setTabData() (as well as
Button#setButtonData(), etc.) should do the same and always fire the event.
These methods could check for logical equality but:
a) If a property allows null, logical equality checks get kind of ugly.
b) A logical equality check may simply be unnecessary overhead. If a caller has
explicitly invoked a setter for a property, we might reasonably assume that the
caller genuinely wants to update the property's value. Calling an equals()
method on the value in that case just incurs a needless performance hit.
What do you think?
G