use of com.extjs.gxt.ui.client.widget.layout.VBoxLayout in project activityinfo by bedatadriven.
the class ReportViewRetrier method createRetryPanel.
private static ContentPanel createRetryPanel(final Throwable caught, final ClickHandler retryCallback) {
Button retryButton = new Button(I18N.CONSTANTS.retry());
retryButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if (retryCallback != null) {
retryCallback.onClick(null);
}
}
});
Text label = new Text(ExceptionOracle.getExplanation(caught));
label.setWidth("50%");
VBoxLayout layout = new VBoxLayout(VBoxLayout.VBoxLayoutAlign.CENTER);
ContentPanel panel = new ContentPanel();
panel.setHeaderVisible(false);
panel.setLayout(layout);
panel.add(label, new RowData(1, -1, new Margins(4)));
panel.add(retryButton, new RowData(-1, -1, new Margins(4)));
return panel;
}
Aggregations