private void setLayout() {
final BundleDeployment live = this.wizard.getLiveDeployment();
final BundleDeployment prev = this.wizard.getPreviousDeployment();
DynamicForm liveForm = new DynamicForm();
liveForm.setNumCols(2);
liveForm.setIsGroup(true);
liveForm.setGroupTitle("<b>" + MSG.view_bundle_revertWizard_confirmStep_liveDeployment() + "<b>");
StaticTextItem liveNameItem = new StaticTextItem("liveName", MSG.common_title_name());
liveNameItem.setTitleAlign(Alignment.LEFT);
liveNameItem.setAlign(Alignment.LEFT);
liveNameItem.setWrap(false);
liveNameItem.setWrapTitle(false);
liveNameItem.setValue(live.getName());
liveNameItem.setLeft(20);
StaticTextItem liveDescItem = new StaticTextItem("liveDesc", MSG.common_title_description());
liveDescItem.setTitleAlign(Alignment.LEFT);
liveDescItem.setAlign(Alignment.LEFT);
liveDescItem.setWrap(true);
liveDescItem.setWrapTitle(false);
liveDescItem.setVAlign(VerticalAlignment.TOP);
liveDescItem.setTitleVAlign(VerticalAlignment.TOP);
liveDescItem.setValue((null != live.getDescription()) ? live.getDescription() : MSG.common_val_none());
StaticTextItem liveVersionItem = new StaticTextItem("liveVersion", MSG.view_bundle_bundleVersion());
liveVersionItem.setTitleAlign(Alignment.LEFT);
liveVersionItem.setAlign(Alignment.LEFT);
liveVersionItem.setWrap(false);
liveVersionItem.setWrapTitle(false);
liveVersionItem.setValue(live.getBundleVersion().getVersion());
liveForm.setItems(liveNameItem, liveVersionItem, liveDescItem);
layout.addMember(liveForm);
if (prev != null) {
final DynamicForm prevForm = new DynamicForm();
prevForm.setNumCols(2);
prevForm.setIsGroup(true);
prevForm.setGroupTitle("<b>" + MSG.view_bundle_revertWizard_confirmStep_prevDeployment() + "<b>");
StaticTextItem prevNameItem = new StaticTextItem("prevName", MSG.common_title_name());
prevNameItem.setTitleAlign(Alignment.LEFT);
prevNameItem.setAlign(Alignment.LEFT);
prevNameItem.setWrap(false);
prevNameItem.setWrapTitle(false);
prevNameItem.setValue(prev.getName());
StaticTextItem prevDescItem = new StaticTextItem("prevDesc", MSG.common_title_description());
prevDescItem.setTitleAlign(Alignment.LEFT);
prevDescItem.setAlign(Alignment.LEFT);
prevDescItem.setWrap(true);
prevDescItem.setWrapTitle(false);
prevDescItem.setTitleVAlign(VerticalAlignment.TOP);
prevDescItem.setVAlign(VerticalAlignment.TOP);
prevDescItem.setValue((null != prev.getDescription()) ? prev.getDescription() : MSG.common_val_none());
final StaticTextItem prevVersionItem = new StaticTextItem("prevVersion", MSG.view_bundle_bundleVersion());
prevVersionItem.setTitleAlign(Alignment.LEFT);
prevVersionItem.setAlign(Alignment.LEFT);
prevVersionItem.setWrap(false);
prevVersionItem.setWrapTitle(false);
if (prev.getBundleVersion().getVersion() == null) {
BundleVersionCriteria c = new BundleVersionCriteria();
c.addFilterId(prev.getBundleVersion().getId());
bundleServer.findBundleVersionsByCriteria(c, new AsyncCallback<PageList<BundleVersion>>() {
@Override
public void onSuccess(PageList<BundleVersion> result) {
if (result != null && result.size() == 1) {
prevVersionItem.setValue(result.get(0).getVersion());
prevForm.markForRedraw();
}
}
@Override
public void onFailure(Throwable caught) {
prevVersionItem.setValue("?");
prevForm.markForRedraw();
}
});
} else {
prevVersionItem.setValue(prev.getBundleVersion().getVersion());
}
prevForm.setItems(prevNameItem, prevVersionItem, prevDescItem);
layout.addMember(prevForm);
}
Label confirmation = new Label();
confirmation.setContents("<b>" + MSG.view_bundle_revertWizard_confirmStep_confirmation() + "</b>");