new ListView<OAuthServer>("oauthList", getBean(OAuth2Dao.class).getEnabledOAuthServers()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<OAuthServer> item) {
Button btn = new Button("oauthBtn");
Image icon = new Image("icon", new Model<String>());
icon.setVisible(item.getModelObject().getIconUrl() != null &&
!"".equals(item.getModelObject().getIconUrl()));
icon.add(new AttributeModifier("src", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 7257002837120721882L;
@Override
public String getObject() {
return item.getModelObject().getIconUrl();
}
}));
btn.add(icon);
btn.add(new Label("label", item.getModelObject().getName()))
.add(new AjaxEventBehavior("click") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {