use of cz.metacentrum.perun.webgui.json.searcher.GetResources in project perun by CESNET.
the class SearcherTabItem method loadResourcesTab.
private Widget loadResourcesTab() {
// request
final GetResources request = new GetResources();
// MAIN TAB PANEL
VerticalPanel firstTabPanel = new VerticalPanel();
firstTabPanel.setSize("100%", "100%");
PerunSearchParametersWidget params = new PerunSearchParametersWidget(PerunEntity.RESOURCE, 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<Resource> table = request.getEmptyTable(new FieldUpdater<Resource, String>() {
public void update(int index, Resource object, String value) {
// opens the tab
session.getTabManager().addTab(new ResourceDetailTabItem(object.getId(), object.getFacilityId()));
}
});
// 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