void (AdjustmentEvent e) { if ((scrollBar.getValue() + scrollBar.getVisibleAmount()) >= scrollBar.getMaximum()) { int fromIndex = group.ui.plugins.size(); int toIndex = Math.min(fromIndex + gapSize, group.descriptors.size()); ListPluginComponent lastComponent = group.ui.plugins.get(fromIndex - 1); int uiIndex = getComponentIndex(lastComponent); int eventIndex = myEventHandler.getCellIndex(lastComponent); try { PluginLogo.startBatchMode(); addToGroup(group, group.descriptors.subList(fromIndex, toIndex), uiIndex, eventIndex); } finally { PluginLogo.endBatchMode(); } if (group.descriptors.size() == group.ui.plugins.size()) { scrollBar.removeAdjustmentListener(this); group.clearCallback = null; } uiCallback.run(); } }