Search in sources :

Example 1 with NoItemsLabel

use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.

the class RegisterEntityInfoPanel method initAppsTable.

protected void initAppsTable() {
    appsTable = new EntityModelCellTable<>(false, true);
    AbstractTextColumn<String> appNameColumn = new AbstractTextColumn<String>() {

        @Override
        public String getValue(String appName) {
            return appName;
        }
    };
    appsTable.addColumn(appNameColumn, constants.nameSnapshot());
    appsTable.setRowData(new ArrayList<EntityModel>());
    // $NON-NLS-1$
    appsTable.setWidth("100%");
    appsTable.setSelectionModel(new NoSelectionModel());
    appsTable.setEmptyTableWidget(new NoItemsLabel());
}
Also used : NoItemsLabel(org.ovirt.engine.ui.common.widget.label.NoItemsLabel) NoSelectionModel(com.google.gwt.view.client.NoSelectionModel) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) RegisterEntityModel(org.ovirt.engine.ui.uicommonweb.models.storage.RegisterEntityModel)

Example 2 with NoItemsLabel

use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.

the class VmDiskAttachPopupWidget method initLunDisksTable.

private void initLunDisksTable() {
    lunDiskTable.enableColumnResizing();
    AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getDiskAlias();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "60px");
    AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getDiskDescription();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "85px");
    AbstractTextColumn<EntityModel> lunIdColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getLun().getLUNId();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(lunIdColumn, constants.lunIdSanStorage(), "60px");
    AbstractTextColumn<EntityModel> idColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getId().toString();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(idColumn, constants.idVmDiskTable(), "60px");
    AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>(SizeConverter.SizeUnit.GiB) {

        @Override
        protected Long getRawValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return (long) disk.getLun().getDeviceSize();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(sizeColumn, constants.devSizeSanStorage(), "70px");
    AbstractTextColumn<EntityModel> pathColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return String.valueOf(disk.getLun().getPathCount());
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(pathColumn, constants.pathSanStorage(), "40px");
    AbstractTextColumn<EntityModel> vendorIdColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getLun().getVendorId();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(vendorIdColumn, constants.vendorIdSanStorage(), "70px");
    AbstractTextColumn<EntityModel> productIdColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getLun().getProductId();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(productIdColumn, constants.productIdSanStorage(), "70px");
    AbstractTextColumn<EntityModel> serialColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            LunDisk disk = (LunDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getLun().getSerial();
        }
    };
    // $NON-NLS-1$
    lunDiskTable.addColumn(serialColumn, constants.serialSanStorage(), "70px");
    // $NON-NLS-1$
    lunDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
    lunDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
    "30px");
    lunDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
    "30px");
    lunDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {

        @Override
        public ImageResource getValue(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            return disk.isShareable() ? resources.shareableDiskIcon() : null;
        }

        @Override
        public SafeHtml getTooltip(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            if (disk.isShareable()) {
                return SafeHtmlUtils.fromSafeConstant(constants.shareable());
            }
            return null;
        }
    }, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
    "30px");
    // $NON-NLS-1$
    lunDiskTable.setWidth("100%");
    lunDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
Also used : NoItemsLabel(org.ovirt.engine.ui.common.widget.label.NoItemsLabel) ImageResourceHeader(org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) AbstractDiskSizeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn) ImageResource(com.google.gwt.resources.client.ImageResource) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk)

Example 3 with NoItemsLabel

use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.

the class VmDiskAttachPopupWidget method initCinderDisksTable.

private void initCinderDisksTable() {
    cinderDiskTable.enableColumnResizing();
    AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            CinderDisk disk = (CinderDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getDiskAlias();
        }
    };
    // $NON-NLS-1$
    cinderDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "100px");
    AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            CinderDisk disk = (CinderDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getDiskDescription();
        }
    };
    // $NON-NLS-1$
    cinderDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "100px");
    AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>(SizeConverter.SizeUnit.GiB) {

        @Override
        protected Long getRawValue(EntityModel object) {
            CinderDisk disk = (CinderDisk) ((DiskModel) object.getEntity()).getDisk();
            return disk.getSizeInGigabytes();
        }
    };
    // $NON-NLS-1$
    cinderDiskTable.addColumn(sizeColumn, constants.provisionedSizeVmDiskTable(), "100px");
    // $NON-NLS-1$
    cinderDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
    AbstractTextColumn<EntityModel> cinderVolumeTypeColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            return disk.getCinderVolumeType();
        }
    };
    // $NON-NLS-1$
    cinderDiskTable.addColumn(cinderVolumeTypeColumn, constants.cinderVolumeTypeDisk(), "90px");
    cinderDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
    "30px");
    cinderDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
    "30px");
    cinderDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {

        @Override
        public ImageResource getValue(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            return disk.isShareable() ? resources.shareableDiskIcon() : null;
        }

        @Override
        public SafeHtml getTooltip(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            if (disk.isShareable()) {
                return SafeHtmlUtils.fromSafeConstant(constants.shareable());
            }
            return null;
        }
    }, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
    "30px");
    // $NON-NLS-1$
    cinderDiskTable.setWidth("100%");
    cinderDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
