Search in sources :

Example 21 with AbstractTextColumn

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

the class SubTabVolumeBrickView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    BrickStatusColumn brickStatusColumn = new BrickStatusColumn();
    brickStatusColumn.setContextMenuTitle(constants.statusVolumeBrick());
    brickStatusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(brickStatusColumn, constants.empty(), "30px");
    AbstractTextColumn<GlusterBrickEntity> serverColumn = new AbstractTextColumn<GlusterBrickEntity>() {

        @Override
        public String getValue(GlusterBrickEntity brick) {
            return brick.getServerName();
        }
    };
    serverColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(serverColumn, constants.serverVolumeBrick(), "300px");
    AbstractTextColumn<GlusterBrickEntity> directoryColumn = new AbstractTextColumn<GlusterBrickEntity>() {

        @Override
        public String getValue(GlusterBrickEntity brick) {
            String qualifiedName = brick.getQualifiedName();
            if (brick.getIsArbiter()) {
                // $NON-NLS-1$ //$NON-NLS-2$
                qualifiedName += " (" + constants.arbiter() + ")";
            }
            return qualifiedName;
        }
    };
    directoryColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(directoryColumn, constants.brickDirectoryVolumeBrick(), "400px");
    getTable().addColumn(new Column<GlusterBrickEntity, BrickProperties>(new BrickCapacityCell()) {

        @Override
        public BrickProperties getValue(GlusterBrickEntity object) {
            return object.getBrickProperties();
        }
    }, constants.volumeCapacity(), // $NON-NLS-1$
    "100px");
    BrickHealInfoColumn healInfoColumn = new BrickHealInfoColumn();
    // $NON-NLS-1$
    getTable().addColumn(healInfoColumn, constants.healInfo(), "110px");
    getTable().addColumn(new VolumeActivityColumn<GlusterBrickEntity>(getActivityCell()), constants.activitiesOnVolume(), // $NON-NLS-1$
    "100px");
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) BrickCapacityCell(org.ovirt.engine.ui.webadmin.widget.table.column.BrickCapacityCell) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) BrickStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn) BrickHealInfoColumn(org.ovirt.engine.ui.webadmin.widget.table.column.BrickHealInfoColumn) BrickProperties(org.ovirt.engine.core.common.businessentities.gluster.BrickProperties)

Example 22 with AbstractTextColumn

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

the class SubTabHostBrickView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    BrickStatusColumn brickStatusColumn = new BrickStatusColumn();
    brickStatusColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(brickStatusColumn, constants.empty(), "30px");
    AbstractTextColumn<GlusterBrickEntity> volNameColumn = new AbstractTextColumn<GlusterBrickEntity>() {

        @Override
        public String getValue(GlusterBrickEntity object) {
            return object.getVolumeName();
        }
    };
    volNameColumn.makeSortable();
    getTable().addColumn(volNameColumn, constants.volumeName());
    AbstractTextColumn<GlusterBrickEntity> brickDirColumn = new AbstractTextColumn<GlusterBrickEntity>() {

        @Override
        public String getValue(GlusterBrickEntity object) {
            return object.getBrickDirectory();
        }
    };
    brickDirColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(brickDirColumn, constants.brickDirectoryBricks(), "220px");
    BrickHealInfoColumn healInfoColumn = new BrickHealInfoColumn();
    // $NON-NLS-1$
    getTable().addColumn(healInfoColumn, constants.healInfo(), "110px");
}
Also used : GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) BrickStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.BrickStatusColumn) BrickHealInfoColumn(org.ovirt.engine.ui.webadmin.widget.table.column.BrickHealInfoColumn)

Example 23 with AbstractTextColumn

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

Example 24 with AbstractTextColumn

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

the class SubTabDataCenterQuotaView method initTable.

void initTable() {
    getTable().enableColumnResizing();
    QuotaDcStatusColumn dcStatusColumn = new QuotaDcStatusColumn();
    dcStatusColumn.setContextMenuTitle(constants.dcStatusQuota());
    // $NON-NLS-1$
    getTable().addColumn(dcStatusColumn, constants.empty(), "30px");
    AbstractTextColumn<Quota> nameColumn = new AbstractTextColumn<Quota>() {

        @Override
        public String getValue(Quota object) {
            // $NON-NLS-1$
            return object.getQuotaName() == null ? "" : object.getQuotaName();
        }
    };
    nameColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(nameColumn, constants.nameQuota(), "400px");
    AbstractTextColumn<Quota> descriptionColumn = new AbstractTextColumn<Quota>() {

        @Override
        public String getValue(Quota object) {
            // $NON-NLS-1$
            return object.getDescription() == null ? "" : object.getDescription();
        }
    };
    descriptionColumn.makeSortable();
    // $NON-NLS-1$
    getTable().addColumn(descriptionColumn, constants.descriptionQuota(), "400px");
}
Also used : Quota(org.ovirt.engine.core.common.businessentities.Quota) QuotaDcStatusColumn(org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)

Example 25 with AbstractTextColumn

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

the class CpuProfilesListModelTable method initTable.

@Override
public void initTable() {
    getTable().enableColumnResizing();
    AbstractTextColumn<CpuProfile> nameColumn = new AbstractTextColumn<CpuProfile>() {

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

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

        @Override
        public String getValue(CpuProfile object) {
            String name = constants.unlimitedQos();
            if (object.getQosId() != null) {
                CpuQos cpuQos = getModel().getQos(object.getQosId());
                if (cpuQos != null) {
                    name = cpuQos.getName();
                }
            }
            return name;
        }
    };
    // $NON-NLS-1$
    getTable().addColumn(qosColumn, constants.cpuQosName(), "200px");
    qosColumn.makeSortable();
    // Add selection listener
    getModel().getSelectedItemChangedEvent().addListener((ev, sender, args) -> updatePermissionPanel());
    getModel().getItemsChangedEvent().addListener((ev, sender, args) -> updatePermissionPanel());
}
Also used : CpuProfile(org.ovirt.engine.core.common.businessentities.profiles.CpuProfile) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) CpuQos(org.ovirt.engine.core.common.businessentities.qos.CpuQos)

Aggregations

AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)57 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)23 HashMap (java.util.HashMap)15 Map (java.util.Map)14 AbstractLinkColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractLinkColumn)14 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)10 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)9 AbstractDiskSizeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn)9 ImageResource (com.google.gwt.resources.client.ImageResource)8 NoSelectionModel (com.google.gwt.view.client.NoSelectionModel)7 AbstractCheckboxColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn)7 Column (com.google.gwt.user.cellview.client.Column)6 ArrayList (java.util.ArrayList)6 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)6 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)6 NoItemsLabel (org.ovirt.engine.ui.common.widget.label.NoItemsLabel)6 AbstractFullDateTimeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractFullDateTimeColumn)6 List (java.util.List)5 GWT (com.google.gwt.core.client.GWT)4 VM (org.ovirt.engine.core.common.businessentities.VM)4