From 973564d475617298e5cb9c7e9286d5d3e40dcf66 Mon Sep 17 00:00:00 2001 From: Aleksi Hietanen Date: Tue, 4 Apr 2017 14:45:11 +0300 Subject: Add notification of pre-release renderers to grid documentation --- documentation/components/components-grid.asciidoc | 65 ++++++++++++----------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'documentation/components/components-grid.asciidoc') diff --git a/documentation/components/components-grid.asciidoc b/documentation/components/components-grid.asciidoc index c43a7ef04f..1ab9fa89ba 100644 --- a/documentation/components/components-grid.asciidoc +++ b/documentation/components/components-grid.asciidoc @@ -484,6 +484,40 @@ Column bornColumn = grid.addColumn(Person::getBirthDate, Optionally, a locale can be given. Otherwise, the default locale (in the component tree) is used. +[classname]#HTMLRenderer#:: Renders the cell as HTML. +This allows formatting the cell content, as well as using HTML features such as hyperlinks. + ++ +Set the renderer in the [classname]#Grid.Column# object: ++ +[source, java] +---- +Column htmlColumn grid.addColumn(person -> + "info", + new HtmlRenderer()); +---- + +[classname]#NumberRenderer#:: Formats column values with a numeric type extending [classname]#Number#: +[classname]#Integer#, [classname]#Double#, etc. The format can be specified +either by the subclasses of [classname]#java.text.NumberFormat#, namely +[classname]#DecimalFormat# and [classname]#ChoiceFormat#, or by +[methodname]#String.format()#. + ++ +For example: ++ +[source, java] +---- +// Use decimal format +Column birthYear = grid.addColumn(Person::getBirthYear, + new NumberRenderer(new DecimalFormat("in #### AD"))); +---- + +[classname]#ProgressBarRenderer#:: Renders a progress bar in a column with a [classname]#Double# type. The value +must be between 0.0 and 1.0. + +IMPORTANT: The following renderers are to be released in version 8.1 and are currently only available in link:https://vaadin.com/releases[pre-release versions] of the framework, starting from 8.1.0.alpha3. + [classname]#LocalDateRenderer#:: Formats a column with the [classname]#LocalDate# type. The renderer can be constructed with a [classname]#DateTimeFormatter#, or with a custom pattern string. @@ -531,37 +565,6 @@ Column bornColumn = new LocalDateTimeRenderer("yyyy.MM.dd 'at' hh:mm")); ---- -[classname]#HTMLRenderer#:: Renders the cell as HTML. -This allows formatting the cell content, as well as using HTML features such as hyperlinks. - -+ -Set the renderer in the [classname]#Grid.Column# object: -+ -[source, java] ----- -Column htmlColumn grid.addColumn(person -> - "info", - new HtmlRenderer()); ----- - -[classname]#NumberRenderer#:: Formats column values with a numeric type extending [classname]#Number#: -[classname]#Integer#, [classname]#Double#, etc. The format can be specified -either by the subclasses of [classname]#java.text.NumberFormat#, namely -[classname]#DecimalFormat# and [classname]#ChoiceFormat#, or by -[methodname]#String.format()#. - -+ -For example: -+ -[source, java] ----- -// Use decimal format -Column birthYear = grid.addColumn(Person::getBirthYear, - new NumberRenderer(new DecimalFormat("in #### AD"))); ----- - -[classname]#ProgressBarRenderer#:: Renders a progress bar in a column with a [classname]#Double# type. The value -must be between 0.0 and 1.0. [classname]#ComponentRenderer#:: Renders a Vaadin [classname]#Component# in a column. Since components are quite complex, the [classname]#ComponentRenderer# comes with possible performance issues. -- cgit v1.2.3