Class DateLabel

    • Constructor Detail

      • DateLabel

        public DateLabel​(String id,
                         DateConverter converter)
        Construct with a converter.
        Parameters:
        id - The component id
        converter - The converter to use
      • DateLabel

        public DateLabel​(String id,
                         IModel<Date> model,
                         DateConverter converter)
        Construct with a converter.
        Parameters:
        id - The component id
        model - The model
        converter - The converter to use
    • Method Detail

      • forDatePattern

        public static DateLabel forDatePattern​(String id,
                                               IModel<Date> model,
                                               String datePattern)
        Creates a new DateLabel defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        model - The model
        datePattern - The pattern to use. Must be not null. See SimpleDateFormat for available patterns.
        Returns:
        new instance
        See Also:
        TextField
      • forDatePattern

        public static DateLabel forDatePattern​(String id,
                                               String datePattern)
        Creates a new DateLabel defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        datePattern - The pattern to use. Must be not null. See SimpleDateFormat for available patterns.
        Returns:
        new instance
        See Also:
        TextField
      • forDateStyle

        public static DateLabel forDateStyle​(String id,
                                             IModel<Date> model,
                                             String dateStyle)
        Creates a new DateLabel defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        model - The model
        dateStyle - style to use in case no pattern is provided. Must be two characters from the set {"S", "M", "L", "F", "-"}. Must be not null. See DateTimeFormat.forStyle(String) for options.
        Returns:
        new instance
        See Also:
        TextField
      • forDateStyle

        public static DateLabel forDateStyle​(String id,
                                             String dateStyle)
        Creates a new DateLabel defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        dateStyle - style to use in case no pattern is provided. Must be two characters from the set {"S", "M", "L", "F", "-"}. Must be not null. See DateTimeFormat.forStyle(String) for options.
        Returns:
        new instance
        See Also:
        TextField
      • forShortStyle

        public static DateLabel forShortStyle​(String id)
        Creates a new DateLabel defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        Returns:
        new instance
        See Also:
        TextField
      • forShortStyle

        public static DateLabel forShortStyle​(String id,
                                              IModel<Date> model)
        Creates a new DateLabel defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        model - The model
        Returns:
        new instance
        See Also:
        TextField
      • withConverter

        public static DateLabel withConverter​(String id,
                                              DateConverter converter)
        Creates a new DateLabel using the provided converter.
        Parameters:
        id - The id of the text field
        converter - the date converter
        Returns:
        new instance
        See Also:
        TextField
      • withConverter

        public static DateLabel withConverter​(String id,
                                              IModel<Date> model,
                                              DateConverter converter)
        Creates a new DateLabel using the provided converter.
        Parameters:
        id - The id of the text field
        model - The model
        converter - the date converter
        Returns:
        new instance
        See Also:
        TextField
      • getAfter

        public String getAfter()
        Returns:
        after append to label or null
      • getBefore

        public String getBefore()
        Returns:
        before prepend to label or null
      • setAfter

        public void setAfter​(String after)
        Parameters:
        after - append to label
      • setBefore

        public void setBefore​(String before)
        Parameters:
        before - prepend to label