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));
}
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;
}
Aggregations