.setResourceDescription(description)
.setSecurityContext(securityContext);
ModelNodeFormBuilder.FormAssets assets = builder.build();
final ModelNodeForm form = assets.getForm();
form.setEnabled(true);
if(form.hasWritableAttributes()) {
final DefaultWindow window = new DefaultWindow("Create Resource '" + type + "'");
window.addStyleName("browser-view");
DialogueOptions options = new DialogueOptions(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// save
FormValidation validation = form.validate();
if(!validation.hasErrors())
{
presenter.onAddChildResource(address, form.getUpdatedEntity());
window.hide();
}
}
}, new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// cancel
window.hide();
}
});
VerticalPanel layout = new VerticalPanel();
layout.setStyleName("fill-layout-width");
ModelNode opDescription = description.get("operations").get("add").get("description");
ContentDescription text = new ContentDescription(opDescription.asString());
layout.add(text);
layout.add(form.asWidget());
WindowContentBuilder content = new WindowContentBuilder(layout, options);
window.trapWidget(content.build());
window.setGlassEnabled(true);
window.setWidth(480);