コード例 #1
0
 public void forceInitFromModel() {
   final int[] selection = myEntryTable.getSelectedRows();
   myModel.clear();
   myModel.init();
   myModel.fireTableDataChanged();
   TableUtil.selectRows(myEntryTable, selection);
 }
コード例 #2
0
 public void forceInitFromModel() {
   Set<ClasspathTableItem<?>> oldSelection = new HashSet<ClasspathTableItem<?>>();
   for (int i : myEntryTable.getSelectedRows()) {
     ContainerUtil.addIfNotNull(getItemAt(i), oldSelection);
   }
   myModel.clear();
   myModel.init();
   myModel.fireTableDataChanged();
   TIntArrayList newSelection = new TIntArrayList();
   for (int i = 0; i < myModel.getRowCount(); i++) {
     if (oldSelection.contains(getItemAt(i))) {
       newSelection.add(i);
     }
   }
   TableUtil.selectRows(myEntryTable, newSelection.toNativeArray());
 }