projectVersionEditPopup = new ProjectVersionFormPopupPanel("projectVersionEditPopup", FormPanelMode.EDIT);
add(projectVersionEditPopup);
// Add action
Button addButton = new AuthenticatedOnlyButton("add") {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(MavenArtifactNotifierSession.get().hasRoleAdmin());
}
};
addButton.add(new AjaxModalOpenBehavior(projectVersionAddPopup, MouseEvent.CLICK));
add(addButton);
// Versions
IModel<Set<ProjectVersion>> setModel = BindingModel.of(getModel(), Binding.project().versions());
add(new ListView<ProjectVersion>("projectVersions", CollectionToListWrapperModel.of(setModel)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<ProjectVersion> item) {
item.add(new ArtifactVersionTagPanel("version", BindingModel.of(item.getModel(), Binding.projectVersion().version())));
item.add(new DateLabel("lastUpdateDate", BindingModel.of(item.getModel(), Binding.projectVersion().lastUpdateDate()),
DatePattern.SHORT_DATE));
// Changelog link
item.add(new HideableExternalLink("changelogLink",
BindingModel.of(item.getModel(), Binding.projectVersion().additionalInformation().changelogUrl().url())));
// Release notes link
item.add(new HideableExternalLink("releaseNotesLink",
BindingModel.of(item.getModel(), Binding.projectVersion().additionalInformation().releaseNotesUrl().url())));
// Announce link
item.add(new HideableExternalLink("announceLink",
BindingModel.of(item.getModel(), Binding.projectVersion().additionalInformation().announceUrl().url())));
// Status
item.add(new BooleanIcon("centralAvailability", new LoadableDetachableModel<Boolean>() {
private static final long serialVersionUID = 1L;
@Override
protected Boolean load() {
IModel<ProjectVersionStatus> statusModel = BindingModel.of(item.getModel(), Binding.projectVersion().status());
return ProjectVersionStatus.PUBLISHED_ON_MAVEN_CENTRAL.equals(statusModel.getObject());
}
}));
// Edit action
Button editButton = new AuthenticatedOnlyButton("edit");
editButton.add(new AjaxModalOpenBehavior(projectVersionEditPopup, MouseEvent.CLICK) {
private static final long serialVersionUID = 1L;
@Override
protected void onShow(AjaxRequestTarget target) {
super.onShow(target);