Skip to content

tomivirkki/cdi-properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Published on Vaadin  Directory Stars on Vaadin Directory

CDI Properties

CDI Properties contains individual annotations for each Vaadin core component that allow you to define a set of properties right above the injection point.

...so instead of:

TextField textField = new TextField("Name");
textField.setMaxLength(15);
textField.setNullRepresentation("");
textField.setWidth("100%");

..you can:

@Inject
@TextFieldProperties(caption = "Name", maxLength = 15, nullRepresentation = "", width = "100%")
private TextField textField;

Use properties "captionKey" and "labelValueKey" to assign text values provided by your own TextBundle bean. Fire a @TextBundleUpdated event to utilize the built-in i18n functionality allowing you to change your applications language run-time.

Link to an example project

The add-on can only be used in Vaadin CDI enabled projects.

About

Define Vaadin component properties with annotations

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages