Originally posted by Rob Prime:
The selection should be either ALL, or any combination of INDIA, US and UK. So:
- if ALL is selected that should be the only selection
- if INDIA, US or UK is selected, any other can be selected except ALL
So the second case does allow for multiple selection.
Here's a quick-and-dirty selection model that almost does this, but differs when the user tries to add ALL to a non-empty selection. Instead of preventing ALL from being selected, this code selects the ALL but deselects everything else.
As you can see, a custom selection model can pretty much control everything, which is why I thought perhaps Mr. Godbole intended to recommend setSelectionModel() instead of setSelectionMode().