Search in sources :

Example 1 with RowData

use of com.extjs.gxt.ui.client.widget.layout.RowData in project activityinfo by bedatadriven.

the class LocationFilterPanel method createList.

private void createList() {
    ListLoader filterLoader = new BaseListLoader(new LocationProxy());
    ListStore<LocationDTO> filterComboboxStore = new ListStore<>(filterLoader);
    filterCombobox = new ComboBox<>();
    filterCombobox.setEmptyText(I18N.CONSTANTS.searchForLocationToAdd());
    filterCombobox.setDisplayField("name");
    filterCombobox.setStore(filterComboboxStore);
    filterCombobox.setUseQueryCache(false);
    filterCombobox.setTypeAhead(true);
    filterCombobox.setTypeAheadDelay(120);
    filterCombobox.setQueryDelay(100);
    filterCombobox.addSelectionChangedListener(new SelectionChangedListener<LocationDTO>() {

        @Override
        public void selectionChanged(SelectionChangedEvent<LocationDTO> se) {
            if (se.getSelectedItem() != null && !store.contains(se.getSelectedItem())) {
                store.add(se.getSelectedItem());
                filterToolBar.setApplyFilterEnabled(true);
                // reset typed filter
                filterCombobox.setRawValue("");
            }
        }
    });
    listView = new ListView<>();
    listView.setStore(store);
    listView.setDisplayProperty("name");
    listView.setSelectionModel(listSelectionModel);
    add(filterCombobox, new RowData(1, -1));
    add(listView, new RowData(1, 1));
}
Also used : ListStore(com.extjs.gxt.ui.client.store.ListStore) RowData(com.extjs.gxt.ui.client.widget.layout.RowData) LocationDTO(org.activityinfo.legacy.shared.model.LocationDTO)

Example 2 with RowData

use of com.extjs.gxt.ui.client.widget.layout.RowData 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

RowData (com.extjs.gxt.ui.client.widget.layout.RowData)2 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)1 ListStore (com.extjs.gxt.ui.client.store.ListStore)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 VBoxLayout (com.extjs.gxt.ui.client.widget.layout.VBoxLayout)1 LocationDTO (org.activityinfo.legacy.shared.model.LocationDTO)1