@Override public final void format(final IDocument medium, final IRegion region) { final FormattingContext context= new FormattingContext(); context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.FALSE); context.setProperty(FormattingContextProperties.CONTEXT_REGION, region); format(medium, context); }
@Override public int compareTo(PositionReference r) { return getCharacterPosition() - r.getCharacterPosition(); } }
@Override public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fDocuments.addLast((IDocument) context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); }
@Override public void format(IDocument document, IRegion region) { fNeedsComputation= true; fDocument= document; try { if (fIsPartitionAware) formatPartitions(region); else formatRegion(region); } finally { fNeedsComputation= true; fDocument= null; } }
/** * 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>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); } }
/** * Creates a new formatting context for a format operation. * <p> * After the use of the context, clients are required to call * its <code>dispose</code> method. * * @return The new formatting context * @since 3.0 */ protected IFormattingContext createFormattingContext() { return new FormattingContext(); }
public void formatterStarts(IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); }
@Override public final void format(final IDocument medium, final IRegion region) { final FormattingContext context= new FormattingContext(); context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.FALSE); context.setProperty(FormattingContextProperties.CONTEXT_REGION, region); format(medium, context); }
@Override public void format(IDocument document, IRegion region) { fNeedsComputation= true; fDocument= document; try { if (fIsPartitionAware) formatPartitions(region); else formatRegion(region); } finally { fNeedsComputation= true; fDocument= null; } }
/** * 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(); } }
@Override public int compareTo(PositionReference r) { return getCharacterPosition() - r.getCharacterPosition(); } }
/** * Creates a new formatting context for a format operation. * <p> * After the use of the context, clients are required to call * its <code>dispose</code> method. * * @return The new formatting context * @since 3.0 */ protected IFormattingContext createFormattingContext() { return new FormattingContext(); }
@Override public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast((TypedPosition) context.getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast((IDocument) context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); }
@Override public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast((TypedPosition) context.getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast((IDocument) context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); }
@Override public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast((TypedPosition) context.getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast((IDocument) context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); fPaths.addLast((String) context.getProperty(JavaFormattingContext.KEY_SOURCE_PATH)); }
public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast(context.getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); }
public void formatterStarts(final IFormattingContext context) { super.formatterStarts(context); fPartitions.addLast(context .getProperty(FormattingContextProperties.CONTEXT_PARTITION)); fDocuments.addLast(context .getProperty(FormattingContextProperties.CONTEXT_MEDIUM)); }