diff --git a/README.md b/README.md
index c87cf9f1..fdf38d6e 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ This is the relevant dependency:
org.vaadin.miki
superfields
- 0.14.0
+ 0.14.1
```
diff --git a/demo-v23/pom.xml b/demo-v23/pom.xml
index fcf7aeaa..23b2bcbe 100644
--- a/demo-v23/pom.xml
+++ b/demo-v23/pom.xml
@@ -4,11 +4,11 @@
superfields-parent
org.vaadin.miki
- 0.14.0
+ 0.14.1
superfields-demo-v23
- 0.14.0
+ 0.14.1
V23+ demo app for SuperFields
Showcase application for V23+ and SuperFields.
war
@@ -23,7 +23,7 @@
org.vaadin.miki
superfields
- 0.14.0
+ 0.14.1
javax.servlet
diff --git a/demo-v23/src/main/java/org/vaadin/miki/demo/builders/ObjectFieldBuilder.java b/demo-v23/src/main/java/org/vaadin/miki/demo/builders/ObjectFieldBuilder.java
index 556f9cee..293364b6 100644
--- a/demo-v23/src/main/java/org/vaadin/miki/demo/builders/ObjectFieldBuilder.java
+++ b/demo-v23/src/main/java/org/vaadin/miki/demo/builders/ObjectFieldBuilder.java
@@ -5,6 +5,7 @@
import org.vaadin.miki.demo.ContentBuilder;
import org.vaadin.miki.demo.Order;
import org.vaadin.miki.demo.data.Book;
+import org.vaadin.miki.demo.data.Format;
import org.vaadin.miki.demo.data.Person;
import org.vaadin.miki.superfields.object.ObjectField;
@@ -16,9 +17,9 @@ public class ObjectFieldBuilder implements ContentBuilder> {
@Override
public void buildContent(ObjectField component, Consumer callback) {
final ComboBox values = new ComboBox<>("Select a value: ",
- Book.of("1984", 1948, "English", Person.of("George Orwell", LocalDate.of(1903, 6, 25), false)),
- Book.of("The God Delusion", 2006, "English", Person.of("Richard Dawkins", LocalDate.of(1941, 3, 26), false)),
- Book.of("Dolina Issy", 1955, "polski", Person.of("Czesław Miłosz", LocalDate.of(1911, 6, 30), true))
+ Book.of("1984", 1948, "English", Format.SOFT_COVER, Person.of("George Orwell", LocalDate.of(1903, 6, 25), false)),
+ Book.of("The God Delusion", 2006, "English", Format.HARD_COVER, Person.of("Richard Dawkins", LocalDate.of(1941, 3, 26), false)),
+ Book.of("Dolina Issy", 1955, "polski", null, Person.of("Czesław Miłosz", LocalDate.of(1911, 6, 30), true))
);
values.addValueChangeListener(event -> component.setValue(event.getValue()));
values.setAllowCustomValue(false);
diff --git a/demo-v23/src/main/java/org/vaadin/miki/demo/data/Book.java b/demo-v23/src/main/java/org/vaadin/miki/demo/data/Book.java
index ea26ca79..b9c9cef8 100644
--- a/demo-v23/src/main/java/org/vaadin/miki/demo/data/Book.java
+++ b/demo-v23/src/main/java/org/vaadin/miki/demo/data/Book.java
@@ -16,12 +16,13 @@
*/
public class Book {
- public static Book of(String title, int firstPublished, String language, Person... authors) {
+ public static Book of(String title, int firstPublished, String language, Format ownedFormat, Person... authors) {
final Book result = new Book();
result.setAuthors(Arrays.asList(authors));
result.setTitle(title);
result.setFirstPublished(firstPublished);
result.setLanguage(language);
+ result.setOwnedFormat(ownedFormat);
return result;
}
@@ -40,6 +41,10 @@ public static Book of(String title, int firstPublished, String language, Person.
@FieldCaption("Original language")
private String language;
+ @FieldOrder(6)
+ @FieldGroup("publication")
+ private Format ownedFormat;
+
@BigField
@FieldOrder(5)
private String summary = "";
@@ -84,17 +89,25 @@ public void setSummary(String summary) {
this.summary = summary;
}
+ public Format getOwnedFormat() {
+ return ownedFormat;
+ }
+
+ public void setOwnedFormat(Format ownedFormat) {
+ this.ownedFormat = ownedFormat;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Book book = (Book) o;
- return getFirstPublished() == book.getFirstPublished() && Objects.equals(getTitle(), book.getTitle()) && Objects.equals(getAuthors(), book.getAuthors()) && Objects.equals(getLanguage(), book.getLanguage()) && Objects.equals(getSummary(), book.getSummary());
+ return getFirstPublished() == book.getFirstPublished() && Objects.equals(getTitle(), book.getTitle()) && Objects.equals(getAuthors(), book.getAuthors()) && Objects.equals(getLanguage(), book.getLanguage()) && getOwnedFormat() == book.getOwnedFormat() && Objects.equals(getSummary(), book.getSummary());
}
@Override
public int hashCode() {
- return Objects.hash(getTitle(), getAuthors(), getFirstPublished(), getLanguage(), getSummary());
+ return Objects.hash(getTitle(), getAuthors(), getFirstPublished(), getLanguage(), getOwnedFormat(), getSummary());
}
@Override
@@ -104,6 +117,7 @@ public String toString() {
", authors=" + authors +
", firstPublished=" + firstPublished +
", language='" + language + '\'' +
+ ", ownedFormat=" + ownedFormat +
", summary='" + summary + '\'' +
'}';
}
diff --git a/demo-v23/src/main/java/org/vaadin/miki/demo/data/Format.java b/demo-v23/src/main/java/org/vaadin/miki/demo/data/Format.java
new file mode 100644
index 00000000..789da27e
--- /dev/null
+++ b/demo-v23/src/main/java/org/vaadin/miki/demo/data/Format.java
@@ -0,0 +1,7 @@
+package org.vaadin.miki.demo.data;
+
+public enum Format {
+
+ HARD_COVER, SOFT_COVER, AUDIO_BOOK
+
+}
diff --git a/pom.xml b/pom.xml
index e7afff3d..b481c6c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
org.vaadin.miki
superfields-parent
- 0.14.0
+ 0.14.1
superfields
demo-v23
diff --git a/superfields/README.md b/superfields/README.md
index ebe05635..d456a11a 100644
--- a/superfields/README.md
+++ b/superfields/README.md
@@ -110,7 +110,11 @@ A `CustomField