Search in sources :

Example 1 with VBoxLayout

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;
}
Also used : VBoxLayout(com.extjs.gxt.ui.client.widget.layout.VBoxLayout) RowData(com.extjs.gxt.ui.client.widget.layout.RowData) Button(com.extjs.gxt.ui.client.widget.button.Button) ButtonEvent(com.extjs.gxt.ui.client.event.ButtonEvent) Margins(com.extjs.gxt.ui.client.util.Margins) Text(com.extjs.gxt.ui.client.widget.Text) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Aggregations

ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)1 Margins (com.extjs.gxt.ui.client.util.Margins)1 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 Text (com.extjs.gxt.ui.client.widget.Text)1 Button (com.extjs.gxt.ui.client.widget.button.Button)1 RowData (com.extjs.gxt.ui.client.widget.layout.RowData)1 VBoxLayout (com.extjs.gxt.ui.client.widget.layout.VBoxLayout)1