Search in sources :

Example 1 with GetFacilities

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;
}
Also used : GetFacilities(cz.metacentrum.perun.webgui.json.searcher.GetFacilities) FacilityDetailTabItem(cz.metacentrum.perun.webgui.tabs.facilitiestabs.FacilityDetailTabItem) Facility(cz.metacentrum.perun.webgui.model.Facility) PerunSearchParametersWidget(cz.metacentrum.perun.webgui.widgets.PerunSearchParametersWidget)

Aggregations

GetFacilities (cz.metacentrum.perun.webgui.json.searcher.GetFacilities)1 Facility (cz.metacentrum.perun.webgui.model.Facility)1 FacilityDetailTabItem (cz.metacentrum.perun.webgui.tabs.facilitiestabs.FacilityDetailTabItem)1 PerunSearchParametersWidget (cz.metacentrum.perun.webgui.widgets.PerunSearchParametersWidget)1