IDocument doc = ((ITextEditor)iep).getDocumentProvider().getDocument(iep.getEditorInput());
ITextEditor ite = (ITextEditor)iep;
ISelection sel = ite.getSelectionProvider().getSelection();
//int cursorOffset = ((ITextSelection)sel).getOffset();
//int selectionLength = ((ITextSelection)sel).getLength();
Encloser encloser = new Encloser();
encloser.enclose(doc,(ITextSelection)sel,selectedMethod.getInsertString(),"");
}
}