/** * Fires <code>formatterStops</code> to all formatter strategies which were * involved in the formatting process which is about to terminate. * * @param regions the partitioning of the document which has been formatted */ private void stop(TypedPosition[] regions) { for (TypedPosition region : regions) { IFormattingStrategy s= getFormattingStrategy(region.getType()); if (s != null) s.formatterStops(); } }
/** * Fires <code>formatterStops</code> to all formatter strategies which were * involved in the formatting process which is about to terminate. * * @param regions the partitioning of the document which has been formatted */ private void stop(TypedPosition[] regions) { for (int i= 0; i < regions.length; i++) { IFormattingStrategy s= getFormattingStrategy(regions[i].getType()); if (s != null) s.formatterStops(); } }
/** * Fires <code>formatterStarts</code> to all formatter strategies * which will be involved in the forthcoming formatting process. * * @param regions the partitioning of the document to be formatted * @param indentation the initial indentation */ private void start(TypedPosition[] regions, String indentation) { for (TypedPosition region : regions) { IFormattingStrategy s= getFormattingStrategy(region.getType()); if (s != null) s.formatterStarts(indentation); } }
/** * Fires <code>formatterStarts</code> to all formatter strategies * which will be involved in the forthcoming formatting process. * * @param regions the partitioning of the document to be formatted * @param indentation the initial indentation */ private void start(TypedPosition[] regions, String indentation) { for (int i= 0; i < regions.length; i++) { IFormattingStrategy s= getFormattingStrategy(regions[i].getType()); if (s != null) s.formatterStarts(indentation); } }
/** * Formats one partition after the other using the formatter strategy registered for * the partition's content type. * * @param ranges the partitioning of the document region to be formatted * @since 3.0 */ private void format(TypedPosition[] ranges) { for (TypedPosition range : ranges) { IFormattingStrategy s= getFormattingStrategy(range.getType()); if (s != null) { format(s, range); } } }
/** * Formats one partition after the other using the formatter strategy registered for * the partition's content type. * * @param ranges the partitioning of the document region to be formatted * @since 3.0 */ private void format(TypedPosition[] ranges) { for (int i= 0; i < ranges.length; i++) { IFormattingStrategy s= getFormattingStrategy(ranges[i].getType()); if (s != null) { format(s, ranges[i]); } } }
/** * Formats the given region with the strategy registered for the default * content type. The strategy is informed about the start, the process, and * the termination of the formatting session. * * @param region the region to be formatted * @since 3.0 */ private void formatRegion(IRegion region) { IFormattingStrategy strategy= getFormattingStrategy(IDocument.DEFAULT_CONTENT_TYPE); if (strategy != null) { strategy.formatterStarts(getIndentation(region.getOffset())); format(strategy, new TypedPosition(region.getOffset(), region.getLength(), IDocument.DEFAULT_CONTENT_TYPE)); strategy.formatterStops(); } }
/** * Formats the given region with the strategy registered for the default * content type. The strategy is informed about the start, the process, and * the termination of the formatting session. * * @param region the region to be formatted * @since 3.0 */ private void formatRegion(IRegion region) { IFormattingStrategy strategy= getFormattingStrategy(IDocument.DEFAULT_CONTENT_TYPE); if (strategy != null) { strategy.formatterStarts(getIndentation(region.getOffset())); format(strategy, new TypedPosition(region.getOffset(), region.getLength(), IDocument.DEFAULT_CONTENT_TYPE)); strategy.formatterStops(); } }