Search in sources :

Example 1 with RichMemberComparator

use of cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator in project perun by CESNET.

the class MemberColumnProvider method addNameColumn.

public void addNameColumn(IsClickableCell authz, int width) {
    // create column
    Column<RichMember, RichMember> nameColumn = JsonUtils.addColumn(new CustomClickableTextCellWithAuthz<RichMember>(authz, "name"), new JsonUtils.GetValue<RichMember, RichMember>() {

        @Override
        public RichMember getValue(RichMember object) {
            return object;
        }
    }, fieldUpdater);
    // add column
    table.addColumn(nameColumn, "Name");
    if (width != 0) {
        table.setColumnWidth(nameColumn, width, Style.Unit.PX);
    }
    // sort column
    nameColumn.setSortable(true);
    table.getColumnSortHandler().setComparator(nameColumn, new RichMemberComparator(RichMemberComparator.Column.USER_FULL_NAME));
}
Also used : JsonUtils(cz.metacentrum.perun.webgui.json.JsonUtils) RichMemberComparator(cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator) RichMember(cz.metacentrum.perun.webgui.model.RichMember)

Example 2 with RichMemberComparator

use of cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator in project perun by CESNET.

the class MemberColumnProvider method addEmailColumn.

public void addEmailColumn(IsClickableCell authz, int width) {
    // create column
    Column<RichMember, RichMember> emailColumn = JsonUtils.addColumn(new CustomClickableTextCellWithAuthz<RichMember>(authz, "email"), new JsonUtils.GetValue<RichMember, RichMember>() {

        @Override
        public RichMember getValue(RichMember object) {
            return object;
        }
    }, fieldUpdater);
    // add column
    table.addColumn(emailColumn, "Email");
    if (width != 0) {
        table.setColumnWidth(emailColumn, width, Style.Unit.PX);
    }
    // sort column
    emailColumn.setSortable(true);
    table.getColumnSortHandler().setComparator(emailColumn, new RichMemberComparator(RichMemberComparator.Column.EMAIL));
}
Also used : JsonUtils(cz.metacentrum.perun.webgui.json.JsonUtils) RichMemberComparator(cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator) RichMember(cz.metacentrum.perun.webgui.model.RichMember)

Example 3 with RichMemberComparator

use of cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator in project perun by CESNET.

the class MemberColumnProvider method addOrganizationColumn.

public void addOrganizationColumn(IsClickableCell authz, int width) {
    // create column
    Column<RichMember, RichMember> organizationColumn = JsonUtils.addColumn(new CustomClickableTextCellWithAuthz<RichMember>(authz, "organization"), new JsonUtils.GetValue<RichMember, RichMember>() {

        @Override
        public RichMember getValue(RichMember object) {
            return object;
        }
    }, fieldUpdater);
    // add column
    table.addColumn(organizationColumn, "Organization");
    if (width != 0) {
        table.setColumnWidth(organizationColumn, width, Style.Unit.PX);
    }
    // sort column
    organizationColumn.setSortable(true);
    table.getColumnSortHandler().setComparator(organizationColumn, new RichMemberComparator(RichMemberComparator.Column.ORGANIZATION));
}
Also used : JsonUtils(cz.metacentrum.perun.webgui.json.JsonUtils) RichMemberComparator(cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator) RichMember(cz.metacentrum.perun.webgui.model.RichMember)

Example 4 with RichMemberComparator

use of cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator in project perun by CESNET.

the class MemberColumnProvider method addIdColumn.

public void addIdColumn(IsClickableCell authz, int width) {
    // create column
    Column<RichMember, RichMember> idColumn = JsonUtils.addColumn(new CustomClickableTextCellWithAuthz<RichMember>(authz, "id"), new JsonUtils.GetValue<RichMember, RichMember>() {

        @Override
        public RichMember getValue(RichMember object) {
            return object;
        }
    }, fieldUpdater);
    // add column only if extended info is visible
    if (JsonUtils.isExtendedInfoVisible()) {
        table.addColumn(idColumn, "Member Id");
        if (width != 0) {
            table.setColumnWidth(idColumn, width, Style.Unit.PX);
        }
        // sort column
        idColumn.setSortable(true);
        table.getColumnSortHandler().setComparator(idColumn, new RichMemberComparator(RichMemberComparator.Column.MEMBER_ID));
    }
}
Also used : JsonUtils(cz.metacentrum.perun.webgui.json.JsonUtils) RichMemberComparator(cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator) RichMember(cz.metacentrum.perun.webgui.model.RichMember)

Example 5 with RichMemberComparator

use of cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator in project perun by CESNET.

the class MemberColumnProvider method addUserIdColumn.

public void addUserIdColumn(IsClickableCell authz, int width) {
    // create column
    Column<RichMember, RichMember> idColumn = JsonUtils.addColumn(new CustomClickableTextCellWithAuthz<RichMember>(authz, "userId"), new JsonUtils.GetValue<RichMember, RichMember>() {

        @Override
        public RichMember getValue(RichMember object) {
            return object;
        }
    }, fieldUpdater);
    // add column only if extended info is visible
    if (JsonUtils.isExtendedInfoVisible()) {
        table.addColumn(idColumn, "User Id");
        if (width != 0) {
            table.setColumnWidth(idColumn, width, Style.Unit.PX);
        }
        // sort column
        idColumn.setSortable(true);
        table.getColumnSortHandler().setComparator(idColumn, new RichMemberComparator(RichMemberComparator.Column.USER_ID));
    }
}
Also used : JsonUtils(cz.metacentrum.perun.webgui.json.JsonUtils) RichMemberComparator(cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator) RichMember(cz.metacentrum.perun.webgui.model.RichMember)

Aggregations

RichMemberComparator (cz.metacentrum.perun.webgui.json.comparators.RichMemberComparator)6 RichMember (cz.metacentrum.perun.webgui.model.RichMember)6 JsonUtils (cz.metacentrum.perun.webgui.json.JsonUtils)5 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Column (com.google.gwt.user.cellview.client.Column)1 ListHandler (com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler)1 FlexTable (com.google.gwt.user.client.ui.FlexTable)1 ListBox (com.google.gwt.user.client.ui.ListBox)1 SetStatus (cz.metacentrum.perun.webgui.json.membersManager.SetStatus)1 PerunError (cz.metacentrum.perun.webgui.model.PerunError)1 Confirm (cz.metacentrum.perun.webgui.widgets.Confirm)1 PerunStatusCell (cz.metacentrum.perun.webgui.widgets.cells.PerunStatusCell)1