Also used : NoItemsLabel(org.ovirt.engine.ui.common.widget.label.NoItemsLabel) ImageResourceHeader(org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) AbstractDiskSizeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn) AttachDiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.AttachDiskModel) DiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel) ImageResource(com.google.gwt.resources.client.ImageResource) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk)

Example 4 with NoItemsLabel

use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.

the class VmDiskAttachPopupWidget method initDiskImagesTable.

private void initDiskImagesTable() {
    imageDiskTable.enableColumnResizing();
    AbstractTextColumn<EntityModel> aliasColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
            return diskImage.getDiskAlias();
        }
    };
    // $NON-NLS-1$
    imageDiskTable.addColumn(aliasColumn, constants.aliasVmDiskTable(), "85px");
    AbstractTextColumn<EntityModel> descriptionColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
            return diskImage.getDiskDescription();
        }
    };
    // $NON-NLS-1$
    imageDiskTable.addColumn(descriptionColumn, constants.descriptionVmDiskTable(), "85px");
    AbstractTextColumn<EntityModel> idColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
            return diskImage.getId().toString();
        }
    };
    // $NON-NLS-1$
    imageDiskTable.addColumn(idColumn, constants.idVmDiskTable(), "85px");
    AbstractDiskSizeColumn<EntityModel> sizeColumn = new AbstractDiskSizeColumn<EntityModel>() {

        @Override
        protected Long getRawValue(EntityModel object) {
            DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
            return diskImage.getSize();
        }
    };
    // $NON-NLS-1$
    imageDiskTable.addColumn(sizeColumn, constants.provisionedSizeVmDiskTable(), "100px");
    AbstractDiskSizeColumn<EntityModel> actualSizeColumn = new AbstractDiskSizeColumn<EntityModel>() {

        @Override
        protected Long getRawValue(EntityModel object) {
            DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
            return diskImage.getActualSizeInBytes();
        }
    };
    // $NON-NLS-1$
    imageDiskTable.addColumn(actualSizeColumn, constants.sizeVmDiskTable(), "100px");
    AbstractTextColumn<EntityModel> storageDomainColumn = new AbstractTextColumn<EntityModel>() {

        @Override
        public String getValue(EntityModel object) {
            DiskImage diskImage = (DiskImage) ((DiskModel) object.getEntity()).getDisk();
            return diskImage.getStoragesNames().get(0);
        }
    };
    // $NON-NLS-1$
    imageDiskTable.addColumn(storageDomainColumn, constants.storageDomainVmDiskTable(), "100px");
    // $NON-NLS-1$
    imageDiskTable.addColumn(getDiskInterfaceSelectionColumn(), constants.interfaceVmDiskPopup(), "115px");
    imageDiskTable.addColumn(getReadOnlyCheckBoxColumn(), new ImageResourceHeader(resources.readOnlyDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.readOnly())), // $NON-NLS-1$
    "30px");
    imageDiskTable.addColumn(getBootCheckBoxColumn(), new ImageResourceHeader(resources.bootableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.bootableDisk())), // $NON-NLS-1$
    "30px");
    imageDiskTable.addColumn(new AbstractImageResourceColumn<EntityModel>() {

        @Override
        public ImageResource getValue(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            return disk.isShareable() ? resources.shareableDiskIcon() : null;
        }

        @Override
        public SafeHtml getTooltip(EntityModel object) {
            Disk disk = ((DiskModel) object.getEntity()).getDisk();
            if (disk.isShareable()) {
                return SafeHtmlUtils.fromSafeConstant(constants.shareable());
            }
            return null;
        }
    }, new ImageResourceHeader(resources.shareableDiskIcon(), SafeHtmlUtils.fromTrustedString(constants.shareable())), // $NON-NLS-1$
    "30px");
    // $NON-NLS-1$
    imageDiskTable.setWidth("100%");
    imageDiskTable.setEmptyTableWidget(new NoItemsLabel());
}
Also used : NoItemsLabel(org.ovirt.engine.ui.common.widget.label.NoItemsLabel) ImageResourceHeader(org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) AbstractDiskSizeColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn) ImageResource(com.google.gwt.resources.client.ImageResource) AbstractTextColumn(org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) CinderDisk(org.ovirt.engine.core.common.businessentities.storage.CinderDisk) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk)

