Package org.dellroad.stuff.vaadin8
Annotation Type GridColumn
-
@Retention(RUNTIME) @Target({METHOD,FIELD}) @Documented public @interface GridColumn
Provides the information necessary to auto-generate aGrid.Columnand a field for editing values, based on annotated getter methods.Example:
// Container backing object class public class User { private String username; private LocalDate dateOfBirth; @FieldBuilder.AbstractComponent(caption = "Username:") @FieldBuilder.AbstractTextField(maxLength = 16) @FieldBuilder.Binding(required = "Username is required") @GridColumn(caption = "Username", expandRatio = 3) public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } @FieldBuilder.AbstractComponent(caption = "Date Of Birth:") @FieldBuilder.DateField @GridColumn(caption = "DOB", sortable = true) public LocalDate getDateOfBirth() { return this.dateOfBirth; } public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; } } // Build Grid with auto-generated columns Grid<User> grid = new GridColumnScanner(User.class).buildGrid(); ...Some details regarding
@GridColumnannotations:- Only non-void methods taking zero parameters are supported;
@GridColumnannotations on other methods are ignored - Protected, package private, and private methods are supported.
@GridColumnannotations declared in super-types (including interfaces) are supported- If a method and the superclass or superinterface method it overrides are both annotated with
@GridColumn, then the overridding method's annotation takes precedence. - If two methods with different names are annotated with
@GridColumnfor the same property name, then the declaration in the class which is a sub-type of the other wins (if the two classes are equal or not comparable, an exception is thrown). This allows subclasses to "override" which method supplies a given property. - Columns will be ordered first by
order(), then by property name
- See Also:
GridColumnScanner
- Only non-void methods taking zero parameters are supported;
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringcaptionGet the caption for the Grid column.Class<? extends SerializableComparator>comparatorGet the in-memory comparator for the Grid column.Class<? extends DescriptionGenerator>descriptionGeneratorGet the description generator for the Grid column.booleaneditableGet whether the Grid column is editable.intexpandRatioGet the expand ratio for the Grid column.booleanhidableGet whether the Grid column is hidable.booleanhiddenGet whether the Grid column is hidden.StringhidingToggleCaptionGet the hiding toggle caption for the Grid column.StringidGet the debug ID for the Grid column.doublemaximumWidthGet the maximum width for the Grid column.doubleminimumWidthGet the minimum width for the Grid column.doubleorderGet the ordering value for this column.Class<? extends Renderer>rendererGet the renderer for the Grid column.booleanresizableGet whether the Grid column is resizable.booleansortableGet whether the Grid column is sortable.Class<? extends SortOrderProvider>sortOrderProviderGet the sort order provider for the Grid column.String[]sortPropertyGet the back-end sort properties for the Grid column.Class<? extends StyleGenerator>styleGeneratorGet the style generator for the Grid column.StringvalueGet the column ID.Class<? extends ValueProvider>valueProviderGet the presentation value provider for the Grid column.doublewidthGet the width for the Grid column.
-
-
-
Element Detail
-
value
String value
Get the column ID.If this is left unset (empty string), then the bean property name of the annotated bean property "getter" method is used.
- Returns:
- property name
- Default:
- ""
-
-
-
caption
String caption
Get the caption for the Grid column.- Returns:
- column caption
- See Also:
Grid.Column.setCaption(java.lang.String)
- Default:
- ""
-
-
-
comparator
Class<? extends SerializableComparator> comparator
Get the in-memory comparator for the Grid column.- Returns:
- column comparator
- See Also:
Grid.Column.setComparator(com.vaadin.server.SerializableComparator<T>)
- Default:
- com.vaadin.server.SerializableComparator.class
-
-
-
descriptionGenerator
Class<? extends DescriptionGenerator> descriptionGenerator
Get the description generator for the Grid column.- Returns:
- column description generator
- See Also:
Grid.Column.setDescriptionGenerator(com.vaadin.ui.DescriptionGenerator<T>)
- Default:
- com.vaadin.ui.DescriptionGenerator.class
-
-
-
editable
boolean editable
Get whether the Grid column is editable.- Returns:
- whether editable
- See Also:
Grid.Column.setEditable(boolean)
- Default:
- false
-
-
-
expandRatio
int expandRatio
Get the expand ratio for the Grid column.- Returns:
- column expand ratio
- See Also:
Grid.Column.setExpandRatio(int)
- Default:
- -1
-
-
-
hidable
boolean hidable
Get whether the Grid column is hidable.- Returns:
- whether hidable
- See Also:
Grid.Column.setHidable(boolean)
- Default:
- false
-
-
-
hidden
boolean hidden
Get whether the Grid column is hidden.- Returns:
- whether hidden
- See Also:
Grid.Column.setHidden(boolean)
- Default:
- false
-
-
-
hidingToggleCaption
String hidingToggleCaption
Get the hiding toggle caption for the Grid column.- Returns:
- column hiding toggle caption
- See Also:
Grid.Column.setHidingToggleCaption(java.lang.String)
- Default:
- ""
-
-
-
id
String id
Get the debug ID for the Grid column.- Returns:
- column debug ID
- See Also:
Grid.Column.setId(java.lang.String)
- Default:
- ""
-
-
-
maximumWidth
double maximumWidth
Get the maximum width for the Grid column.- Returns:
- column maximum width
- See Also:
Grid.Column.setMaximumWidth(double)
- Default:
- 0.0/0.0
-
-
-
minimumWidth
double minimumWidth
Get the minimum width for the Grid column.- Returns:
- column minimum width
- See Also:
Grid.Column.setMinimumWidth(double)
- Default:
- 0.0/0.0
-
-
-
renderer
Class<? extends Renderer> renderer
Get the renderer for the Grid column.- Returns:
- column renderer
- See Also:
Grid.Column.setRenderer(Renderer)
- Default:
- com.vaadin.ui.renderers.Renderer.class
-
-
-
valueProvider
Class<? extends ValueProvider> valueProvider
Get the presentation value provider for the Grid column.This property is ignored unless
renderer()is also set. Otherwise, if this property is set thenGrid.Column.setRenderer(ValueProvider, Renderer)is used instead ofGrid.Column.setRenderer(Renderer)to configure custom cell rendering.- Returns:
- column renderer value provider
- See Also:
Grid.Column.setRenderer(ValueProvider, Renderer)
- Default:
- com.vaadin.data.ValueProvider.class
-
-
-
resizable
boolean resizable
Get whether the Grid column is resizable.- Returns:
- whether resizable
- See Also:
Grid.Column.setResizable(boolean)
- Default:
- false
-
-
-
sortable
boolean sortable
Get whether the Grid column is sortable.- Returns:
- whether sortable
- See Also:
Grid.Column.setSortable(boolean)
- Default:
- true
-
-
-
sortOrderProvider
Class<? extends SortOrderProvider> sortOrderProvider
Get the sort order provider for the Grid column.- Returns:
- column sort order provider
- See Also:
Grid.Column.setSortOrderProvider(com.vaadin.ui.components.grid.SortOrderProvider)
- Default:
- com.vaadin.ui.components.grid.SortOrderProvider.class
-
-
-
sortProperty
String[] sortProperty
Get the back-end sort properties for the Grid column.- Returns:
- column back-end sort properties
- See Also:
Grid.Column.setSortOrderProvider(com.vaadin.ui.components.grid.SortOrderProvider)
- Default:
- {}
-
-
-
styleGenerator
Class<? extends StyleGenerator> styleGenerator
Get the style generator for the Grid column.- Returns:
- column style generator
- See Also:
Grid.Column.setStyleGenerator(com.vaadin.ui.StyleGenerator<T>)
- Default:
- com.vaadin.ui.StyleGenerator.class
-
-
-
width
double width
Get the width for the Grid column.- Returns:
- column width
- See Also:
Grid.Column.setWidth(double)
- Default:
- 0.0/0.0
-
-