void () { if (!myIsBatchFoldingProcessing) { LOG.error("Fold regions must be added or removed inside batchFoldProcessing() only."); return; } FoldRegion[] regions = getAllFoldRegions(); if (regions.length > 0) { onFoldProcessingStart(); } for (FoldRegion region : regions) { if (!region.isExpanded()) onFoldRegionStateChange(region); beforeFoldRegionRemoved(region); region.dispose(); } doClearFoldRegions(); }