@Override public StylesBuilder trustedColor(String value) { return delegate.styleProperty(SafeStylesUtils.forTrustedColor(value)); }
/** * <p> * Append the trusted font color, i.e., without escaping the value. No checks * are performed. The calling code should be carefully reviewed to ensure the * argument will satisfy the {@link SafeStyles} contract when they are * composed into the form: "<name>:<value>;". * * <p> * {@link SafeStyles} may never contain literal angle brackets. Otherwise, it * could be unsafe to place a {@link SafeStyles} into a <style> tag * (where it can't be HTML escaped). For example, if the {@link SafeStyles} * containing " * <code>font: 'foo <style><script>evil</script></code>'" is * used in a style sheet in a <style> tag, this could then break out of * the style context into HTML. * * @param value the property value * @return a {@link SafeStyles} instance */ public SafeStylesBuilder trustedColor(String value) { return append(SafeStylesUtils.forTrustedColor(value)); }
@Override public StylesBuilder trustedColor(String value) { return delegate.styleProperty(SafeStylesUtils.forTrustedColor(value)); }
@Override public StylesBuilder trustedColor(String value) { return delegate.styleProperty(SafeStylesUtils.forTrustedColor(value)); }
/** * <p> * Append the trusted font color, i.e., without escaping the value. No checks * are performed. The calling code should be carefully reviewed to ensure the * argument will satisfy the {@link SafeStyles} contract when they are * composed into the form: "<name>:<value>;". * * <p> * {@link SafeStyles} may never contain literal angle brackets. Otherwise, it * could be unsafe to place a {@link SafeStyles} into a <style> tag * (where it can't be HTML escaped). For example, if the {@link SafeStyles} * containing " * <code>font: 'foo <style><script>evil</script></code>'" is * used in a style sheet in a <style> tag, this could then break out of * the style context into HTML. * * @param value the property value * @return a {@link SafeStyles} instance */ public SafeStylesBuilder trustedColor(String value) { return append(SafeStylesUtils.forTrustedColor(value)); }
/** * <p> * Append the trusted font color, i.e., without escaping the value. No checks * are performed. The calling code should be carefully reviewed to ensure the * argument will satisfy the {@link SafeStyles} contract when they are * composed into the form: "<name>:<value>;". * * <p> * {@link SafeStyles} may never contain literal angle brackets. Otherwise, it * could be unsafe to place a {@link SafeStyles} into a <style> tag * (where it can't be HTML escaped). For example, if the {@link SafeStyles} * containing " * <code>font: 'foo <style><script>evil</script></code>'" is * used in a style sheet in a <style> tag, this could then break out of * the style context into HTML. * * @param value the property value * @return a {@link SafeStyles} instance */ public SafeStylesBuilder trustedColor(String value) { return append(SafeStylesUtils.forTrustedColor(value)); }
@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)); } });
@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)); } });