} else {
styleName = null;
}
// build and returns the link, but disable it if the style is the default
SimpleAjaxLink link = new SimpleAjaxLink( id, new Model(styleName)) {
@Override
public void onClick(AjaxRequestTarget target) {
popupWindow.setInitialHeight( 375 );
popupWindow.setInitialWidth( 525 );
popupWindow.setTitle(new ParamResourceModel("chooseStyle", this));
popupWindow.setContent( new StyleListPanel( popupWindow.getContentId() ) {
@Override
protected void handleStyle(StyleInfo style, AjaxRequestTarget target) {
popupWindow.close( target );
LayerGroupEntry entry = (LayerGroupEntry) itemModel.getObject();
entry.setStyle( style );
//redraw
target.addComponent( layerTable );
}
});
popupWindow.show(target);
}
};
link.getLink().setEnabled(!defaultStyle);
return link;
}