void (DataContext context) { Editor editor = CommonDataKeys.EDITOR.getData(context); if (editor != null) { EditorActionManager.getInstance(); final TypedAction typedAction = TypedAction.getInstance(); for (final char aChar : myText.toCharArray()) { typedAction.actionPerformed(editor, aChar, context); } } }