Ejemplo n.º 1
0
 /**
  * Sets the list items as selected / not selected based on the indices in an array.
  *
  * @param indices Array containing the selected indices.
  */
 public void setSelectedIndices(int[] indices) {
   if (indices.length > 0) {
     list.setSelectedIndex(indices[0]);
   }
 }
Ejemplo n.º 2
0
 /**
  * Returns an array containing the indices of selected list items
  *
  * @return Array containing the selected indices.
  */
 public int[] getSelectedIndices() {
   return new int[] {list.getSelectedIndex()};
 }