-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use StreamSource directly as content generator
- Loading branch information
1 parent
a0c1574
commit 1a79420
Showing
5 changed files
with
108 additions
and
65 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
...-window-opener-addon/src/main/java/org/vaadin/addon/ewopener/DynamicContentGenerator.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
enhanced-window-opener-demo/src/main/java/org/vaadin/addon/ewopener/demo/DummyService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.vaadin.addon.ewopener.demo; | ||
|
||
import com.oblac.nomen.Nomen; | ||
import lombok.Data; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Random; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.IntStream; | ||
|
||
public class DummyService { | ||
|
||
private static Random random = new Random(); | ||
private static final List<Person> data; | ||
|
||
static { | ||
data = IntStream.range(0, 20) | ||
.mapToObj(i -> new Person(name(), random.nextInt(80) + 20)) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
public static List<Person> data() { | ||
return Collections.unmodifiableList(data); | ||
} | ||
|
||
private static String name() { | ||
return Nomen.est().superb().separator(" ").space(" ").person().get(); | ||
} | ||
|
||
|
||
@Data | ||
public static class Person { | ||
private final String name; | ||
private final int age; | ||
} | ||
} |