-package jp.sourceforge.moreemacs.handlers;\r
-\r
-import org.eclipse.jface.text.BadLocationException;\r
-\r
-public abstract class ConvertWordExecution extends TextEditorExecution {\r
-\r
- @Override\r
- public void execute() throws BadLocationException {\r
- if(!textEditor.isEditable()) {\r
- return;\r
- }\r
- \r
- int current = cursor.offset();\r
- int next = ForwardWordExecution.getNextWordPosition(doc, current);\r
- String word = doc.get(current, next-current);\r
- String convertedWord = convert(word);\r
- doc.replace(current, next-current, convertedWord);\r
- cursor.move(current + convertedWord.length());\r
- }\r
- \r
- protected abstract String convert(String word);\r
-}\r
+package jp.sourceforge.moreemacs.handlers;
+
+import org.eclipse.jface.text.BadLocationException;
+
+public abstract class ConvertWordExecution extends TextEditorExecution {
+
+ @Override
+ public void execute() throws BadLocationException {
+ if(!textEditor.isEditable()) {
+ return;
+ }
+
+ int current = cursor.offset();
+ int next = ForwardWordExecution.getNextWordPosition(doc, current);
+ String word = doc.get(current, next-current);
+ String convertedWord = convert(word);
+ doc.replace(current, next-current, convertedWord);
+ cursor.move(current + convertedWord.length());
+ }
+
+ protected abstract String convert(String word);
+}