public void onHotUnplug(VmDeviceFeEntity deviceEntity) { if (getEntity() == null) { return; } if (deviceEntity == null || deviceEntity.getVmDevice().getType() != VmDeviceGeneralType.MEMORY) { return; } final Optional<Integer> memorySizeOptional = VmDeviceCommonUtils.getSizeOfMemoryDeviceMb(deviceEntity.getVmDevice()); if (!memorySizeOptional.isPresent()) { return; } final int memorySizeMb = memorySizeOptional.get(); setSelectedItem(deviceEntity); ConfirmationModel confirmationModel = new ConfirmationModel(); confirmationModel.setTitle(constants.memoryHotUnplug()); confirmationModel.setHelpTag(HelpTag.template_not_found_on_export_domain); confirmationModel.setMessage(messages.memoryHotUnplugConfirmation(memorySizeMb, getEntity().getName())); confirmationModel.getCommands().add(memoryHotUnplugCommand); confirmationModel.getCommands().add(cancelMemoryHotUnplugCommand); setConfirmWindow(confirmationModel); }