As Vaadin dropped support for iron-icons, we will not support Vaadin 24+ for this add-on.
Vaadin 10+ constants for https://github.com/PolymerElements/iron-icons
- git clone repository
- mvn clean install jetty:run
To see the demo, navigate to http://localhost:8080/
- Version 1.0.0 Initial Version for Vaadin 10+
- Version 1.0.1 Add overload of
createmethod that receives a click listener. - Version 2.0.0 Initial Version for Vaadin 14 (npm mode)
The issues for this add-on are tracked on its github.com page. All bug reports and feature requests are appreciated.
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
This add-on is distributed under Apache License 2.0. For license terms, see LICENSE.txt.
IronIcons Addon is written by Flowing Code S.A.
- Use the
createmethod from the enum type, for instantiating a newIronIconcomponent based on that icon.
add(new Button("SAVE", IronIcons.SAVE.create()));
- You can also use the
getIconNamemethod for obtaining the qualified icon name, that can be set in theiconattribute of theiron-iconelement. This can be helpful if you are writing a template renderer, such as:
grid.addColumn(TemplateRenderer.<Flight>of(
"<iron-icon icon='IronIcons.FLIGHT_TAKEOFF.getIconName()'></iron-icon>[[item.takeoff_time]]"
).withProperty("takeoff_time", Flight::getTakeOffTime));
In this latter case, you'll need to import the corresponding iconset:
@Uses(IronIcons.Icon.class)
For recreating the sources, you need to activate the generate maven profile (i.e. mvn -Pgenerate compile). This will download the web component sources from github, and run the code generator (IconsetEnumGenerator). The resulting Java enums will be written into src/main/generated.
In order to add support for a new iconset, perform the following steps in the base POM:
-
Define a property for the iconset version:
<iron.icons.version>2.1.1</iron.icons.version> -
Add a dependency to the webjar:
<dependency>
<groupId>org.webjars.bowergithub.polymerelements</groupId>
<artifactId>iron-icons</artifactId>
<version>${iron.icons.version}</version>
</dependency>
- Add a code generator execution under the
generateprofile, and configure thecodegen.repositoryandcodegen.tagarguments as appropriate.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
...
<executions>
<execution>
<id>iron-icons</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<arguments>
<argument>-Pgenerate</argument>
<argument>-Dcodegen.repository=PolymerElements/iron-icons</argument>
<argument>-Dcodegen.tag=v${iron.icons.version}</argument>
<argument>-Dcodegen.sources=${project.build.generatedSources}</argument>
</arguments>
</configuration>
</execution>
</execution>
</plugin>