protected void moveLeftToRight ( ) { // Loop over the selected items and locate them in the data model, Add // these to the selection. Object [ ] sourceSelected = sourceList . getSelectedValues ( ) ; int nSourceSelected = sourceSelected . length ; int [ ] currentSelection = helperList . getSelectedIndices ( ) ; int [ ] newSelection = new int [ currentSelection . length + nSourceSelected ] ; System . arraycopy ( currentSelection , 0 , newSelection , 0 , currentSelection . length ) ; int destPos = currentSelection . length ; for ( int i = 0 ; i < sourceSelected . length ; i ++ ) { newSelection [ destPos ++ ] = indexOf ( sourceSelected [ i ] ) ; } helperList . setSelectedIndices ( newSelection ) ; update ( ) ; }
Move the selected items in the source list to the chosen list . I . e . add the items to our selection model .