diff --git a/.!86238!.DS_Store b/.!86238!.DS_Store new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml new file mode 100644 index 0000000..d096e00 --- /dev/null +++ b/.github/workflows/commits.yml @@ -0,0 +1,8 @@ +name: Check Commits + +on: + pull_request: + +jobs: + check-commits: + uses: FlowingCode/GithubActions/.github/workflows/check-commits.yml@main diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..95c3fe2 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Java CI with Maven + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build-vaadin24: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build (Vaadin 24) + run: mvn -B package --file pom.xml \ No newline at end of file diff --git a/.gitignore b/.gitignore index c0fd923..8a30ffa 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,8 @@ drivers tsconfig.json .idea types.d.ts +/frontend/generated +/frontend/index.html +vite.generated.ts +vite.config.ts +/src/main/dev-bundle \ No newline at end of file diff --git a/.vaadin/copilot/vaadin-copilot.properties b/.vaadin/copilot/vaadin-copilot.properties new file mode 100644 index 0000000..0e8b963 --- /dev/null +++ b/.vaadin/copilot/vaadin-copilot.properties @@ -0,0 +1,6 @@ +#Vaadin Copilot Integration Runtime Properties +#Tue Jan 06 09:29:34 ART 2026 +endpoint=http\://127.0.0.1\:50537/vaadin/copilot-3789fb28-3a13-4614-8e14-1bb9afeea771 +ide=eclipse +supportedActions=write,writeBase64,delete,undo,redo,refresh,showInIde,getModulePaths,compileFiles,restartApplication,getVaadinRoutes,getVaadinVersion,getVaadinComponents,getVaadinEntities,getVaadinSecurity,reloadMavenModule,heartbeat +version=1.0.0 diff --git a/LICENSE b/LICENSE index 3607cc5..5756052 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,4 @@ -All parts, except the contents of the documentation module, are licenced -under Apache License v2.0. See the license text below. - -The documentation is licensed under Creative Commons CC-BY-ND 2.0 -(http://creativecommons.org/licenses/by-nd/2.0/legalcode). - +All parts are licensed under Apache License v2.0. See the license text below. ----------------------------------------------------------------------------- diff --git a/README.md b/README.md index 4fa0882..31da361 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,94 @@ -[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/easy-grid-addon) -[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/easy-grid-addon.svg)](https://vaadin.com/directory/component/easy-grid-addon) -[![Build Status](https://jenkins.flowingcode.com/job/easy-grid-addon/badge/icon)](https://jenkins.flowingcode.com/job/easy-grid-addon) - -# Easy Grid Add-on - -This Addon provides one grid to rule them all. - -## Features - -* Based on EnhancedGrid -* Support for automatic responsiveness -* Exporting facilities - -## Online demo - -[Online demo here](http://addonsv14.flowingcode.com/easy-grid) - -## Download release - -[Available in Vaadin Directory](https://vaadin.com/directory/component/easy-grid-addon) - -## Building and running demo - -- git clone repository -- mvn clean install jetty:run - -To see the demo, navigate to http://localhost:8080/ - -## Release notes - -See [here](https://github.com/FlowingCode/EasyGridAddon/releases) - -## Issue tracking - -The issues for this add-on are tracked on its github.com page. All bug reports and feature requests are appreciated. - -## Contributions - -Contributions are welcome, but there are no guarantees that they are accepted as such. Process for contributing is the following: - -- Fork this project -- Create an issue to this project about the contribution (bug or feature) if there is no such issue about it already. Try to keep the scope minimal. -- Develop and test the fix or functionality carefully. Only include minimum amount of code needed to fix the issue. -- Refer to the fixed issue in commit -- Send a pull request for the original project -- Comment on the original issue that you have implemented a fix for it - -## License & Author - -Add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt. - -Easy Grid Addon is written by Flowing Code S.A. - -# Developer Guide - -## Getting started - -Add your code samples in this section \ No newline at end of file +[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/easy-grid-addon) +[![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/app-layout-addon.svg)](https://vaadin.com/directory/component/easy-grid-addon) +[![Build Status](https://jenkins.flowingcode.com/job/easy-grid-addon/badge/icon)](https://jenkins.flowingcode.com/job/easy-grid-addon) +[![Maven Central](https://img.shields.io/maven-central/v/com.flowingcode.vaadin.addons/easy-grid-addon)](https://mvnrepository.com/artifact/com.flowingcode.vaadin.addons/easy-grid-addon) + +# Easy Grid Add-on + +This is a template project for building new Vaadin 24 add-ons + +## Features + +* List the features of your add-on in here + +## Online demo + +[Online demo here](http://addonsv24.flowingcode.com/easy-grid) + +## Download release + +[Available in Vaadin Directory](https://vaadin.com/directory/component/easy-grid-addon) + +### Maven install + +Add the following dependencies in your pom.xml file: + +```xml + + com.flowingcode.vaadin.addons + easy-grid-addon + X.Y.Z + +``` + + +```xml + + vaadin-addons + https://maven.vaadin.com/vaadin-addons + +``` + +For SNAPSHOT versions see [here](https://maven.flowingcode.com/snapshots/). + +## Building and running demo + +- git clone repository +- mvn clean install jetty:run + +To see the demo, navigate to http://localhost:8080/ + +## Release notes + +See [here](https://github.com/FlowingCode/EasyGridAddon/releases) + +## Issue tracking + +The issues for this add-on are tracked on its github.com page. All bug reports and feature requests are appreciated. + +## Contributions + +Contributions are welcome, but there are no guarantees that they are accepted as such. + +As first step, please refer to our [Development Conventions](https://github.com/FlowingCode/DevelopmentConventions) page to find information about Conventional Commits & Code Style requirements. + +Then, follow these steps for creating a contribution: + +- Fork this project. +- Create an issue to this project about the contribution (bug or feature) if there is no such issue about it already. Try to keep the scope minimal. +- Develop and test the fix or functionality carefully. Only include minimum amount of code needed to fix the issue. +- For commit message, use [Conventional Commits](https://github.com/FlowingCode/DevelopmentConventions/blob/main/conventional-commits.md) to describe your change. +- Send a pull request for the original project. +- Comment on the original issue that you have implemented a fix for it. + +## License & Author + +This add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt. + +EASY_GRID_ADDON is written by Flowing Code S.A. + +# Developer Guide + +## Getting started + +Add your code samples in this section + +## Special configuration when using Spring + +By default, Vaadin Flow only includes ```com/vaadin/flow/component``` to be always scanned for UI components and views. For this reason, the add-on might need to be whitelisted in order to display correctly. + +To do so, just add ```com.flowingcode``` to the ```vaadin.whitelisted-packages``` property in ```src/main/resources/application.properties```, like: + +```vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.flowingcode``` + +More information on Spring whitelisted configuration [here](https://vaadin.com/docs/latest/integrations/spring/configuration/#configure-the-scanning-of-packages). diff --git a/SPECIFICATIONS.md b/SPECIFICATIONS.md new file mode 100644 index 0000000..0994cd2 --- /dev/null +++ b/SPECIFICATIONS.md @@ -0,0 +1,367 @@ +# Easy Grid Add-on — Specification + +## 1. Overview + +The Easy Grid Add-on is a Vaadin Flow component that automatically generates a fully functional, sortable data grid from a Java POJO definition. It uses reflection to discover bean properties, maps them to appropriately typed and formatted columns, and provides a clean Java API for controlling column visibility, ordering, rendering, row actions, and data export via the Grid Exporter Add-on. + +## 2. Core Concepts + +### 2.1 Automatic Column Discovery + +Given a POJO class `T`, `EasyGrid` introspects its properties (via getter/setter conventions) and creates a `Grid.Column` for each one, with appropriate renderers and sorting behavior. + +### 2.2 Type-to-Renderer Mapping + +Each Java type maps to a default column renderer and configuration: + +| Java Type | Renderer | Alignment | Sorting | +|-----------|----------|-----------|---------| +| `String` | `TextRenderer` | Start | Alphabetical | +| `Integer`, `int` | `NumberRenderer` | End | Numeric | +| `Long`, `long` | `NumberRenderer` | End | Numeric | +| `Double`, `double`, `Float`, `float` | `NumberRenderer` | End | Numeric | +| `BigDecimal` | `NumberRenderer` | End | Numeric | +| `Boolean`, `boolean` | `TextRenderer` ("Yes"/"No") | Center | — | +| `LocalDate` | `LocalDateRenderer` | Start | Chronological | +| `LocalDateTime` | `LocalDateTimeRenderer` | Start | Chronological | +| `LocalTime` | `TextRenderer` (formatted) | Start | Chronological | +| `Enum` | `TextRenderer` (name) | Start | Alphabetical | + +Custom type mappings can be registered globally or per-grid instance. + +### 2.3 Sorting + +All columns backed by `Comparable` property types are sortable by default. Multi-column sorting is supported. Sorting can be disabled per column. + +### 2.4 Data Binding + +`EasyGrid` wraps Vaadin's `Grid` and supports all standard data provider mechanisms: + +- In-memory lists (`setItems(List)`) +- Lazy data providers (`setDataProvider(DataProvider)`) +- Callback data providers for backend integration + +## 3. API Design + +### 3.1 Construction + +```java +// Basic: all discovered properties become columns +EasyGrid grid = new EasyGrid<>(Person.class); +grid.setItems(personService.findAll()); + +// Selective: only specified properties become columns, in order +EasyGrid grid = new EasyGrid<>(Person.class, "firstName", "lastName", "email", "age"); +grid.setItems(personService.findAll()); +``` + +### 3.2 Column Configuration — Fluent API + +```java +EasyGrid grid = new EasyGrid<>(Person.class); + +// Configure individual columns +grid.getColumnConfig("firstName") + .withHeader("First Name") + .withSortable(true) + .withWidth("200px") + .withResizable(true); + +grid.getColumnConfig("age") + .withHeader("Age") + .withTextAlign(ColumnTextAlign.END); + +grid.getColumnConfig("birthDate") + .withHeader("Date of Birth") + .withDateFormat("dd/MM/yyyy"); + +grid.getColumnConfig("subscriber") + .withHeader("Subscribed") + .withBooleanLabels("Active", "Inactive"); + +// Hide columns +grid.hideColumns("id", "createdAt", "updatedAt"); + +// Set column order (only listed columns shown, in this order) +grid.setColumnOrder("firstName", "lastName", "email", "birthDate", "age"); + +// Freeze columns (always visible when scrolling horizontally) +grid.getColumnConfig("firstName").withFrozen(true); +``` + +### 3.3 Column Configuration Wrapper — `EasyColumnConfig` + +The `getColumnConfig(String propertyName)` method returns a fluent wrapper: + +```java +public class EasyColumnConfig { + // Header + EasyColumnConfig withHeader(String header); + EasyColumnConfig withHeader(Component headerComponent); + + // Footer + EasyColumnConfig withFooter(String footer); + EasyColumnConfig withFooter(Component footerComponent); + + // Sizing + EasyColumnConfig withWidth(String width); + EasyColumnConfig withFlexGrow(int flexGrow); + EasyColumnConfig withAutoWidth(boolean autoWidth); + EasyColumnConfig withResizable(boolean resizable); + + // Sorting + EasyColumnConfig withSortable(boolean sortable); + EasyColumnConfig withSortProperty(String... properties); + + // Alignment + EasyColumnConfig withTextAlign(ColumnTextAlign align); + + // Freezing + EasyColumnConfig withFrozen(boolean frozen); + EasyColumnConfig withFrozenToEnd(boolean frozen); + + // Visibility + EasyColumnConfig withVisible(boolean visible); + + // Custom rendering + EasyColumnConfig withRenderer(Renderer renderer); + EasyColumnConfig withComponentRenderer(SerializableFunction componentProvider); + EasyColumnConfig withValueFormatter(SerializableFunction formatter); + + // Type-specific formatting + EasyColumnConfig withDateFormat(String pattern); + EasyColumnConfig withDateTimeFormat(String pattern); + EasyColumnConfig withNumberFormat(String pattern); + EasyColumnConfig withBooleanLabels(String trueLabel, String falseLabel); + + // Access underlying Vaadin column + Grid.Column getColumn(); +} +``` + +### 3.4 Row Actions + +Row actions are buttons or menu items displayed in an actions column, typically at the end of each row. + +```java +// Add action buttons per row +grid.addRowAction("Edit", VaadinIcon.EDIT, person -> { + editPerson(person); +}); + +grid.addRowAction("Delete", VaadinIcon.TRASH, ButtonVariant.LUMO_ERROR, person -> { + personService.delete(person); + grid.getDataProvider().refreshAll(); +}); + +// Actions as a context menu (overflow menu) instead of inline buttons +grid.setRowActionsAsMenu(true); + +// Conditional action visibility +grid.addRowAction("Activate", VaadinIcon.CHECK, person -> { + personService.activate(person); +}).withVisibleWhen(person -> !person.isActive()); + +grid.addRowAction("Deactivate", VaadinIcon.CLOSE, person -> { + personService.deactivate(person); +}).withVisibleWhen(person -> person.isActive()); + +// Configure the actions column +grid.getActionsColumnConfig() + .withHeader("Actions") + .withWidth("150px") + .withFrozenToEnd(true); +``` + +### 3.5 Row Action Wrapper — `EasyRowAction` + +```java +public class EasyRowAction { + // Conditional visibility + EasyRowAction withVisibleWhen(SerializablePredicate predicate); + + // Conditional enablement + EasyRowAction withEnabledWhen(SerializablePredicate predicate); + + // Tooltip + EasyRowAction withTooltip(String tooltip); + EasyRowAction withTooltip(SerializableFunction tooltipProvider); + + // Confirmation dialog before executing the action + EasyRowAction withConfirmation(String message); + EasyRowAction withConfirmation(String title, String message); +} +``` + +### 3.6 Grid Exporter Integration + +The add-on integrates with the Grid Exporter Add-on to provide data export capabilities. + +```java +// Enable export with default formats (Excel, CSV, Docx) +grid.enableExport(); + +// Enable specific export formats +grid.enableExport(ExportFormat.EXCEL, ExportFormat.CSV); + +// Configure export +grid.getExportConfig() + .withFileName("person-report") + .withSheetName("People") + .withTitle("Person Report"); + +// Custom column export configuration (e.g., different header for export) +grid.getColumnConfig("firstName").withExportHeader("Given Name"); + +// Exclude a column from export (e.g., the actions column) +grid.getColumnConfig("actions").withExportable(false); +``` + +### 3.7 Global Type Configuration + +Register custom column configurations that apply to all `EasyGrid` instances: + +```java +// Register a global formatter for a custom type +EasyGrid.registerTypeConfig(Money.class, config -> { + config.withTextAlign(ColumnTextAlign.END); + config.withValueFormatter(money -> money.getCurrency() + " " + money.getAmount()); +}); + +// Register a global renderer for nested types +EasyGrid.registerTypeConfig(Address.class, config -> { + config.withValueFormatter(address -> + address.getStreet() + ", " + address.getCity() + ); +}); +``` + +### 3.8 Selection + +```java +// Single selection (default) +grid.setSelectionMode(Grid.SelectionMode.SINGLE); +grid.addSelectionListener(event -> { + event.getFirstSelectedItem().ifPresent(this::showDetails); +}); + +// Multi-selection +grid.setSelectionMode(Grid.SelectionMode.MULTI); +grid.addSelectionListener(event -> { + Set selected = event.getAllSelectedItems(); + // bulk action +}); +``` + +### 3.9 Filtering + +`EasyGrid` supports in-memory filtering for list-based data providers: + +```java +// Add a header filter row (auto-generated filter fields per column) +grid.enableHeaderFilters(); + +// Programmatic filtering +grid.setFilter(person -> + person.getAge() >= 18 && person.isActive() +); + +// Combined with external filter (for use with EasyCRUD) +grid.setExternalFilter(SerializablePredicate filter); +``` + +### 3.10 Events + +```java +// Row click +grid.addItemClickListener(event -> { + showDetails(event.getItem()); +}); + +// Row double-click +grid.addItemDoubleClickListener(event -> { + editPerson(event.getItem()); +}); + +// Sort change +grid.addSortListener(event -> { + // handle sort change +}); +``` + +## 4. Default Header Generation + +When no explicit header is provided, headers are auto-generated from property names using camelCase-to-title-case conversion: + +| Property Name | Generated Header | +|--------------|-----------------| +| `firstName` | `First Name` | +| `lastName` | `Last Name` | +| `dateOfBirth` | `Date Of Birth` | +| `email` | `Email` | +| `isActive` | `Is Active` | + +## 5. Nested Property Support + +Nested properties can be referenced using dot notation: + +```java +grid.setColumnOrder("firstName", "lastName", "address.city", "address.postalCode"); + +grid.getColumnConfig("address.city") + .withHeader("City") + .withSortable(true); +``` + +## 6. Serialization + +`EasyGrid` must be fully serializable for Vaadin session persistence. All internal state, column configurations, action handlers, and renderers must be serializable. + +## 7. Usage Example — Complete + +```java +// Minimal usage +EasyGrid simpleGrid = new EasyGrid<>(Person.class); +simpleGrid.setItems(personService.findAll()); +add(simpleGrid); + +// Customized usage +EasyGrid grid = new EasyGrid<>(Person.class); + +// Configure columns +grid.setColumnOrder("firstName", "lastName", "email", "birthDate", "age", "subscriber"); +grid.hideColumns("id", "createdAt", "updatedAt"); +grid.getColumnConfig("firstName").withHeader("Name").withFrozen(true); +grid.getColumnConfig("birthDate").withHeader("Born").withDateFormat("dd/MM/yyyy"); +grid.getColumnConfig("subscriber").withBooleanLabels("Yes", "No"); +grid.getColumnConfig("age").withTextAlign(ColumnTextAlign.END); + +// Row actions +grid.addRowAction("Edit", VaadinIcon.EDIT, this::editPerson); +grid.addRowAction("Delete", VaadinIcon.TRASH, ButtonVariant.LUMO_ERROR, person -> { + personService.delete(person); + grid.getDataProvider().refreshAll(); +}).withConfirmation("Are you sure you want to delete this person?"); + +// Enable export +grid.enableExport(); +grid.getExportConfig().withFileName("people-export"); + +// Set data +grid.setItems(personService.findAll()); + +add(grid); +``` + +## 8. Dependencies + +- Vaadin Flow (24.x) +- Grid Exporter Add-on (for export functionality) +- Lombok (per Flowing Code convention for new add-ons) + +## 9. Non-Goals (Out of Scope) + +- Inline cell editing (use EasyForm for editing) +- Server-side data persistence +- Tree grid / hierarchical data +- Lazy loading (supported via Vaadin's DataProvider API but not auto-configured) diff --git a/assembly/MANIFEST.MF b/assembly/MANIFEST.MF deleted file mode 100644 index de1bed8..0000000 --- a/assembly/MANIFEST.MF +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -Vaadin-Package-Version: 1 -Vaadin-Addon: ${project.build.finalName}.${project.packaging} -Implementation-Vendor: ${organization.name} -Implementation-Title: ${project.name} -Implementation-Version: ${project.version} diff --git a/assembly/assembly.xml b/assembly/assembly.xml deleted file mode 100644 index d10f5f6..0000000 --- a/assembly/assembly.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - flowing-addon - - - zip - - - - false - - - - . - - LICENSE - README.md - - - - target - - - *.jar - *.pdf - - - *-demo.jar - - - - - - - - assembly/MANIFEST.MF - META-INF - true - - - \ No newline at end of file diff --git a/drivers.xml b/drivers.xml deleted file mode 100644 index 358dd8d..0000000 --- a/drivers.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_win32.zip - - 40aeb7b0b3a3ea23a139a764b56e172f2fdb90a4 - sha1 - - - - - - - - - https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip - - 0e8848ebca11706768fd748dd0282672acad35ac - sha1 - - - - - - - - - - https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_mac64.zip - - 3b58b8039f363de3b13a8bea7d4646105fbbd177 - sha1 - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7131f67..e89bb79 100644 --- a/pom.xml +++ b/pom.xml @@ -1,486 +1,488 @@ - - - 4.0.0 - - org.vaadin.addons.flowingcode - easy-grid-addon - 1.0.0-SNAPSHOT - Easy Grid Add-on - Easy Grid Add-on for Vaadin Flow - - - 14.7.8 - 1.8 - 1.8 - UTF-8 - UTF-8 - ${project.basedir}/drivers - 9.4.36.v20210114 - - - - Flowing Code - https://www.flowingcode.com - - - 2021 - - - Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - https://github.com/FlowingCode/AddonStarter14 - scm:git:git://github.com/FlowingCode/AddonStarter14.git - scm:git:ssh://git@github.com:/FlowingCode/AddonStarter14.git - master - - - - - - com.vaadin - vaadin-bom - pom - import - ${vaadin.version} - - - com.flowingcode.vaadin.addons.demo - commons-demo - 3.2.0 - - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - Vaadin Directory - https://maven.vaadin.com/vaadin-addons - - - - Vaadin prereleases - https://maven.vaadin.com/vaadin-prereleases - - - - vaadin-snapshots - https://oss.sonatype.org/content/repositories/vaadin-snapshots/ - - - - flowing-releases - https://maven.flowingcode.com/releases - - - - - - central - https://repo.maven.apache.org/maven2 - - false - - - - - Vaadin prereleases - https://maven.vaadin.com/vaadin-prereleases - - - vaadin-snapshots - https://oss.sonatype.org/content/repositories/vaadin-snapshots/ - false - - - - - - com.vaadin - vaadin-core - - - org.slf4j - slf4j-simple - test - - - com.vaadin - vaadin-testbench - test - - - com.flowingcode.vaadin.addons.demo - commons-demo - test - - - org.hamcrest - hamcrest-library - 1.3 - test - - - javax.servlet - javax.servlet-api - 3.1.0 - jar - test - - - io.github.bonigarcia - webdrivermanager - 3.8.1 - test - - - - - jetty:run - - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.1 - - false - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 - - - true - - false - true - - - 1 - - - - - - org.codehaus.mojo - license-maven-plugin - 1.14 - - apache_v2 - false - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.1 - - false - - - - com.vaadin - vaadin-maven-plugin - ${vaadin.version} - - - - prepare-frontend - - - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.version} - - 3 - - true - - - src/test/resources/META-INF/resources - src/main/resources/META-INF/resources - - - - jar - - - - - - - - - directory - - - - org.apache.maven.plugins - maven-assembly-plugin - 3.1.0 - - false - - assembly/assembly.xml - - - - - - single - - install - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.1 - - - attach-javadocs - verify - - jar - - - - - true - -Xdoclint:none - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 - - - - META-INF/VAADIN/config/flow-build-info.json - - - - - - - - - - production - - true - - - - com.vaadin - flow-server-production-mode - - - - - - - com.vaadin - vaadin-maven-plugin - - - - build-frontend - - - - - - - - - - integration-tests - - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.version} - - 0 - - jar - - ${project.artifactId} - 8081 - - - - start-jetty - pre-integration-test - - start - - - - stop-jetty - post-integration-test - - stop - - - - - - - com.lazerycode.selenium - driver-binary-downloader-maven-plugin - - 1.0.17 - - - true - - - ${drivers.dir}/driver - - - ${drivers.dir}/driver_zips - - - ${project.basedir}/drivers.xml - - - - - - selenium - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.22.2 - - - - integration-test - verify - - - - - false - true - - - - ${webdriver.chrome.driver} - - - - - - maven-resources-plugin - 3.1.0 - - - - copy-test-to-classes - process-test-classes - - copy-resources - - - ${project.build.outputDirectory} - - - ${project.build.testOutputDirectory} - - - - - - - - - - - demo-jar - - - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - demo - - **/test/* - **/integration/* - **/DemoView.class - **/DemoLayout.class - - - - - - - - - - - + + + 4.0.0 + + com.flowingcode.vaadin.addons + easy-grid-addon + 1.0.0-SNAPSHOT + Easy Grid Add-on + Easy Grid Add-on for Vaadin Flow + https://www.flowingcode.com/en/open-source/ + + + 24.1.2 + 4.10.0 + 17 + 17 + UTF-8 + UTF-8 + ${project.basedir}/drivers + 11.0.12 + 3.8.0 + true + + + + Flowing Code + https://www.flowingcode.com + + + 2026 + + + Apache 2 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + https://github.com/FlowingCode/EasyGridAddon + scm:git:git://github.com/FlowingCode/EasyGridAddon.git + scm:git:ssh://git@github.com:/FlowingCode/EasyGridAddon.git + master + + + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + flowingcode + Flowing Code + https://www.flowingcode.com + + + + + + + com.vaadin + vaadin-bom + pom + import + ${vaadin.version} + + + com.flowingcode.vaadin.addons.demo + commons-demo + ${flowingcode.commons.demo.version} + + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + Vaadin Directory + https://maven.vaadin.com/vaadin-addons + + + + Vaadin prereleases + https://maven.vaadin.com/vaadin-prereleases + + + + vaadin-snapshots + https://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + + + + + central + https://repo.maven.apache.org/maven2 + + false + + + + + Vaadin prereleases + https://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + https://oss.sonatype.org/content/repositories/vaadin-snapshots/ + false + + + + + + com.vaadin + vaadin-core + true + + + org.slf4j + slf4j-simple + test + + + com.vaadin + vaadin-testbench + test + + + com.flowingcode.vaadin.addons.demo + commons-demo + test + + + org.hamcrest + hamcrest-library + 1.3 + test + + + javax.servlet + javax.servlet-api + 3.1.0 + jar + test + + + io.github.bonigarcia + webdrivermanager + 5.1.1 + test + + + + + jetty:run + + + + org.apache.maven.plugins + maven-release-plugin + 3.0.1 + + @{project.version} + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.1 + + false + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.2 + + + true + + false + true + + + 1 + + + + + + org.codehaus.mojo + license-maven-plugin + 1.14 + + apache_v2 + false + + + + org.apache.maven.plugins + maven-surefire-plugin + + false + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.version} + + + + prepare-frontend + + + + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.version} + + 3 + + true + + + src/test/resources/META-INF/resources + src/main/resources/META-INF/resources + + + + jar + + + + + + + + + directory + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.1 + + + attach-javadocs + package + + jar + + + + + true + none + -Xdoclint:none + + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.2 + + + + META-INF/VAADIN/config/flow-build-info.json + + + + + + + + + + production + + true + + + + com.vaadin + flow-server-production-mode + + + + + + + com.vaadin + vaadin-maven-plugin + + + + build-frontend + + + + + + + + + + integration-tests + + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.version} + + 0 + + jar + + ${project.artifactId} + 8081 + + + + start-jetty + pre-integration-test + + start + + + + stop-jetty + post-integration-test + + stop + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.2 + + + + integration-test + verify + + + + + false + true + + + + ${webdriver.chrome.driver} + + + + + + maven-resources-plugin + 3.1.0 + + + + copy-test-to-classes + process-test-classes + + copy-resources + + + ${project.build.outputDirectory} + + + ${project.build.testOutputDirectory} + + + + + + + + + + + + gpg + + + env.gpg.passphrase + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + ${env.gpg.passphrase} + + + + + + + + + + demo-jar + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + demo + + **/test/* + **/it/* + **/DemoView.class + **/DemoLayout.class + + + + + + + + + + + + diff --git a/src/main/java/com/flowingcode/vaadin/addons/easygrid/EasyGrid.java b/src/main/java/com/flowingcode/vaadin/addons/easygrid/EasyGridAddon.java similarity index 90% rename from src/main/java/com/flowingcode/vaadin/addons/easygrid/EasyGrid.java rename to src/main/java/com/flowingcode/vaadin/addons/easygrid/EasyGridAddon.java index cf6b5f8..7933066 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/easygrid/EasyGrid.java +++ b/src/main/java/com/flowingcode/vaadin/addons/easygrid/EasyGridAddon.java @@ -1,15 +1,15 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,4 +29,4 @@ @NpmPackage(value = "@polymer/paper-input", version = "3.2.1") @JsModule("@polymer/paper-input/paper-input.js") @Tag("paper-input") -public class EasyGrid extends Div {} +public class EasyGridAddon extends Div {} diff --git a/src/main/resources/META-INF/frontend/styles/static_addon_styles b/src/main/resources/META-INF/frontend/styles/static_addon_styles index 41fbf5e..c2a6ed1 100644 --- a/src/main/resources/META-INF/frontend/styles/static_addon_styles +++ b/src/main/resources/META-INF/frontend/styles/static_addon_styles @@ -1 +1 @@ -Place addon shareable styles in this folder \ No newline at end of file +Place add-on shareable styles in this folder \ No newline at end of file diff --git a/src/main/resources/META-INF/resources/static_addon_resources b/src/main/resources/META-INF/resources/static_addon_resources index 5afb98e..70832cc 100644 --- a/src/main/resources/META-INF/resources/static_addon_resources +++ b/src/main/resources/META-INF/resources/static_addon_resources @@ -1 +1 @@ -Place static addon resources in this folder \ No newline at end of file +Place static add-on resources in this folder \ No newline at end of file diff --git a/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java b/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java index 24f9fc0..7110add 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java +++ b/src/test/java/com/flowingcode/vaadin/addons/DemoLayout.java @@ -1,15 +1,15 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/DemoView.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/DemoView.java index 5d67c23..cd95e9d 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/DemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/easygrid/DemoView.java @@ -1,15 +1,15 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -31,6 +31,6 @@ public class DemoView extends VerticalLayout implements BeforeEnterObserver { @Override public void beforeEnter(BeforeEnterEvent event) { - event.forwardTo(TemplateDemoView.class); + event.forwardTo(EasyGridDemoView.class); } } diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemo.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemo.java index f8fd9ba..adf2125 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemo.java +++ b/src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemo.java @@ -1,12 +1,17 @@ package com.flowingcode.vaadin.addons.easygrid; -import com.flowingcode.vaadin.addons.easygrid.EasyGrid; +import com.flowingcode.vaadin.addons.demo.DemoSource; import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.router.PageTitle; +import com.vaadin.flow.router.Route; +@DemoSource +@PageTitle("Easy Grid Add-on Demo") @SuppressWarnings("serial") +@Route(value = "demo", layout = EasyGridDemoView.class) public class EasyGridDemo extends Div { public EasyGridDemo() { - add(new EasyGrid()); + add(new EasyGridAddon()); } } diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/TemplateDemoView.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemoView.java similarity index 59% rename from src/test/java/com/flowingcode/vaadin/addons/easygrid/TemplateDemoView.java rename to src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemoView.java index a24e39e..b3a8a65 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/TemplateDemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/easygrid/EasyGridDemoView.java @@ -1,8 +1,8 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,19 +22,17 @@ import com.flowingcode.vaadin.addons.DemoLayout; import com.flowingcode.vaadin.addons.GithubLink; import com.flowingcode.vaadin.addons.demo.TabbedDemo; +import com.vaadin.flow.router.ParentLayout; import com.vaadin.flow.router.Route; @SuppressWarnings("serial") -@Route(value = "template", layout = DemoLayout.class) -@GithubLink("https://github.com/FlowingCode/AddonsStarter14") -public class TemplateDemoView extends TabbedDemo { +@ParentLayout(DemoLayout.class) +@Route("easy-grid") +@GithubLink("https://github.com/FlowingCode/EasyGridAddon") +public class EasyGridDemoView extends TabbedDemo { - private static final String TEMPLATE_ADDON_DEMO = "Template Addon Demo"; - private static final String TEMPLATE_ADDON_SOURCE = - "https://github.com/FlowingCode/AddonStarter14/blob/master/src/test/java/com/flowingcode/vaadin/addons/template/TemplateDemo.java"; - - public TemplateDemoView() { - addDemo(new EasyGridDemo(), TEMPLATE_ADDON_DEMO, TEMPLATE_ADDON_SOURCE); + public EasyGridDemoView() { + addDemo(EasyGridDemo.class); setSizeFull(); } } diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/AbstractViewTest.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/AbstractViewTest.java index ac2b5fe..ed4807d 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/AbstractViewTest.java +++ b/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/AbstractViewTest.java @@ -1,15 +1,15 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/ViewIT.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/ViewIT.java index d810180..2c71c21 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/ViewIT.java +++ b/src/test/java/com/flowingcode/vaadin/addons/easygrid/it/ViewIT.java @@ -1,15 +1,15 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/LayoutTest.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/LayoutTest.java deleted file mode 100644 index 10b8274..0000000 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/LayoutTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * #%L - * App Layout Addon - * %% - * Copyright (C) 2018 - 2020 Flowing Code - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ -package com.flowingcode.vaadin.addons.easygrid.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import com.flowingcode.vaadin.addons.DemoLayout; -import com.flowingcode.vaadin.addons.easygrid.TemplateDemoView; -import com.vaadin.flow.router.Route; -import org.junit.Test; - -public class LayoutTest { - - @Test - public void testDemoLayout() { - Route route = TemplateDemoView.class.getAnnotation(Route.class); - assertEquals("com.flowingcode.vaadin.addons.DemoLayout", DemoLayout.class.getName()); - assertEquals(DemoLayout.class, route.layout()); - assertNotEquals("", route.value()); - } -} diff --git a/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/SerializationTest.java b/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/SerializationTest.java index 70817ab..b609b50 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/SerializationTest.java +++ b/src/test/java/com/flowingcode/vaadin/addons/easygrid/test/SerializationTest.java @@ -1,15 +1,15 @@ /*- * #%L - * Template Add-on + * Easy Grid Add-on * %% - * Copyright (C) 2021 Flowing Code + * Copyright (C) 2023 Flowing Code * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,12 +19,12 @@ */ package com.flowingcode.vaadin.addons.easygrid.test; +import com.flowingcode.vaadin.addons.easygrid.EasyGridAddon; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import com.flowingcode.vaadin.addons.easygrid.EasyGrid; import org.junit.Assert; import org.junit.Test; @@ -44,7 +44,7 @@ private void testSerializationOf(Object obj) throws IOException, ClassNotFoundEx @Test public void testSerialization() throws ClassNotFoundException, IOException { try { - testSerializationOf(new EasyGrid()); + testSerializationOf(new EasyGridAddon()); } catch (Exception e) { Assert.fail("Problem while testing serialization: " + e.getMessage()); }