Search in sources :

Example 1 with FullDateTimeLabel

use of org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel in project ovirt-engine by oVirt.

the class TemplatesTree method getRootItem.

@Override
protected TreeItem getRootItem(VmTemplate template) {
    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(), template.getName(), "");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Integer>(), template.getDiskTemplateMap().size(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Double>(), template.getActualDiskSize(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new FullDateTimeLabel(), template.getCreationDate(), "140px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(template.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)

Example 2 with FullDateTimeLabel

use of org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel in project ovirt-engine by oVirt.

the class TemplatesTree method getNodeItem.

@Override
protected TreeItem getNodeItem(DiskImage disk) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(1);
    // $NON-NLS-1$
    panel.setWidth("100%");
    // $NON-NLS-1$
    addItemToPanel(panel, new Image(resources.diskImage()), "25px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), disk.getDiskAlias(), "");
    // $NON-NLS-1$ //$NON-NLS-2$
    addTextBoxToPanel(panel, new StringValueLabel(), "", "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getSize(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Double>(), disk.getActualSize(), "110px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getCreationDate(), "140px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(disk.getImageId());
    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)

Example 3 with FullDateTimeLabel

use of org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel in project ovirt-engine by oVirt.

the class VMsTree method getDiskNode.

private TreeItem getDiskNode(ArrayList<Disk> disks) {
    if (disks.isEmpty()) {
        return null;
    }
    VerticalPanel vPanel = new VerticalPanel();
    // $NON-NLS-1$
    vPanel.setWidth("100%");
    for (Disk disk : disks) {
        HorizontalPanel panel = new HorizontalPanel();
        ImageResource image = resources.diskImage();
        String name = disk.getDiskAlias();
        // $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");
        boolean isDiskImage = disk.getDiskStorageType() == DiskStorageType.IMAGE;
        Double actualSize = isDiskImage ? ((DiskImage) disk).getActualDiskWithSnapshotsSize() : (long) ((LunDisk) disk).getLun().getDeviceSize();
        Long virtualSize = isDiskImage ? disk.getSize() : (long) (((LunDisk) disk).getLun().getDeviceSize() * Math.pow(1024, 3));
        // $NON-NLS-1$
        addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), virtualSize, "110px");
        // $NON-NLS-1$
        addValueLabelToPanel(panel, new DiskSizeLabel<Double>(SizeConverter.SizeUnit.GiB), actualSize, "110px");
        addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getDiskStorageType() == DiskStorageType.IMAGE ? ((DiskImage) disk).getCreationDate() : null, // $NON-NLS-1$
        "140px");
        panel.setSpacing(1);
        // $NON-NLS-1$
        panel.setWidth("100%");
        vPanel.add(panel);
    }
    TreeItem treeItem = new TreeItem(vPanel);
    treeItem.setUserObject(disks.get(0).getId());
    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) LunDisk(org.ovirt.engine.core.common.businessentities.storage.LunDisk) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Example 4 with FullDateTimeLabel

use of org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel in project ovirt-engine by oVirt.

the class DisksTree method getRootItem.

@Override
protected TreeItem getRootItem(DiskImage disk) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(1);
    // $NON-NLS-1$
    panel.setWidth("100%");
    DiskVmElement dve = disk.getDiskVmElements().iterator().next();
    // $NON-NLS-1$
    addItemToPanel(panel, new Image(resources.diskImage()), "25px");
    // $NON-NLS-1$
    addTextBoxToPanel(panel, new StringValueLabel(), disk.getDiskAlias(), "");
    // $NON-NLS-1$
    addItemToPanel(panel, dve.isReadOnly() ? new Image(resources.readOnlyDiskIcon()) : new Image(), "60px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getActualSizeInBytes(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), dve.getDiskInterface(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new EnumLabel<DiskStorageType>(), disk.getDiskStorageType(), "120px");
    // $NON-NLS-1$
    addValueLabelToPanel(panel, new FullDateTimeLabel(), disk.getCreationDate(), "140px");
    TreeItem treeItem = new TreeItem(panel);
    treeItem.setUserObject(disk.getId());
    return treeItem;
}
Also used : TreeItem(com.google.gwt.user.client.ui.TreeItem) ImageStatus(org.ovirt.engine.core.common.businessentities.storage.ImageStatus) DiskStorageType(org.ovirt.engine.core.common.businessentities.storage.DiskStorageType) 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) VolumeType(org.ovirt.engine.core.common.businessentities.storage.VolumeType) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) DiskVmElement(org.ovirt.engine.core.common.businessentities.storage.DiskVmElement) DiskInterface(org.ovirt.engine.core.common.businessentities.storage.DiskInterface)

Example 5 with FullDateTimeLabel

use of org.ovirt.engine.ui.webadmin.widget.label.FullDateTimeLabel 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)

Aggregations

HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)6 Image (com.google.gwt.user.client.ui.Image)6 TreeItem (com.google.gwt.user.client.ui.TreeItem)6 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)6 StringValueLabel (org.ovirt.engine.ui.common.widget.label.StringValueLabel)6 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 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)1 DiskInterface (org.ovirt.engine.core.common.businessentities.storage.DiskInterface)1 DiskStorageType (org.ovirt.engine.core.common.businessentities.storage.DiskStorageType)1 DiskVmElement (org.ovirt.engine.core.common.businessentities.storage.DiskVmElement)1 ImageStatus (org.ovirt.engine.core.common.businessentities.storage.ImageStatus)1 LunDisk (org.ovirt.engine.core.common.businessentities.storage.LunDisk)1 VolumeType (org.ovirt.engine.core.common.businessentities.storage.VolumeType)1