]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/ReplaceTabsBySpaces.java
a01295dcbfdce20003b302662a77425ebe67434f
[simantics/platform.git] / bundles / org.simantics.scl.ui / src / org / simantics / scl / ui / editor / ReplaceTabsBySpaces.java
1 package org.simantics.scl.ui.editor;
2
3 import org.eclipse.jface.text.DocumentCommand;
4 import org.eclipse.jface.text.IAutoEditStrategy;
5 import org.eclipse.jface.text.IDocument;
6
7 public class ReplaceTabsBySpaces implements IAutoEditStrategy {
8
9         public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
10                 if (c.length == 0 && c.text != null && c.text.indexOf('\t') >= 0) {
11                         c.text = c.text.replace("\t", "    ");
12                 }               
13         }
14         
15 }