Search in sources :

Example 1 with GetUsers

use of cz.metacentrum.perun.webgui.json.searcher.GetUsers in project perun by CESNET.

the class SearcherTabItem method loadUsersTab.

private Widget loadUsersTab() {
    // request
    final GetUsers request = new GetUsers();
    // MAIN TAB PANEL
    VerticalPanel firstTabPanel = new VerticalPanel();
    firstTabPanel.setSize("100%", "100%");
    PerunSearchParametersWidget params = new PerunSearchParametersWidget(PerunEntity.USER, 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<User> table = request.getEmptyTable(new FieldUpdater<User, String>() {

        public void update(int index, User object, String value) {
            // opens the tab
            session.getTabManager().addTab(new UserDetailTabItem(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 : User(cz.metacentrum.perun.webgui.model.User) UserDetailTabItem(cz.metacentrum.perun.webgui.tabs.userstabs.UserDetailTabItem) GetUsers(cz.metacentrum.perun.webgui.json.searcher.GetUsers) PerunSearchParametersWidget(cz.metacentrum.perun.webgui.widgets.PerunSearchParametersWidget)

Aggregations

GetUsers (cz.metacentrum.perun.webgui.json.searcher.GetUsers)1 User (cz.metacentrum.perun.webgui.model.User)1 UserDetailTabItem (cz.metacentrum.perun.webgui.tabs.userstabs.UserDetailTabItem)1 PerunSearchParametersWidget (cz.metacentrum.perun.webgui.widgets.PerunSearchParametersWidget)1