1 11 12 package org.eclipse.jface.text.formatter; 13 14 import java.util.LinkedList ; 15 import java.util.Map ; 16 17 25 public abstract class ContextBasedFormattingStrategy implements IFormattingStrategy, IFormattingStrategyExtension { 26 27 28 private Map fCurrentPreferences= null; 29 30 31 private final LinkedList fPreferences= new LinkedList (); 32 33 36 public void format() { 37 fCurrentPreferences= (Map )fPreferences.removeFirst(); 38 } 39 40 43 public String format(String content, boolean start, String indentation, int[] positions) { 44 return null; 45 } 46 47 50 public void formatterStarts(final IFormattingContext context) { 51 fPreferences.addLast(context.getProperty(FormattingContextProperties.CONTEXT_PREFERENCES)); 52 } 53 54 57 public void formatterStarts(final String indentation) { 58 } 60 61 64 public void formatterStops() { 65 fPreferences.clear(); 66 67 fCurrentPreferences= null; 68 } 69 70 75 public final Map getPreferences() { 76 return fCurrentPreferences; 77 } 78 } 79 | Popular Tags |