package tool.editors.method;
import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.ISourceViewer;
import tool.editors.ColorManager;
import tool.editors.ToolAutoEditStrategy;
import tool.editors.ToolSourceViewerConfiguration;
public class MethodSourceViewerConfiguration extends
ToolSourceViewerConfiguration {
public MethodSourceViewerConfiguration(ColorManager colorManager) {
super(colorManager);
}
@Override
public IAutoEditStrategy[] getAutoEditStrategies(
ISourceViewer sourceViewer, String contentType) {
IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE
.equals(contentType) ? new MethodAutoEditStrategy()
: new DefaultIndentLineAutoEditStrategy());
return new IAutoEditStrategy[] { strategy };
}
}