Example 5 with NoItemsLabel

use of org.ovirt.engine.ui.common.widget.label.NoItemsLabel in project ovirt-engine by oVirt.

the class ImportExportImagePopupView method initTable.

private void initTable(ImportExportRepoImageBaseModel model) {
    imageList = new EntityModelCellTable<>(SelectionMode.NONE, true);
    imageList.enableColumnResizing();
    if (model.isImportModel()) {
        imageList.addColumn(new AbstractEntityModelTextColumn<RepoImage>() {

            @Override
            public String getText(RepoImage image) {
                return image.getRepoImageTitle();
            }
        }, constants.fileNameIso(), // $NON-NLS-1$
        "100%");
        imageList.addColumn(new DiskAliasTextColumn(new DiskAliasFieldUpdater()), templates.sub(constants.diskSnapshotAlias(), constants.clickToEdit()), // $NON-NLS-1$
        "150px");
        imageList.addColumn(new AbstractEntityModelTextColumn<RepoImage>() {

            @Override
            public String getText(RepoImage image) {
                return image.getFileType().toString();
            }
        }, constants.typeIso(), // $NON-NLS-1$
        "75px");
        imageList.addColumn(new AbstractDiskSizeColumn<EntityModel<RepoImage>>(SizeConverter.SizeUnit.BYTES) {

            @Override
            protected Long getRawValue(EntityModel<RepoImage> image) {
                return image.getEntity().getSize();
            }
        }, constants.size(), // $NON-NLS-1$
        "75px");
    } else {
        imageList.addColumn(new AbstractEntityModelTextColumn<DiskImage>() {

            @Override
            public String getText(DiskImage image) {
                return image.getDiskAlias();
            }
        }, constants.fileNameIso(), // $NON-NLS-1$
        "100%");
        imageList.addColumn(new AbstractEntityModelTextColumn<DiskImage>() {

            @Override
            public String getText(DiskImage image) {
                return ImageFileType.Disk.toString();
            }
        }, constants.typeIso(), // $NON-NLS-1$
        "75px");
        imageList.addColumn(new AbstractDiskSizeColumn<EntityModel<DiskImage>>(SizeConverter.SizeUnit.BYTES) {

            @Override
            protected Long getRawValue(EntityModel<DiskImage> image) {
                return image.getEntity().getSize();
            }
        }, constants.provisionedSizeTemplate(), // $NON-NLS-1$
        "75px");
    }
    // $NON-NLS-1$
    imageList.setWidth("100%");
    imageList.setEmptyTableWidget(new NoItemsLabel());
    imageListPanel.setWidget(imageList);
}
Also used : NoItemsLabel(org.ovirt.engine.ui.common.widget.label.NoItemsLabel) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) RepoImage(org.ovirt.engine.core.common.businessentities.storage.RepoImage) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

NoItemsLabel (org.ovirt.engine.ui.common.widget.label.NoItemsLabel)8 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)8 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)6 NoSelectionModel (com.google.gwt.view.client.NoSelectionModel)4 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)4 AbstractDiskSizeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn)4 RegisterEntityModel (org.ovirt.engine.ui.uicommonweb.models.storage.RegisterEntityModel)4 ImageResource (com.google.gwt.resources.client.ImageResource)3 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)3 CinderDisk (org.ovirt.engine.core.common.businessentities.storage.CinderDisk)3 LunDisk (org.ovirt.engine.core.common.businessentities.storage.LunDisk)3 ImageResourceHeader (org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader)3 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)2 AbstractEnumColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn)2 GuestContainer (org.ovirt.engine.core.common.businessentities.GuestContainer)1 VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)1 RepoImage (org.ovirt.engine.core.common.businessentities.storage.RepoImage)1 AbstractFullDateTimeColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractFullDateTimeColumn)1 AbstractRxTxRateColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractRxTxRateColumn)1 AbstractSumUpColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractSumUpColumn)1