public String getKernelFeatures() { return kernelFeatures != null ? kernelFeatures : constants.notAvailableLabel(); }
private String formatKernelFeatures(Map<String, Object> kernelFeatures) { if (kernelFeatures == null) { return null; } final int vdsmNotAvailable = -1; final String concatenatedPairs = kernelFeatures.entrySet().stream() // only string and int values are shown, -1 int values are hidden - considered "N/A" .filter(pair -> pair.getValue() instanceof String || (pair.getValue() instanceof Integer && !Objects.equals(vdsmNotAvailable, pair.getValue()))) .map(pair -> pair.getKey() + ": " + pair.getValue()) //$NON-NLS-1$ .collect(Collectors.joining(", ")); //$NON-NLS-1$ if (concatenatedPairs.isEmpty()) { return constants.notAvailableLabel(); } return concatenatedPairs; }
public String getGuestCpuCount() { if (guestCpuCount > 0) { return String.valueOf(guestCpuCount); } else { return ConstantsManager.getInstance().getConstants().notAvailableLabel(); } }
public String getGuestCpuCount() { if (guestCpuCount > 0) { return String.valueOf(guestCpuCount); } else { return ConstantsManager.getInstance().getConstants().notAvailableLabel(); } }
public String getGuestCpuType() { return guestCpuType != null ? guestCpuType : ConstantsManager.getInstance().getConstants().notAvailableLabel(); }
@Override public String translate(Enum<?> key) { if (key == null) { final String result = constants.notAvailableLabel(); logger.warning("trying to localize null, probable error. " + "Exception is not thrown, returning '" + result + "'"); return result; } try { final String translatedString = enums.getString(keyToTranslate(key)); return translatedString != null ? translatedString : notLocalizedKey(key); } catch (MissingResourceException e) { // Silently ignore missing resource return notLocalizedKey(key, e); } }
@Override public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { boolean exactlyOneLunLeft = false; value.setIsLunRemovable(true); if (model.getMetadataDevices().size() == 0) { exactlyOneLunLeft = model.getNumOfLUNsToRemove() == model.getItems().size() - 1; } model.getRequireTableRefresh().setEntity(exactlyOneLunLeft); String inputId = id + "_input"; //$NON-NLS-1$ SafeHtml input; if (model.getMetadataDevices().contains(value.getLunId()) || model.getIncludedLuns().size() == 1 || exactlyOneLunLeft) { input = templates.noButton(uiConstants.notAvailableLabel(), SafeStylesUtils.forTrustedColor("gray"), inputId); //$NON-NLS-1$ value.setIsLunRemovable(false); } else if (value.isRemoveLunSelected()) { input = templates.toggledDown(inputId, constants.removeSanStorage()); } else { input = templates.toggledUp(inputId, constants.removeSanStorage()); } sb.append(templates.span(id, input)); } });
page -> messages.hugePages( String.valueOf(page.getSizeKB()), String.valueOf(page.getAmount() != null ? page.getAmount() : constants.notAvailableLabel())) ).collect(Collectors.joining(", "))); //$NON-NLS-1$ } else { setHugePages(constants.notAvailableLabel());
@Override public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { int availableSizeToAdd = value.getAdditionalAvailableSize(); String availableSizeToAddString = messages.additionalAvailableSizeInGB(availableSizeToAdd); boolean isGrayedOut = value.getIsGrayedOut(); String inputId = id + "_input"; //$NON-NLS-1$ SafeHtml input; if (!isGrayedOut && !value.getIsSelected()) { input = templates.toggledUp(inputId, constants.addSanStorage()); } else if (!isGrayedOut) { input = templates.toggledDown(inputId, constants.addSanStorage()); } else if (!value.getIsIncluded()) { input = templates.noButton(uiConstants.notAvailableLabel(), SafeStylesUtils.forTrustedColor("gray"), inputId); //$NON-NLS-1$ } else if (availableSizeToAdd == 0){ input = templates.noButton(constants.cannotExtendSanStorage(), SafeStylesUtils.forTrustedColor("gray"), inputId); //$NON-NLS-1$ } else if (value.isAdditionalAvailableSizeSelected()) { input = templates.toggledDown(inputId, availableSizeToAddString); } else { input = templates.toggledUp(inputId, availableSizeToAddString); } sb.append(templates.span(id, input)); } });