You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SPECIFICATIONS.md
+47-34Lines changed: 47 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,11 @@
2
2
3
3
## 1. Overview
4
4
5
-
The Easy Grid Add-on is a configuration helper that wraps an externally instantiated Vaadin`Grid<T>`. It uses reflection to discover bean properties, maps them to appropriately typed and formatted columns, and provides a clean Java API for controlling column ordering and type-specific rendering.
5
+
The Easy Grid Add-on provides `EasyGrid<T>`, a Vaadin `Composite` component that wraps an internally created`Grid<T>`. It uses reflection to discover bean properties, maps them to appropriately typed and formatted columns, and provides a clean Java API for controlling column ordering and type-specific rendering.
6
6
7
-
`EasyGrid<T>` is **not** a component — it configures an existing `Grid<T>` that was created and managed by the caller. Data binding, selection, events, and all other standard `Grid` features are accessed directly on the wrapped `Grid` instance.
7
+
`EasyGrid<T>` is a component — it is added to the layout directly. Data binding and all other standard `Grid` features are accessed directly on the `EasyGrid` instance, which delegates them to the wrapped `Grid`. The wrapped `Grid` is accessible via `getGrid()` for any configuration not covered by the delegating API.
8
+
9
+
For advanced cases where a custom `Grid` subclass must be supplied (e.g. `TreeGrid`), use `EasyGridWrapper<T, GRID>` instead — it accepts a caller-provided `GRID extends Grid<T>` and otherwise provides the same API.
8
10
9
11
## 2. Core Concepts
10
12
@@ -16,18 +18,18 @@ Given a POJO class `T`, `EasyGrid<T>` introspects its properties (via getter/set
16
18
17
19
Each Java type maps to a default column renderer and configuration:
18
20
19
-
| Java Type | Renderer | Alignment | Sorting |
20
-
|-----------|----------|-----------|---------|
21
-
|`String`|`TextRenderer`| Start | Alphabetical |
22
-
|`Integer`, `int`|`NumberRenderer`| End | Numeric |
23
-
|`Long`, `long`|`NumberRenderer`| End | Numeric |
24
-
|`Double`, `double`, `Float`, `float`|`NumberRenderer`| End | Numeric |
25
-
|`BigDecimal`|`NumberRenderer`| End | Numeric |
26
-
|`Boolean`, `boolean`|`TextRenderer`("true"/"false")| Center | — |
@@ -207,7 +221,7 @@ Formatters that receive a `ColumnConfiguration` parameter can call `getNullRepre
207
221
208
222
#### Type Hierarchy Support
209
223
210
-
Inside each scope level, `EasyGridConfigurationClassMap` walks the Java class hierarchy. When a configuration is requested for `Foo` and none exists, it is created with `Foo`'s superclass configuration as its parent, continuing up to `Object`. Primitive types are mapped to their boxed counterparts before hierarchy walking (`int` → `Integer`, `boolean` → `Boolean`, etc.).
224
+
Inside each scope level, configuration walks the Java class hierarchy. When a configuration is requested for `Foo` and none exists, it is created with `Foo`'s superclass configuration as its parent, continuing up to `Object`. Primitive types are mapped to their boxed counterparts before hierarchy walking (`int` → `Integer`, `boolean` → `Boolean`, etc.).
211
225
212
226
A global `Number.class` renderer factory is therefore automatically inherited by `Integer`, `Long`, `BigDecimal`, and every other `Number` subtype unless a more specific configuration overrides it.
213
227
@@ -244,7 +258,7 @@ When a column is added by `EasyGrid` and no explicit header has been set on it,
244
258
Nested properties can be referenced using dot notation:
0 commit comments