/** * Accesses the specified localized string. Never returns null. */ public Object getObject() { return _component.getMessages().getMessage(_description); }
/** * Accesses the specified localized string. Never returns null. */ public Object getObject() { return _component.getMessages().getMessage(_description); }
/** * Extract expression if it is indicated as message code. * * @param expr * @return real evaluated expression. */ private String extractExpression(String expr) { if (expr.startsWith("%")) { String key = expr.substring(1); return root.getMessages().getMessage(key); } return expr; }
private String extractLocalizedMessage(String messageOverride, String messageKey) { if (messageOverride == null) return ValidationStrings.getMessagePattern(messageKey, _locale); if (messageOverride.startsWith("%")) { String key = messageOverride.substring(1); return _field.getContainer().getMessages().getMessage(key); } // Otherwise, a literal string return messageOverride; }
private String extractLocalizedMessage(String messageOverride, String messageKey) { if (messageOverride == null) return ValidationStrings.getMessagePattern(messageKey, _locale); if (messageOverride.startsWith("%")) { String key = messageOverride.substring(1); return _field.getContainer().getMessages().getMessage(key); } // Otherwise, a literal string return messageOverride; }
public void render(IMarkupWriter writer, IRequestCycle cycle) { if (cycle.isRewinding()) return; if (_attributes != null) { writer.begin(_tag == null ? "span" : _tag); Iterator i = _attributes.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); String attributeName = (String) entry.getKey(); String attributeValue = (String) entry.getValue(); writer.attribute(attributeName, attributeValue); } } if (_value == null) _value = _component.getMessages().getMessage(_key); writer.print(_value, _raw); if (_attributes != null) writer.end(); }
public void render(IMarkupWriter writer, IRequestCycle cycle) { if (cycle.isRewinding()) return; if (_attributes != null) { writer.begin(_tag == null ? "span" : _tag); Iterator i = _attributes.entrySet().iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); String attributeName = (String) entry.getKey(); String attributeValue = (String) entry.getValue(); writer.attribute(attributeName, attributeValue); } } if (_value == null) _value = _component.getMessages().getMessage(_key); writer.print(_value, _raw); if (_attributes != null) writer.end(); }
/** * Use the column name to get the display name, as well as the column and * value renderer sources from the provided component. * * @param objSettingsContainer * the component from which to get the settings */ public void loadSettings(IComponent objSettingsContainer) { String strDisplayName = objSettingsContainer.getMessages().getMessage(getDisplayName()); // Hack! the Messages inteface needs to restore the getMessage(key, // default), or needs // to add a containsKey(key) method. Looking for the '[' used with // invalid/unknown keys. if (!strDisplayName.startsWith("[")) { setDisplayName(strDisplayName); } super.loadSettings(objSettingsContainer); }
writer.attribute("class", "localized-string"); writer.print(component.getMessages().getMessage(token.getKey()));