Search in sources :

Example 1 with AbstractGroupNameColumn

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

the class SubTabUserPermissionView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    PermissionTypeColumn typeColumn = new PermissionTypeColumn();
    typeColumn.setContextMenuTitle(constants.typePermission());
    // $NON-NLS-1$
    getTable().addColumn(typeColumn, constants.empty(), "30px");
    AbstractTextColumn<Permission> roleColumn = new AbstractTextColumn<Permission>() {

        @Override
        public String getValue(Permission object) {
            return object.getRoleName();
        }
    };
    roleColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(roleColumn, constants.rolePermission(), "560px");
    AbstractTextColumn<Permission> permissionColumn = new AbstractObjectNameColumn<Permission>() {

        @Override
        protected Object[] getRawValue(Permission object) {
            return new Object[] { object.getObjectType(), object.getObjectName() };
        }
    };
    permissionColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(permissionColumn, constants.objectPermission(), "560px");
    AbstractTextColumn<Permission> inheritedColumn = new AbstractGroupNameColumn<Permission>() {

        @Override
        protected Object[] getRawValue(Permission object) {
            return new Object[] { getDetailModel().getEntity(), object.getAdElementId(), object.getOwnerName() };
        }
    };
    inheritedColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(inheritedColumn, constants.inheritedPermission(), "560px");
}
Also used : AbstractGroupNameColumn(org.ovirt.engine.ui.webadmin.widget.table.column.AbstractGroupNameColumn) Permission(org.ovirt.engine.core.common.businessentities.Permission) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) PermissionTypeColumn(org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn) AbstractObjectNameColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractObjectNameColumn)

Aggregations

Permission (org.ovirt.engine.core.common.businessentities.Permission)1 AbstractObjectNameColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractObjectNameColumn)1 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)1 PermissionTypeColumn (org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn)1 AbstractGroupNameColumn (org.ovirt.engine.ui.webadmin.widget.table.column.AbstractGroupNameColumn)1