Package org.apache.slide.projector.value

Examples of org.apache.slide.projector.value.LocaleValue


  public String getElementName() {
      return "locale";
    }

  public Value load(Element element) {
    return new LocaleValue(new Locale(element.getText()));
  }
View Full Code Here


    public void configure(StreamableValue config) throws ConfigurationException {
        super.configure(config);
        parameterDescriptors = new ParameterDescriptor[] {
            new ParameterDescriptor(ACTION, new ParameterMessage("formGenerator/action"), new URIValueDescriptor()),
            new ParameterDescriptor(LOCALE, new ParameterMessage("formGenerator/locale"), new LocaleValueDescriptor(), new LocaleValue(Locale.getDefault())),
            new ParameterDescriptor(TARGET_STEP, new ParameterMessage("formGenerator/targetStep"), new StringValueDescriptor())
        };
        try {
            defaultTemplate = getRequiredFragment(DEFAULT_FORM);
        } catch ( ProcessException exception ) {
View Full Code Here

  public Value valueOf(Object value, Context context) throws ValueCastException {
    if ( value instanceof LocaleValue ) {
            return (LocaleValue)value;
    }
    try {
      return new LocaleValue(new Locale(StringValueDescriptor.ANY.valueOf(value, null).toString()));
    } catch ( ValueCastException exception ) {
      throw new ValueCastException(new ErrorMessage("uncastableLocaleValue", new Object[] { value }));
    }
  }
View Full Code Here

            }
            // FIXME: Only add values that are supported by the current webapp (configure globally)
            acceptedLanguages.add(new AcceptedLanguage(q, new Locale(localeToken)));
        }
        Collections.sort(acceptedLanguages);
        return new LocaleValue(((AcceptedLanguage)acceptedLanguages.get(0)).getLocale());
    }
View Full Code Here

    }

    public ParameterDescriptor[] getParameterDescriptors() {
        return new ParameterDescriptor[]{
            new ParameterDescriptor(EXCEPTION, new ParameterMessage("exceptionRenderer/exception"), new AnyValueDescriptor()),
            new ParameterDescriptor(LOCALE, new ParameterMessage("exceptionRenderer/locale"), new LocaleValueDescriptor(), new LocaleValue(Locale.getDefault()))
        };
    }
View Full Code Here

TOP

Related Classes of org.apache.slide.projector.value.LocaleValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.