/** * 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(); }
/** * Invoked to process text from an attribute or from an element's content. Performs two jobs: * <ul> * <li>Convert localized message references to localized strings * <li>Expand symbols using * {@link org.apache.hivemind.Registry#expandSymbols(String, Location)} * </ul> * <p> * Note: if the input is a localized message then no symbol expansion takes place. Localized * message references are simply strings that begin with '%'. The remainder of the string is the * message key. * <p> * A null input value passes through unchanged. */ public static String processText(SchemaProcessor processor, Element element, String inputValue) { if (inputValue == null) return null; Module contributingModule = processor.getContributingModule(); if (inputValue.startsWith("%")) { String key = inputValue.substring(1); return contributingModule.getMessages().getMessage(key); } return contributingModule.expandSymbols(inputValue, element.getLocation()); }
/** * 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()));
symbols.put(SYM_FIRSTDAYINWEEK, new Integer(cal.getFirstDayOfWeek() - 1)); symbols.put(SYM_MINDAYSINFIRSTWEEK, new Integer(cal.getMinimalDaysInFirstWeek())); symbols.put(SYM_CLEAR_BUTTON_LABEL, getMessages().getMessage("clear")); symbols.put(SYM_FORMNAME, getForm().getName()); symbols.put(SYM_VALUE, getValue()); writer.attribute("alt", getMessages().getMessage("alt")); writer.attribute("border", 0); writer.attribute("class", getImageClass());
symbols.put(SYM_FIRSTDAYINWEEK, new Integer(cal.getFirstDayOfWeek() - 1)); symbols.put(SYM_MINDAYSINFIRSTWEEK, new Integer(cal.getMinimalDaysInFirstWeek())); symbols.put(SYM_CLEAR_BUTTON_LABEL, getMessages().getMessage("clear")); symbols.put(SYM_FORMNAME, getForm().getName()); symbols.put(SYM_VALUE, getValue()); writer.attribute("alt", getMessages().getMessage("alt")); writer.attribute("border", 0); writer.attribute("class", getImageClass());