private int[] getElementsRows(final Collection<? extends T> elements) { final int[] rows = new int[elements.size()]; int index = 0; for (final T element : elements) { rows[index++] = myTable.convertRowIndexToView(myTableModel.getElementRow(element)); } return rows; }
@Override public void addItems(List<ClasspathTableItem<?>> toAdd) { for (ClasspathTableItem<?> item : toAdd) { myModel.addRow(item); } TIntArrayList toSelect = new TIntArrayList(); for (int i = myModel.getRowCount() - toAdd.size(); i < myModel.getRowCount(); i++) { toSelect.add(myEntryTable.convertRowIndexToView(i)); } TableUtil.selectRows(myEntryTable, toSelect.toNativeArray()); TableUtil.scrollSelectionToVisible(myEntryTable); final StructureConfigurableContext context = ModuleStructureConfigurable.getInstance(myState.getProject()).getContext(); context .getDaemonAnalyzer() .queueUpdate(new ModuleProjectStructureElement(context, getRootModel().getModule())); }