public void processInput(BridgeComponentPeer peer, BridgeInputContext context, Map inputForm) throws InputException
{
if (hasEvent(peer, inputForm))
{
Object indicesObj = inputForm.get(peer.getId());
List l = (List) peer.getComponentObject();
BitSet selected = new BitSet(l.getItemCount());
if (indicesObj instanceof String)
{
int i = Integer.parseInt((String) indicesObj);
selected.set(i, true);
} else if (indicesObj instanceof Object[])
{
Object[] indicesStr = (Object[]) indicesObj;
for (int i = 0; i < indicesStr.length; i++)
{
int set = Integer.parseInt(indicesStr[i].toString());
selected.set(set, true);
}
}
try
{
int event = 0;
for (int i = 0; i < l.getItemCount(); i++)
{
if (selected.get(i))
{
if (!l.isIndexSelected(i))
{
event = 1;
l.select(i);
_logger.finest("made " + i + " selected" + l.isIndexSelected(i));
} //else ignore
} else //not selected
if (l.isIndexSelected(i))
{
event = -1;
l.deselect(i);
_logger.finest("made " + i + " deselected " + l.isIndexSelected(i));
}
}
//the firing of event could be random
//when there's no listener to this list component
//because the user could do several selection/deselection