コード例 #1
0
 @NotNull
 public int[] getSelectedIndices() {
   Object[] values = myList.getSelectedValues();
   int[] result = new int[values.length];
   for (int i = 0, length = values.length; i < length; i++) {
     result[i] = ((Item) values[i]).index;
   }
   return result;
 }
コード例 #2
0
 @NotNull
 public String getSelectedText() {
   StringBuilder sb = new StringBuilder();
   boolean first = true;
   for (Object o : myList.getSelectedValues()) {
     if (first) first = false;
     else sb.append("\n");
     String s = ((Item) o).longText;
     sb.append(StringUtil.convertLineSeparators(s));
   }
   return sb.toString();
 }
コード例 #3
0
 protected Object[] getSelectedRoots() {
   return myList.getSelectedValues();
 }