private class SnippetRenderer implements ListitemRenderer {
@Override
public void render(Listitem item, Object data) throws Exception {
Snippet snippet = (Snippet) data;
item.setValue(data);
item.appendChild(new Listcell(data.toString()));
// Select snippetCode.snippet in list
SnippetCode snippetCode = snippetCodeModel.getSnippetCode();
if (snippetCode != null && snippetCode.getSnippet() != null
&& snippetCode.getSnippet().getId().equals(snippet.getId())) {
item.setSelected(true);
}
}