1 package jp.sourceforge.moreemacs.handlers;
3 import org.eclipse.jface.text.BadLocationException;
5 public abstract class ConvertWordExecution extends TextEditorExecution {
8 public void execute() throws BadLocationException {
9 if(!textEditor.isEditable()) {
13 int current = cursor.offset();
14 int next = ForwardWordExecution.getNextWordPosition(doc, current);
15 String word = doc.get(current, next-current);
16 String convertedWord = convert(word);
17 doc.replace(current, next-current, convertedWord);
18 cursor.move(current + convertedWord.length());
21 protected abstract String convert(String word);