void (@NotNull Editor editor, int offset) { Document document = editor.getDocument(); document.insertString(offset, "{"); insertCloseBrace(editor, offset + 1); } protected void insertCloseBrace(@NotNull Editor editor, int offset) { Document document = editor.getDocument(); document.insertString(offset, "}"); }