Source:
protected void updateActionsAvailability() { VmTemplate item = getSelectedItem(); List<VmTemplate> items = (getSelectedItems() != null) ? getSelectedItems() : new ArrayList<VmTemplate>(); boolean blankSelected = isBlankTemplateSelected(); getEditCommand().setIsExecutionAllowed(items.size() == 1 && item != null && item.getStatus() != VmTemplateStatus.Locked); getRemoveCommand().setIsExecutionAllowed(items.size() > 0 && VdcActionUtils.canExecute(items, VmTemplate.class, VdcActionType.RemoveVmTemplate)); if (getRemoveCommand().getIsExecutionAllowed() && blankSelected) { getRemoveCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .blankTemplateCannotBeRemoved()); getRemoveCommand().setIsExecutionAllowed(false); } getExportCommand().setIsExecutionAllowed(items.size() > 0 && VdcActionUtils.canExecute(items, VmTemplate.class, VdcActionType.ExportVmTemplate)); if (getExportCommand().getIsExecutionAllowed() && blankSelected) { getExportCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .blankTemplateCannotBeExported()); getExportCommand().setIsExecutionAllowed(false); } getSysprepCommand().setIsExecutionAllowed(items.size() == 1 && item != null && VdcActionUtils.canExecute(Collections.singletonList(item), VmTemplate.class, VdcActionType.ExportVmTemplate)); if (getSysprepCommand().getIsExecutionAllowed() && blankSelected) { getSysprepCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .blankTemplateCannotBeSyspreped()); getSysprepCommand().setIsExecutionAllowed(false); } getCreateVmFromTemplateCommand().setIsExecutionAllowed(items.size() == 1 && item != null && item.getStatus() != VmTemplateStatus.Locked); }

Target:
protected void updateActionsAvailability() { VmTemplate item = getSelectedItem(); List<VmTemplate> items = (getSelectedItems() != null) ? getSelectedItems() : new ArrayList<VmTemplate>(); boolean blankSelected = isBlankTemplateSelected(); getEditCommand().setIsExecutionAllowed(items.size() == 1 && item != null && item.getStatus() != VmTemplateStatus.Locked); getRemoveCommand().setIsExecutionAllowed(items.size() > 0 && VdcActionUtils.canExecute(items, VmTemplate.class, VdcActionType.RemoveVmTemplate)); if (getRemoveCommand().getIsExecutionAllowed() && blankSelected) { getRemoveCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .blankTemplateCannotBeRemoved()); getRemoveCommand().setIsExecutionAllowed(false); } getExportCommand().setIsExecutionAllowed(items.size() > 0 && VdcActionUtils.canExecute(items, VmTemplate.class, VdcActionType.ExportVmTemplate)); if (getExportCommand().getIsExecutionAllowed() && blankSelected) { getExportCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .blankTemplateCannotBeExported()); getExportCommand().setIsExecutionAllowed(false); } getSysprepCommand().setIsExecutionAllowed(items.size() == 1 && item != null && VdcActionUtils.canExecute(Collections.singletonList(item), VmTemplate.class, VdcActionType.SysprepVmTemplate) && !AsyncDataProvider.getInstance().isWindowsOsType(item.getOsId())); if (getSysprepCommand().getIsExecutionAllowed() && blankSelected) { getSysprepCommand().getExecuteProhibitionReasons().add(ConstantsManager.getInstance() .getConstants() .blankTemplateCannotBeSyspreped()); getSysprepCommand().setIsExecutionAllowed(false); } getCreateVmFromTemplateCommand().setIsExecutionAllowed(items.size() == 1 && item != null && item.getStatus() != VmTemplateStatus.Locked); }