Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.test;
- @SpringBootApplication
- @Configuration
- public class TestApplication {
- public static void main(String[] args) {
- SpringApplication.run(TestApplication.class, args);
- }
- }
- -----------------------------------
- package org.test;
- @Widgetset("AppWidgetset")
- @PreserveOnRefresh
- @SpringUI
- public class TestUI extends UI {
- //create Components, add them, etc
- }
- -----------------------------------
- package org.test.config;
- @Configuration
- public class TestConfig {
- @Bean
- ImageCache imageCache(){
- return new ImageCache();
- }
- }
- -----------------------------------
- ImageCache.java is nothing special just a class retrieving images from HTTP resources or if cached give them from disk
- -----------------------------------
- package org.test.ui;
- public class MovieComponent extends CustomComponent {
- //some irrelevant fields
- @Autowired
- private ImageCache imageCache;
- private static Integer COMPONENT_WIDTH = MovieSearchEngineComponent.posterSize.getWidth();
- private static Integer COMPONENT_HEIGHT = MovieSearchEngineComponent.posterSize.getHeight();
- // public MovieComponent(MovieInfo movie) {
- public MovieComponent(MovieDb movie) {
- .....
- imageCache.get(...);
- ....
- initGui();
- }
- private void initGui() {
- ........
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement