void (int startIndex) { myEditor.getCaretModel().moveToOffset(startIndex); DataContext dataContext = DataManager.getInstance().getDataContext(EditorComponentImpl.this); PasteProvider pasteProvider = myEditor.getPasteProvider(); if (pasteProvider.isPasteEnabled(dataContext)) { pasteProvider.performPaste(dataContext); } }