WebMarkupContainer newVersionsTable = new CustomWebMarkupContainer("newVersionsTable", STYLE_TABLE);
contentContainer.add(newVersionsTable);
// > Headers
WebMarkupContainer groupIdHeader = new CustomWebMarkupContainer("groupIdHeader", STYLE_TABLE_TH);
groupIdHeader.add(new StyleAttributeAppender(STYLE_TABLE_TOP_LEFT_RADIUS));
newVersionsTable.add(groupIdHeader);
newVersionsTable.add(new CustomWebMarkupContainer("artifactIdHeader", STYLE_TABLE_TH));
WebMarkupContainer versionHeader = new CustomWebMarkupContainer("versionHeader", STYLE_TABLE_TH);
versionHeader.add(new StyleAttributeAppender(STYLE_TABLE_TOP_RIGHT_RADIUS));
newVersionsTable.add(versionHeader);
// > Content
newVersionsTable.add(new ListView<ArtifactVersionNotification>("newVersions", getModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ArtifactVersionNotification> item) {
ArtifactVersion version = item.getModelObject().getArtifactVersion();
IModel<ArtifactVersionNotification> versionNotificationModel = item.getModel();
Label groupId = new CustomLabel("groupId", BindingModel.of(versionNotificationModel,
Binding.artifactVersionNotification().artifactVersion().artifact().group().groupId()), STYLE_TABLE_TD);
if (item.getIndex() == NewVersionsHtmlNotificationPanel.this.getModelObject().size() - 1) {
groupId.add(new StyleAttributeAppender(STYLE_TABLE_BOTTOM_LEFT_RADIUS));
}
item.add(groupId);
WebMarkupContainer artifactIdContainer = new CustomWebMarkupContainer("artifactIdContainer", STYLE_TABLE_TD);
item.add(artifactIdContainer);
ExternalLink artifactIdLink = new ExternalLink("artifactIdLink",
notificationUrlBuilderService.getArtifactDescriptionUrl(version.getArtifact()));
artifactIdLink.add(new StyleAttributeAppender(STYLE_LINK));
artifactIdLink.add(new Label("artifactIdLabel", BindingModel.of(versionNotificationModel,
Binding.artifactVersionNotification().artifactVersion().artifact().artifactId())));
artifactIdContainer.add(artifactIdLink);
WebMarkupContainer versionContainer = new CustomWebMarkupContainer("versionContainer", STYLE_TABLE_TD);