package jp.sourceforge.projects.ee2e.core.editors;

import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.BadLocationException;

/**
 * To change this generated comment edit the template variable "typecomment":
 * Window&gt;Preferences&gt;Java&gt;Templates.
 * To enable and disable the creation of type comments go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation.
 *
 * @author Toshikazu Ando [ ando@park.ruru.ne.jp ]
 */
public class EE2EIndentText extends EE2EIndentBehavior {
	/** constractor */
	public EE2EIndentText() {
	}

	public static final int INDENT_LEN = 4;

	/**
	* @see jp.sourceforge.projects.ee2e.core.editors.EE2EMenuBehavior#tabDestroyer(AbstractTextEditor, IDocument, ITextSelection)
	*/
	protected void doIndent(int offset, IDocument document)
		throws BadLocationException {
		offset = EE2ELispBase.get().beginningOfLine(offset, document);
		int len = EE2ELispBase.get().indentLen(offset, document);
		len += INDENT_LEN;
        EE2ELispBase.get().indentTo(offset, len, document);
	}
}
