1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.client.console.widgets;
20
21 import org.apache.wicket.AttributeModifier;
22 import org.apache.wicket.behavior.AttributeAppender;
23 import org.apache.wicket.markup.html.WebMarkupContainer;
24 import org.apache.wicket.markup.html.basic.Label;
25 import org.apache.wicket.markup.html.panel.Panel;
26
27 public class ProgressPanel extends Panel {
28
29 private static final long serialVersionUID = -8854916811656228816L;
30
31 public ProgressPanel(final String id, final ProgressBean progressBean) {
32 super(id);
33 setOutputMarkupId(true);
34
35 add(new Label("text", progressBean.getText()));
36 add(new Label("fraction", progressBean.getFraction()));
37 add(new Label("total", progressBean.getTotal()));
38
39 WebMarkupContainer progress = new WebMarkupContainer("progress");
40 progress.add(new AttributeModifier("style", "width: " + progressBean.getPercent() + '%'));
41 progress.add(new AttributeAppender("class", ' ' + progressBean.getCssClass()));
42 add(progress);
43 }
44
45 }