コード例 #1
0
ファイル: List.java プロジェクト: andreasbaumann/tomato
 /**
  * Returns an array containing the indexes of the rows that are currently selected.
  *
  * @return A list of indexes of selected rows.
  */
 public synchronized int[] getSelectedIndexes() {
   if (peer != null) {
     ListPeer l = (ListPeer) peer;
     selected = l.getSelectedIndexes();
   }
   return selected;
 }
コード例 #2
0
ファイル: List.java プロジェクト: andreasbaumann/tomato
  /**
   * Returns the index of the currently selected item. -1 will be returned if there are no selected
   * rows or if there are multiple selected rows.
   *
   * @return The index of the selected row.
   */
  public synchronized int getSelectedIndex() {
    if (peer != null) {
      ListPeer l = (ListPeer) peer;
      selected = l.getSelectedIndexes();
    }

    if (selected == null || selected.length > 1) return -1;
    return selected[0];
  }