Search in sources :

Example 1 with IsLockedImageTypeColumn

use of org.ovirt.engine.ui.webadmin.widget.table.column.IsLockedImageTypeColumn in project ovirt-engine by oVirt.

the class RoleView method initRoleTable.

private void initRoleTable() {
    roleTable.enableColumnResizing();
    // $NON-NLS-1$
    roleTable.addColumn(new IsLockedImageTypeColumn(), constants.empty(), "25px");
    // $NON-NLS-1$
    roleTable.addColumn(new RoleTypeColumn(), constants.empty(), "25px");
    AbstractTextColumn<Role> nameColumn = new AbstractTextColumn<Role>() {

        @Override
        public String getValue(Role object) {
            return object.getName();
        }
    };
    nameColumn.makeSortable();
    // $NON-NLS-1$
    roleTable.addColumn(nameColumn, constants.nameRole(), "175px");
    AbstractTextColumn<Role> descColumn = new AbstractTextColumn<Role>() {

        @Override
        public String getValue(Role object) {
            return object.getDescription();
        }
    };
    descColumn.makeSortable();
    // $NON-NLS-1$
    roleTable.addColumn(descColumn, constants.descriptionRole(), "500px");
    roleTable.getSelectionModel().addSelectionChangeHandler(event -> {
        roleModelProvider.setSelectedItems(roleTable.getSelectionModel().getSelectedObjects());
        if (roleTable.getSelectionModel().getSelectedObjects().size() > 0) {
            setSubTabVisibility(true);
        } else {
            setSubTabVisibility(false);
        }
    });
    roleTablePanel.add(roleTable);
}
Also used : Role(org.ovirt.engine.core.common.businessentities.Role) RoleTypeColumn(org.ovirt.engine.ui.webadmin.widget.table.column.RoleTypeColumn) IsLockedImageTypeColumn(org.ovirt.engine.ui.webadmin.widget.table.column.IsLockedImageTypeColumn) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)

Aggregations

Role (org.ovirt.engine.core.common.businessentities.Role)1 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)1 IsLockedImageTypeColumn (org.ovirt.engine.ui.webadmin.widget.table.column.IsLockedImageTypeColumn)1 RoleTypeColumn (org.ovirt.engine.ui.webadmin.widget.table.column.RoleTypeColumn)1