Search in sources :

Example 1 with StorageDomainAdditionalStatusColumn

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

the class MainStorageView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    StorageDomainSharedStatusColumn sharedStatusColumn = new StorageDomainSharedStatusColumn();
    sharedStatusColumn.setContextMenuTitle(constants.sharedStatusStorage());
    // $NON-NLS-1$
    getTable().addColumn(sharedStatusColumn, 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 storageDomain, String value) {
            Map<String, String> parameters = new HashMap<>();
            parameters.put(FragmentParams.NAME.getName(), storageDomain.getName());
            // The link was clicked, now fire an event to switch to details.
            getPlaceTransitionHandler().handlePlaceTransition(WebAdminApplicationPlaces.storageGeneralSubTabPlace, parameters);
        }
    }) {

        @Override
        public String getValue(StorageDomain object) {
            return object.getName();
        }
    };
    nameColumn.makeSortable(StorageDomainFieldAutoCompleter.NAME);
    // $NON-NLS-1$
    getTable().addColumn(nameColumn, constants.domainNameStorage(), "150px");
    CommentColumn<StorageDomain> commentColumn = new CommentColumn<>();
    getTable().addColumnWithHtmlHeader(commentColumn, SafeHtmlUtils.fromSafeConstant(constants.commentLabel()), // $NON-NLS-1$
    "75px");
    AbstractTextColumn<StorageDomain> domainTypeColumn = new AbstractEnumColumn<StorageDomain, StorageDomainType>() {

        @Override
        protected StorageDomainType getRawValue(StorageDomain object) {
            return object.getStorageDomainType();
        }
    };
    // $NON-NLS-1$
    getTable().addColumn(domainTypeColumn, constants.domainTypeStorage(), "150px");
    AbstractTextColumn<StorageDomain> storageTypeColumn = new AbstractEnumColumn<StorageDomain, StorageType>() {

        @Override
        protected StorageType getRawValue(StorageDomain object) {
            return object.getStorageType();
        }
    };
    storageTypeColumn.makeSortable(StorageDomainFieldAutoCompleter.TYPE);
    // $NON-NLS-1$
    getTable().addColumn(storageTypeColumn, constants.storageTypeStorage(), "150px");
    AbstractTextColumn<StorageDomain> formatColumn = new AbstractEnumColumn<StorageDomain, StorageFormatType>() {

        @Override
        protected StorageFormatType getRawValue(StorageDomain object) {
            return object.getStorageFormat();
        }
    };
    // $NON-NLS-1$
    getTable().addColumn(formatColumn, constants.formatStorage(), "140px");
    AbstractTextColumn<StorageDomain> crossDataCenterStatusColumn = new AbstractTextColumn<StorageDomain>() {

        @Override
        public String getValue(StorageDomain object) {
            if (object.getStorageDomainType() == StorageDomainType.ISO) {
                return EnumTranslator.getInstance().translate(object.getStorageDomainSharedStatus());
            } else {
                return EnumTranslator.getInstance().translate(object.getStatus());
            }
        }
    };
    crossDataCenterStatusColumn.makeSortable(StorageDomainFieldAutoCompleter.STATUS);
    // $NON-NLS-1$
    getTable().addColumn(crossDataCenterStatusColumn, constants.crossDcStatusStorage(), "210px");
    AbstractStorageSizeColumn<StorageDomain> totalSpaceColumn = new AbstractStorageSizeColumn<StorageDomain>() {

        @Override
        public Long getRawValue(StorageDomain object) {
            Integer totalSpace = object.getTotalDiskSize();
            return totalSpace == null ? null : Long.valueOf(totalSpace);
        }
    };
    // $NON-NLS-1$
    getTable().addColumn(totalSpaceColumn, constants.totalSpaceStorage(), "130px");
    AbstractStorageSizeColumn<StorageDomain> freeSpaceColumn = new AbstractStorageSizeColumn<StorageDomain>() {

        @Override
        public Long getRawValue(StorageDomain object) {
            Integer availableDiskSize = object.getAvailableDiskSize();
            return availableDiskSize == null ? null : Long.valueOf(availableDiskSize);
        }
    };
    freeSpaceColumn.makeSortable(StorageDomainFieldAutoCompleter.SIZE);
    // $NON-NLS-1$
    getTable().addColumn(freeSpaceColumn, constants.freeSpaceStorage(), "130px");
    AbstractTextColumn<StorageDomain> descriptionColumn = new AbstractTextColumn<StorageDomain>() {

        @Override
        public String getValue(StorageDomain object) {
            return object.getDescription();
        }
    };
    descriptionColumn.makeSortable(StorageDomainFieldAutoCompleter.DESCRIPTION);
    // $NON-NLS-1$
    getTable().addColumn(descriptionColumn, constants.domainDescriptionStorage(), "200px");
}
Also used : StorageDomainAdditionalStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainAdditionalStatusColumn) StorageDomainSharedStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainSharedStatusColumn) AbstractEnumColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn) AbstractStorageSizeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractStorageSizeColumn) 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) CommentColumn(org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with StorageDomainAdditionalStatusColumn

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

Example 3 with StorageDomainAdditionalStatusColumn

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

the class SubTabDiskStorageView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    StorageDomainSharedStatusColumn sharedStatusColumn = new StorageDomainSharedStatusColumn();
    sharedStatusColumn.setContextMenuTitle(constants.sharedStatusStorage());
    // $NON-NLS-1$
    getTable().addColumn(sharedStatusColumn, constants.empty(), "30px");
    StorageDomainAdditionalStatusColumn additionalStatusColumn = new StorageDomainAdditionalStatusColumn();
    additionalStatusColumn.setContextMenuTitle(constants.additionalStatusStorage());
    // $NON-NLS-1$
    getTable().addColumn(additionalStatusColumn, constants.empty(), "60px");
    AbstractTextColumn<StorageDomain> nameColumn = new AbstractTextColumn<StorageDomain>() {

        @Override
        public String getValue(StorageDomain object) {
            return object.getStorageName();
        }
    };
    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) 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) StorageDomainSharedStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDomainSharedStatusColumn) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)

Aggregations

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