Search in sources :

Example 11 with StringValueLabel

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

the class StoragesTree method getRootItem.

@Override
protected TreeItem getRootItem(StorageDomainModel storageDomainModel) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(1);
    // $NON-NLS-1$
    panel.setWidth("100%");
    StorageDomain storage = storageDomainModel.getStorageDomain();
    // $NON-NLS-1$
    addItemToPanel(panel, new Image(resources.storageImage()), "25px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), storage.getStorageName(), "");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<StorageDomainType>(), storage.getStorageDomainType(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<StorageDomainSharedStatus>(), storage.getStorageDomainSharedStatus(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Integer>(), storage.getAvailableDiskSize(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Integer>(), storage.getUsedDiskSize(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Integer>(), storage.getTotalDiskSize(), "90px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(storage.getId());
    return treeItem;
}
Also used : StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) TreeItem(com.google.gwt.user.client.ui.TreeItem) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Image(com.google.gwt.user.client.ui.Image) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) StringValueLabel(org.ovirt.engine.ui.common.widget.label.StringValueLabel) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus)

Example 12 with StringValueLabel

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

the class VMsTree method getSnapshotNode.

private TreeItem getSnapshotNode(List<DiskImage> disks) {
    VerticalPanel vPanel = new VerticalPanel();
    // $NON-NLS-1$
    vPanel.setWidth("100%");
    for (DiskImage disk : disks) {
        HorizontalPanel panel = new HorizontalPanel();
        ImageResource image = resources.snapshotImage();
        String name = disk.getDescription();
        // $NON-NLS-1$
        addItemToPanel(panel, new Image(image), "25px");
        // $NON-NLS-1$
        addTextBoxToPanel(panel, new StringValueLabel(), name, "");
        // $NON-NLS-1$ //$NON-NLS-2$
        addTextBoxToPanel(panel, new StringValueLabel(), "", "80px");
        // $NON-NLS-1$ //$NON-NLS-2$
        addTextBoxToPanel(panel, new StringValueLabel(), "", "160px");
        // $NON-NLS-1$
        addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "110px");
        // $NON-NLS-1$
        addValueLabelToPanel(panel, new DiskSizeLabel<Double>(SizeConverter.SizeUnit.GiB), disk.getActualSize(), "110px");
        // $NON-NLS-1$
        addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getCreationDate(), "140px");
        panel.setSpacing(1);
        // $NON-NLS-1$
        panel.setWidth("100%");
        vPanel.add(panel);
    }
    TreeItem treeItem = new TreeItem(vPanel);
    // $NON-NLS-1$
    treeItem.setUserObject(disks.get(0).getId() + "snapshot");
    return treeItem;
}
Also used : TreeItem(com.google.gwt.user.client.ui.TreeItem) Image(com.google.gwt.user.client.ui.Image) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) StringValueLabel(org.ovirt.engine.ui.common.widget.label.StringValueLabel) FullDateTimeLabel(org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ImageResource(com.google.gwt.resources.client.ImageResource) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Example 13 with StringValueLabel

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

the class VMsTree method getRootItem.

@Override
protected TreeItem getRootItem(VM vm) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(1);
    // $NON-NLS-1$
    panel.setWidth("100%");
    // $NON-NLS-1$
    addItemToPanel(panel, new Image(resources.vmImage()), "25px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), vm.getName(), "");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), String.valueOf(vm.getDiskMap().size()), "80px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), vm.getVmtName(), "160px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Double>(), vm.getDiskSize(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Double>(), vm.getActualDiskWithSnapshotsSize(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new FullDateTimeLabel(), vm.getVmCreationDate(), "140px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(vm.getId());
    return treeItem;
}
Also used : TreeItem(com.google.gwt.user.client.ui.TreeItem) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Image(com.google.gwt.user.client.ui.Image) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) StringValueLabel(org.ovirt.engine.ui.common.widget.label.StringValueLabel) FullDateTimeLabel(org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel)

Aggregations

StringValueLabel (org.ovirt.engine.ui.common.widget.label.StringValueLabel)13 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)10 TreeItem (com.google.gwt.user.client.ui.TreeItem)10 Image (com.google.gwt.user.client.ui.Image)9 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)9 FullDateTimeLabel (org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel)6 ImageResource (com.google.gwt.resources.client.ImageResource)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 StorageDomainSharedStatus (org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus)2 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)2 DiskInterface (org.ovirt.engine.core.common.businessentities.storage.DiskInterface)2 DiskStorageType (org.ovirt.engine.core.common.businessentities.storage.DiskStorageType)2 ImageStatus (org.ovirt.engine.core.common.businessentities.storage.ImageStatus)2 VolumeType (org.ovirt.engine.core.common.businessentities.storage.VolumeType)2 DateLabel (com.google.gwt.user.client.ui.DateLabel)1 IsWidget (com.google.gwt.user.client.ui.IsWidget)1 Label (com.google.gwt.user.client.ui.Label)1 ValueLabel (com.google.gwt.user.client.ui.ValueLabel)1 Widget (com.google.gwt.user.client.ui.Widget)1 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)1