Search in sources :

Example 1 with StorageDeviceStatusColumn

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

the class SubTabHostGlusterStorageDevicesView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    StorageDeviceStatusColumn storageDeviceStatusColumn = new StorageDeviceStatusColumn();
    storageDeviceStatusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(storageDeviceStatusColumn, constants.empty(), "30px");
    AbstractTextColumn<StorageDevice> deviceNameColumn = new AbstractTextColumn<StorageDevice>() {

        @Override
        public String getValue(StorageDevice object) {
            return object.getName();
        }
    };
    deviceNameColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(deviceNameColumn, constants.deviceName(), "250px");
    AbstractTextColumn<StorageDevice> descriptionColumn = new AbstractTextColumn<StorageDevice>() {

        @Override
        public String getValue(StorageDevice object) {
            return object.getDescription();
        }
    };
    descriptionColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(descriptionColumn, constants.description(), "300px");
    AbstractTextColumn<StorageDevice> sizeColumn = new AbstractTextColumn<StorageDevice>() {

        @Override
        public String getValue(StorageDevice object) {
            Pair<SizeUnit, Double> convertedSize = SizeConverter.autoConvert(object.getSize(), SizeUnit.MiB);
            // $NON-NLS-1$
            return formatSize(convertedSize.getSecond()) + " " + convertedSize.getFirst().toString();
        }
    };
    sizeColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(sizeColumn, constants.size(), "100px");
    AbstractTextColumn<StorageDevice> mountPointColumn = new AbstractTextColumn<StorageDevice>() {

        @Override
        public String getValue(StorageDevice object) {
            return object.getMountPoint();
        }
    };
    mountPointColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(mountPointColumn, constants.mountPoint(), "170px");
    AbstractTextColumn<StorageDevice> fsTypeColumn = new AbstractTextColumn<StorageDevice>() {

        @Override
        public String getValue(StorageDevice object) {
            return object.getFsType();
        }
    };
    fsTypeColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(fsTypeColumn, constants.fileSystemType(), "170px");
}
Also used : SizeUnit(org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit) StorageDevice(org.ovirt.engine.core.common.businessentities.gluster.StorageDevice) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) StorageDeviceStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusColumn)

Aggregations

StorageDevice (org.ovirt.engine.core.common.businessentities.gluster.StorageDevice)1 SizeUnit (org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit)1 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)1 StorageDeviceStatusColumn (org.ovirt.engine.ui.webadmin.widget.table.column.StorageDeviceStatusColumn)1