use of cz.metacentrum.perun.webgui.json.searcher.GetFacilities in project perun by CESNET.
the class SearcherTabItem method loadFacilitiesTab.
private Widget loadFacilitiesTab() {
// request
final GetFacilities request = new GetFacilities();
// MAIN TAB PANEL
VerticalPanel firstTabPanel = new VerticalPanel();
firstTabPanel.setSize("100%", "100%");
PerunSearchParametersWidget params = new PerunSearchParametersWidget(PerunEntity.FACILITY, new PerunSearchParametersWidget.SearchEvent() {
public void search(Map<String, String> map) {
request.clearParameters();
for (Map.Entry<String, String> entry : map.entrySet()) {
request.addSearchParameter(entry.getKey(), entry.getValue());
}
request.search();
}
});
firstTabPanel.add(params);
// get the table
final CellTable<Facility> table = request.getEmptyTable(new FieldUpdater<Facility, String>() {
public void update(int index, Facility object, String value) {
// opens the tab
session.getTabManager().addTab(new FacilityDetailTabItem(object));
}
});
// add a class to the table and wrap it into scroll panel
table.addStyleName("perun-table");
ScrollPanel sp = new ScrollPanel(table);
sp.addStyleName("perun-tableScrollPanel");
firstTabPanel.add(sp);
session.getUiElements().resizePerunTable(sp, 350, this);
return firstTabPanel;
}
Aggregations