Search in sources :

Example 1 with StorageDomainStatusColumn

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

the class SubTabStorageDataCenterView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    StorageDomainStatusColumn statusColumn = new StorageDomainStatusColumn();
    statusColumn.setContextMenuTitle(constants.statusStorageDc());
    // $NON-NLS-1$
    getTable().addColumn(statusColumn, constants.empty(), "30px");
    AbstractTextColumn<StorageDomain> nameColumn = new AbstractLinkColumn<StorageDomain>(new FieldUpdater<StorageDomain, String>() {

        @Override
        public void update(int index, StorageDomain storageDomain, String value) {
            Map<String, String> parameters = new HashMap<>();
            parameters.put(FragmentParams.NAME.getName(), storageDomain.getStoragePoolName());
            getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.dataCenterStorageSubTabPlace, parameters);
        }
    }) {

        @Override
        public String getValue(StorageDomain object) {
            return object.getStoragePoolName();
        }
    };
    nameColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(nameColumn, constants.nameDc(), "600px");
    AbstractTextColumn<StorageDomain> domainStatusColumn = new AbstractEnumColumn<StorageDomain, StorageDomainStatus>() {

        @Override
        protected StorageDomainStatus getRawValue(StorageDomain object) {
            return object.getStatus();
        }
    };
    domainStatusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(domainStatusColumn, constants.domainStatusInDcStorageDc(), "300px");
}
Also used : AbstractEnumColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) AbstractLinkColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn) StorageDomainStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainStatusColumn) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with StorageDomainStatusColumn

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

the class SubTabDataCenterStorageView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    StorageDomainStatusColumn statusIconColumn = new StorageDomainStatusColumn();
    statusIconColumn.setContextMenuTitle(constants.statusIconStorage());
    // $NON-NLS-1$
    getTable().addColumn(statusIconColumn, constants.empty(), "30px");
    StorageDomainAdditionalStatusColumn additionalStatusColumn = new StorageDomainAdditionalStatusColumn();
    additionalStatusColumn.setContextMenuTitle(constants.additionalStatusStorage());
    // $NON-NLS-1$
    getTable().addColumn(additionalStatusColumn, constants.empty(), "60px");
    AbstractTextColumn<StorageDomain> nameColumn = new AbstractLinkColumn<StorageDomain>(new FieldUpdater<StorageDomain, String>() {

        @Override
        public void update(int index, StorageDomain sd, String value) {
            Map<String, String> parameters = new HashMap<>();
            parameters.put(FragmentParams.NAME.getName(), sd.getName());
            getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.storageGeneralSubTabPlace, parameters);
        }
    }) {

        @Override
        public String getValue(StorageDomain object) {
            return object.getName();
        }
    };
    nameColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(nameColumn, constants.domainNameStorage(), "160px");
    AbstractTextColumn<StorageDomain> typeColumn = new AbstractEnumColumn<StorageDomain, StorageDomainType>() {

        @Override
        public StorageDomainType getRawValue(StorageDomain object) {
            return object.getStorageDomainType();
        }
    };
    typeColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(typeColumn, constants.domainTypeStorage(), "160px");
    AbstractTextColumn<StorageDomain> statusColumn = new AbstractEnumColumn<StorageDomain, StorageDomainStatus>() {

        @Override
        public StorageDomainStatus getRawValue(StorageDomain object) {
            return object.getStatus();
        }
    };
    statusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(statusColumn, constants.statusStorage(), "160px");
    AbstractDiskSizeColumn<StorageDomain> freeColumn = new AbstractDiskSizeColumn<StorageDomain>(SizeConverter.SizeUnit.GiB) {

        @Override
        public Long getRawValue(StorageDomain object) {
            return object.getAvailableDiskSize() != null ? object.getAvailableDiskSize() : 0L;
        }
    };
    freeColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(freeColumn, constants.freeSpaceStorage(), "160px");
    AbstractDiskSizeColumn<StorageDomain> usedColumn = new AbstractDiskSizeColumn<StorageDomain>(SizeConverter.SizeUnit.GiB) {

        @Override
        public Long getRawValue(StorageDomain object) {
            return object.getUsedDiskSize() != null ? object.getUsedDiskSize() : 0L;
        }
    };
    usedColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(usedColumn, constants.usedSpaceStorage(), "160px");
    AbstractDiskSizeColumn<StorageDomain> totalColumn = new AbstractDiskSizeColumn<StorageDomain>(SizeConverter.SizeUnit.GiB) {

        @Override
        public Long getRawValue(StorageDomain object) {
            return object.getTotalDiskSize() != null ? object.getTotalDiskSize() : 0L;
        }
    };
    totalColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(totalColumn, constants.totalSpaceStorage(), "160px");
    AbstractTextColumn<StorageDomain> descriptionColumn = new AbstractTextColumn<StorageDomain>() {

        @Override
        public String getValue(StorageDomain object) {
            return object.getDescription();
        }
    };
    descriptionColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(descriptionColumn, constants.domainDescriptionStorage(), "160px");
}
Also used : StorageDomainAdditionalStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainAdditionalStatusColumn) StorageDomainStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainStatusColumn) AbstractEnumColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn) AbstractDiskSizeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) AbstractLinkColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)2 Map (java.util.Map)2 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)2 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)2 AbstractLinkColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn)2 StorageDomainStatusColumn (org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainStatusColumn)2 AbstractDiskSizeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn)1 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)1 StorageDomainAdditionalStatusColumn (org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainAdditionalStatusColumn)1