Search in sources :

Example 1 with TemplateImportDiskListModel

use of org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportDiskListModel in project ovirt-engine by oVirt.

the class TemplateBackupModel method restore.

@Override
protected void restore() {
    if (getWindow() != null) {
        return;
    }
    if (!validateSingleArchitecture()) {
        return;
    }
    ImportTemplateModel model = importModelProvider.get();
    model.setEntity(getEntity().getId());
    setWindow(model);
    model.startProgress();
    model.setTitle(ConstantsManager.getInstance().getConstants().importTemplatesTitle());
    // $NON-NLS-1$
    model.getCommands().add(UICommand.createDefaultOkUiCommand("OnRestore", this));
    // $NON-NLS-1$);
    model.getCommands().add(UICommand.createCancelUiCommand(CANCEL_COMMAND, this));
    model.init(getSelectedItems(), getEntity().getId());
    model.setTargetArchitecture(getArchitectureFromItem(getSelectedItems().get(0)));
    // Add 'Close' command
    model.setCloseCommand(// $NON-NLS-1$
    new UICommand(CANCEL_COMMAND, this).setTitle(ConstantsManager.getInstance().getConstants().close()).setIsDefault(true).setIsCancel(true));
    ((TemplateImportDiskListModel) ((ImportTemplateModel) getWindow()).getImportDiskListModel()).setExtendedItems(extendedItems);
}
Also used : ImportTemplateModel(org.ovirt.engine.ui.uicommonweb.models.templates.ImportTemplateModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) TemplateImportDiskListModel(org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportDiskListModel)

Aggregations

UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 ImportTemplateModel (org.ovirt.engine.ui.uicommonweb.models.templates.ImportTemplateModel)1 TemplateImportDiskListModel (org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportDiskListModel)1