Search in sources :

Example 1 with PreviewSnapshotModel

use of org.ovirt.engine.ui.uicommonweb.models.vms.PreviewSnapshotModel in project ovirt-engine by oVirt.

the class VmSnapshotCustomPreviewPopupWidget method edit.

@Override
public void edit(PreviewSnapshotModel model) {
    driver.edit(model);
    previewSnapshotModel = model;
    snapshotInfoContainer.add(vmSnapshotInfoPanel);
    previewTable.asEditor().edit(previewSnapshotModel.getSnapshots());
    // Add selection listener
    model.getSnapshots().getSelectedItemChangedEvent().addListener((ev, sender, args) -> {
        ListModel snapshots = (ListModel) sender;
        SnapshotModel snapshotModel = (SnapshotModel) snapshots.getSelectedItem();
        if (snapshotModel != null) {
            vmSnapshotInfoPanel.updatePanel(snapshotModel);
        }
    });
    model.getSnapshots().getItemsChangedEvent().addListener((ev, sender, args) -> createPreviewTable());
}
Also used : ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) PreviewSnapshotModel(org.ovirt.engine.ui.uicommonweb.models.vms.PreviewSnapshotModel) SnapshotModel(org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel)

Aggregations

ListModel (org.ovirt.engine.ui.uicommonweb.models.ListModel)1 PreviewSnapshotModel (org.ovirt.engine.ui.uicommonweb.models.vms.PreviewSnapshotModel)1 SnapshotModel (org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel)1