[ 
https://issues.apache.org/jira/browse/PIVOT-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12897499#action_12897499
 ] 

Greg Brown commented on PIVOT-569:
----------------------------------

After some additional thought, I think that explicit listener methods for these 
events is the right approach. It is more consistent with existing events, and, 
more importantly, these events are not redundant - they simply represent a 
different use case.

For example: ListView selection listeners must currently listen for 
selectedRangesChanged() even when the list is in single-select mode. A 
selectedItemChanged() event would probably make a lot more sense to those 
callers, since multiple ranges will never be selected. 

Another (existing) example is TextInputTextListener - this interface contains 
an ostensibly redundant textChanged() method that is called any time the text 
input's text changes. Callers could listen for charactersInserted() and 
charactersRemoved() directly, but this wouldn't be as convenient. The 
selectedRangesChanged() event in ListViewSelectionListener and 
TableViewSelectionListener behaves similarly.

Given that there are existing similar examples, and that tying 
selectedItemChanged() directly to selectedIndexChanged() would result in 
spurious events (when the selected index changes indirectly due to a model 
change), I think I would recommend not using an annotation here.


> Make ListView selectedItem, etc. notifying properties
> -----------------------------------------------------
>
>                 Key: PIVOT-569
>                 URL: https://issues.apache.org/jira/browse/PIVOT-569
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Greg Brown
>            Assignee: Greg Brown
>            Priority: Minor
>             Fix For: 2.0
>
>
> These properties don't currently fire events when they change, so it is not 
> possible to dynamically bind to them using namespace bindings.
> Note that they should only fire when selectMode == SINGLE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to