use of com.evolveum.midpoint.gui.api.component.progressbar.ProgressbarPanel in project midpoint by Evolveum.
the class InfoBoxPanel method initLayout.
private void initLayout(final IModel<InfoBoxType> model, final Class<? extends IRequestablePage> linkPage) {
WebMarkupContainer infoBox = new WebMarkupContainer(ID_INFO_BOX);
add(infoBox);
infoBox.add(AttributeModifier.append("class", new PropertyModel<String>(model, InfoBoxType.BOX_BACKGROUND_COLOR)));
WebMarkupContainer infoBoxIcon = new WebMarkupContainer(ID_INFO_BOX_ICON);
infoBox.add(infoBoxIcon);
infoBoxIcon.add(AttributeModifier.append("class", new PropertyModel<String>(model, InfoBoxType.ICON_BACKGROUND_COLOR)));
WebMarkupContainer image = new WebMarkupContainer(ID_IMAGE_ID);
image.add(AttributeModifier.append("class", new PropertyModel<String>(model, InfoBoxType.IMAGE_ID)));
infoBoxIcon.add(image);
Label message = new Label(ID_MESSAGE, new PropertyModel<String>(model, InfoBoxType.MESSAGE));
infoBox.add(message);
Label number = new Label(ID_NUMBER, new PropertyModel<String>(model, InfoBoxType.NUMBER));
infoBox.add(number);
WebMarkupContainer progress = new WebMarkupContainer(ID_PROGRESS);
infoBox.add(progress);
progress.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return model.getObject().getProgress() != null;
}
});
ProgressbarPanel progressBar = new ProgressbarPanel(ID_PROGRESS_BAR, new PropertyModel<Integer>(model, InfoBoxType.PROGRESS));
progress.add(progressBar);
Label description = new Label(ID_DESCRIPTION, new PropertyModel<String>(model, InfoBoxType.DESCRIPTION));
infoBox.add(description);
if (linkPage != null) {
add(new AjaxEventBehavior("click") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
setResponsePage(linkPage);
}
});
}
}
use of com.evolveum.midpoint.gui.api.component.progressbar.ProgressbarPanel in project midpoint by Evolveum.
the class BasicInfoBoxPanel method customInitLayout.
@Override
protected void customInitLayout(WebMarkupContainer parentInfoBox, IModel<InfoBoxType> model, Class<? extends IRequestablePage> linkPage) {
WebMarkupContainer progress = new WebMarkupContainer(ID_PROGRESS);
parentInfoBox.add(progress);
progress.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return model.getObject() != null && model.getObject().getProgress() != null;
}
});
ProgressbarPanel progressBar = new ProgressbarPanel(ID_PROGRESS_BAR, new PropertyModel<>(model, InfoBoxType.PROGRESS));
progress.add(progressBar);
Label description = new Label(ID_DESCRIPTION, new PropertyModel<String>(model, InfoBoxType.DESCRIPTION));
parentInfoBox.add(description);
if (linkPage != null) {
add(new AjaxEventBehavior("click") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
setResponsePage(linkPage);
}
});
}
}
Aggregations