Package javax.faces.convert

Examples of javax.faces.convert.DateTimeConverter


    super.encodeEnd(facesContext, component);

    Converter help = getConverter(facesContext, component);
    // TODO is this really needed?
    if (help instanceof DateTimeConverter) {
      DateTimeConverter converter = (DateTimeConverter) help;
      String pattern = DateFormatUtils.findPattern(converter);

      if (pattern != null) {
        TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
        String id = component.getClientId(facesContext);
View Full Code Here


    if (converterPattern != null && (converterPattern.indexOf('h') > -1 || converterPattern.indexOf('H') > -1)) {
      UIComponent time = timePanel.findComponent("time");
      int popupHeight = ComponentUtil.getIntAttribute(popup, ATTR_HEIGHT);
      popupHeight += ThemeConfig.getValue(FacesContext.getCurrentInstance(), time, "fixedHeight");
      popup.getAttributes().put(ATTR_HEIGHT, String.valueOf(popupHeight));
      DateTimeConverter dateTimeConverter
             = (DateTimeConverter) facesContext.getApplication().createConverter(CONVERTER_ID);
      if (converterPattern.indexOf('s') > -1) {
        dateTimeConverter.setPattern("HH:mm:ss");
      } else {
        dateTimeConverter.setPattern("HH:mm");
      }
      dateTimeConverter.setTimeZone(TimeZone.getDefault());
      ((ValueHolder) time).setConverter(dateTimeConverter);
    } else {
      timePanel.setRendered(false);
    }
  }
View Full Code Here

    Converter converter = super.getConverter();
    if (converter == null) {
      // setting required default converter
      Application application
          = FacesContext.getCurrentInstance().getApplication();
      DateTimeConverter dateTimeConverter
          = (DateTimeConverter) application.createConverter(CONVERTER_ID);
      dateTimeConverter.setPattern("HH:mm");
      dateTimeConverter.setTimeZone(TimeZone.getDefault());
      setConverter(dateTimeConverter);
    }
    return converter;
  }
View Full Code Here

    super.encodeEnd(facesContext, component);

    Converter help = getConverter(facesContext, component);
    // TODO is this really needed?
    if (help instanceof DateTimeConverter) {
      DateTimeConverter converter = (DateTimeConverter) help;
      String pattern = DateFormatUtils.findPattern(converter);

      if (pattern != null) {
        TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);
        String id = component.getClientId(facesContext);
View Full Code Here

        _type = type;
    }

    protected Converter createConverter() throws JspException
    {
        DateTimeConverter converter = (DateTimeConverter)super.createConverter();

        FacesContext facesContext = FacesContext.getCurrentInstance();
        setConverterDateStyle(facesContext, converter, _dateStyle);
        setConverterLocale(facesContext, converter, _locale);
        setConverterPattern(facesContext, converter, _pattern);
View Full Code Here

    }

    @Override
    protected Converter createConverter() throws JspException
    {
        DateTimeConverter converter = (DateTimeConverter)super.createConverter();

        ELContext elContext = FacesContext.getCurrentInstance().getELContext();
        setConverterDateStyle(elContext, converter, _dateStyle);
        setConverterLocale(elContext, converter, _locale);
        setConverterPattern(elContext, converter, _pattern);
View Full Code Here

        return super.doStartTag();
    }

    protected Converter createConverter() throws JspException
        {
            DateTimeConverter converter = (DateTimeConverter)super.createConverter();

            ELContext elContext = FacesContext.getCurrentInstance().getELContext();
            setConverterDateStyle(elContext, converter, _dateStyle);
            setConverterLocale(elContext, converter, _locale);
            setConverterPattern(elContext, converter, _pattern);
View Full Code Here

        _type = type;
    }

    protected Converter createConverter() throws JspException
    {
        DateTimeConverter converter = (DateTimeConverter)super.createConverter();

        FacesContext facesContext = FacesContext.getCurrentInstance();
        setConverterDateStyle(facesContext, converter, _dateStyle);
        setConverterLocale(facesContext, converter, _locale);
        setConverterPattern(facesContext, converter, _pattern);
View Full Code Here

    // for convenience, we will set the time zone of the converter to that
    // specified by the context or, if that is not present, to the time zone
    // of the server
    if (converter instanceof DateTimeConverter)
    {
      DateTimeConverter dtc = (DateTimeConverter) converter;
     
      boolean trinidadDTC = _isTrinidadDateTimeConverter(converter);
     
      if (!trinidadDTC)
      {
        // if it is not the Trinidad DateTimeConverter, set the date style to
        // short
        dtc.setDateStyle("short");
      }
     
      // if it is not the Trinidad DateTimeConverter or (it is AND
      // no time zone is set) then we want to set the
      // time zone to the one in the faces context or use
      // the default server time zone on the converter
      if (!trinidadDTC || dtc.getTimeZone() == null)
      {
        TimeZone tz = null;
       
        RequestContext requestContext = RequestContext.getCurrentInstance();
        tz = requestContext.getTimeZone();
        if(tz == null)
        {
          tz = TimeZone.getDefault();
        }
       
        dtc.setTimeZone(tz);
      }
    }
   
    return converter;
  }
View Full Code Here

        return super.doStartTag();
    }

    protected Converter createConverter() throws JspException
        {
            DateTimeConverter converter = (DateTimeConverter)super.createConverter();

            ELContext elContext = FacesContext.getCurrentInstance().getELContext();
            setConverterDateStyle(elContext, converter, _dateStyle);
            setConverterLocale(elContext, converter, _locale);
            setConverterPattern(elContext, converter, _pattern);
View Full Code Here

TOP

Related Classes of javax.faces.convert.DateTimeConverter

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.