Search in sources :

Example 1 with PermissionTypeColumn

use of org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn in project ovirt-engine by oVirt.

the class SystemPermissionView method initTable.

private void initTable(SystemPermissionActionPanelPresenterWidget actionPanel) {
    table.enableColumnResizing();
    // $NON-NLS-1$
    table.addColumn(new PermissionTypeColumn(), constants.empty(), "30px");
    AbstractTextColumn<Permission> userColumn = new AbstractTextColumn<Permission>() {

        @Override
        public String getValue(Permission object) {
            return object.getOwnerName();
        }
    };
    userColumn.makeSortable((u1, u2) -> u1.getOwnerName().compareTo(u2.getObjectName()));
    // $NON-NLS-1$
    table.addColumn(userColumn, constants.userPermission(), "270px");
    AbstractTextColumn<Permission> authzColumn = new AbstractTextColumn<Permission>() {

        @Override
        public String getValue(Permission object) {
            return object.getAuthz();
        }
    };
    authzColumn.makeSortable((a1, a2) -> a1.getAuthz().compareTo(a2.getAuthz()));
    // $NON-NLS-1$
    table.addColumn(authzColumn, constants.authz(), "180px");
    AbstractTextColumn<Permission> namespaceColumn = new AbstractTextColumn<Permission>() {

        @Override
        public String getValue(Permission object) {
            return object.getNamespace();
        }
    };
    namespaceColumn.makeSortable((ns1, ns2) -> ns1.getNamespace().compareTo(ns1.getNamespace()));
    // $NON-NLS-1$
    table.addColumn(namespaceColumn, constants.namespace(), "170px");
    AbstractTextColumn<Permission> roleColumn = new AbstractTextColumn<Permission>() {

        @Override
        public String getValue(Permission object) {
            return object.getRoleName();
        }
    };
    roleColumn.makeSortable((r1, r2) -> r1.getRoleName().compareTo(r2.getRoleName()));
    // $NON-NLS-1$
    table.addColumn(roleColumn, constants.rolePermission(), "110px");
    table.getSelectionModel().addSelectionChangeHandler(event -> modelProvider.setSelectedItems(table.getSelectionModel().getSelectedObjects()));
    tablePanel.add(actionPanel);
    tablePanel.add(table);
    table.table.setHeight(360 + Unit.PX.getType());
}
Also used : 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)

Example 2 with PermissionTypeColumn

use of org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn in project ovirt-engine by oVirt.

the class SubTabQuotaUserView method initTable.

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

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

        @Override
        protected Object[] getRawValue(Permission object) {
            return new Object[] { object.getObjectType(), object.getObjectName(), getDetailModel().getEntity(), object.getObjectId() };
        }
    };
    permissionColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(permissionColumn, constants.inheritedFromUser(), "400px");
}
Also used : 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)

Example 3 with PermissionTypeColumn

use of org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn 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)

Example 4 with PermissionTypeColumn

use of org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn in project ovirt-engine by oVirt.

the class PermissionListModelTable method addTypeColumn.

private void addTypeColumn() {
    PermissionTypeColumn typeColumn = new PermissionTypeColumn();
    typeColumn.setContextMenuTitle(constants.typePermission());
    // $NON-NLS-1$
    getTable().addColumn(typeColumn, constants.empty(), "30px");
}
Also used : PermissionTypeColumn(org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn)

Example 5 with PermissionTypeColumn

use of org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn in project ovirt-engine by oVirt.

the class SubTabQuotaPermissionView method initTable.

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

        @Override
        public String getValue(Permission object) {
            return object.getOwnerName();
        }
    };
    userColumn.makeSortable();
    getTable().addColumn(userColumn, constants.userPermission());
    AbstractTextColumn<Permission> roleColumn = new AbstractTextColumn<Permission>() {

        @Override
        public String getValue(Permission object) {
            return object.getRoleName();
        }
    };
    roleColumn.makeSortable();
    getTable().addColumn(roleColumn, constants.rolePermission());
    AbstractTextColumn<Permission> permissionColumn = new AbstractObjectNameColumn<Permission>() {

        @Override
        protected Object[] getRawValue(Permission object) {
            return new Object[] { object.getObjectType(), object.getObjectName(), getDetailModel().getEntity(), object.getObjectId() };
        }
    };
    permissionColumn.makeSortable();
    getTable().addColumn(permissionColumn, constants.inheretedFromPermission());
}
Also used : 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

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