/**
* Constructor.
* @param id the markupId, an html div suffice to host a dialog.
* @param title the title of the dialog
* @param message the message to be displayed
* @param buttons button set to display
* @param icon the predefined icon to display
*/
public MessageDialog(String id, IModel<String> title, IModel<String> message, DialogButtons buttons, DialogIcon icon)
{
super(id, title, message, true);
this.buttons = buttons;
WebMarkupContainer container = new WebMarkupContainer("container");
this.add(container);
container.add(AttributeModifier.append("class", icon.getStyle()));
container.add(new EmptyPanel("icon").add(AttributeModifier.replace("class", icon)));
this.label = new Label("message", this.getModel());
container.add(this.label.setOutputMarkupId(true));
} html
html apache
<html xmlns:wicket="http://wicket.apache.org">
<head>
</head>
<body>
<wicket:panel>
<div wicket:id="container" style="padding: 4px;">
<span wicket:id="icon" style="display: inline-block; margin-right: 0.1em; vertical-align: middle;"></span>
<span wicket:id="message" style="vertical-align: middle;"></span>
</div>
</wicket:panel>
</body>
</html> app