com.vaadin.flow.component.html.Image Java Examples
The following examples show how to use
com.vaadin.flow.component.html.Image.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainLayout.java From crudui with Apache License 2.0 | 7 votes |
public MainLayout() { AppLayout appLayout = new AppLayout(); Image img = new Image("https://i.imgur.com/GPpnszs.png", "Vaadin Logo"); img.setHeight("44px"); addToNavbar(img); tabs.addSelectedChangeListener(event -> tabsSelectionChanged(event)); addToNavbar(tabs); addTab(HomeView.class); addTab(SimpleCrudView.class); addTab(CrudWithSplitLayoutView.class); addTab(CrudWithFilterView.class); addTab(CrudWithLazyLoadingView.class); }
Example #2
Source File: MainLayout.java From alibaba-rsocket-broker with Apache License 2.0 | 5 votes |
public MainLayout(@Autowired RSocketBrokerHandlerRegistry handlerRegistry, @Autowired ServiceRoutingSelector serviceRoutingSelector, @Autowired RSocketBrokerManager rSocketBrokerManager, @Autowired DnsResolveService resolveService, @Autowired ConfigurationService configurationService, @Autowired AuthenticationService authenticationService, @Autowired RSocketFilterChain filterChain, @Autowired @Qualifier("notificationProcessor") TopicProcessor<String> notificationProcessor) { this.handlerRegistry = handlerRegistry; this.serviceRoutingSelector = serviceRoutingSelector; this.rSocketBrokerManager = rSocketBrokerManager; this.resolveService = resolveService; this.configurationService = configurationService; this.authenticationService = authenticationService; this.filterChain = filterChain; this.notificationProcessor = notificationProcessor; //init the Layout Image logo = new Image("/rsocket-logo.svg", "RSocket Logo"); logo.setHeight("44px"); logo.setAlt("RSocket Cluster"); addToNavbar(new DrawerToggle(), logo); final Tabs tabs = new Tabs(dashBoard(), apps(), dns(), appConfig(), services(), serviceTesting(), serviceMesh(), brokers(), filters(), jwt(), system(), faq()); tabs.setOrientation(Tabs.Orientation.VERTICAL); tabs.addSelectedChangeListener(event -> { final Tab selectedTab = event.getSelectedTab(); final Component component = tab2Workspace.get(selectedTab); setContent(component); }); addToDrawer(tabs); setContent(new Span("click in the menu ;-) , you will see me never again..")); }
Example #3
Source File: AppLayoutBuilder.java From vaadin-app-layout with Apache License 2.0 | 5 votes |
/** * @param url a url to the image that is supposed to be shown in the app bar * @return Itself to allow method chaining */ public AppLayoutBuilder<T> withIcon(String url) { Image image = new Image(url, "icon"); image.setHeight("var(--app-layout-menu-button-height)"); image.getStyle().set("margin", "var(--app-layout-space-s)"); return withIconComponent(image); }
Example #4
Source File: RouterLinkView.java From flow with Apache License 2.0 | 5 votes |
private void addImageLink() { Anchor anchor = new Anchor("image/link", (String) null); anchor.getElement().setAttribute("router-link", true); anchor.getStyle().set("display", "block"); Image image = new Image("", "IMAGE"); image.setWidth("200px"); image.setHeight("200px"); anchor.add(image); add(anchor); }
Example #5
Source File: ImageClickView.java From flow with Apache License 2.0 | 5 votes |
public ImageClickView() { Div message = new Div(); message.setText("Before click"); message.setId("message"); Image image = new Image("", "IMAGE"); image.setId("image"); image.addClickListener(event -> message.setText("After click")); add(image, message); }
Example #6
Source File: ProfileButton.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
public ProfileButton(Image icon) { super(icon); }
Example #7
Source File: ImageProfileButton.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
public ImageProfileButton(Image image) { super(image); init(image); }
Example #8
Source File: ImageProfileButton.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
private void init(Image image) { getWrappedComponent().getElement().getStyle().set("line-height", "var(--app-layout-menu-button-height)"); image.setWidth("calc(var(--app-layout-menu-button-height) - 4px)"); image.setHeight("calc(var(--app-layout-menu-button-height) - 4px)"); image.getStyle().set("border-radius", "100px"); }
Example #9
Source File: ImageProfileButton.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
public ImageProfileButton(String image) { super(); Image imageComponent = new Image(image, "Profile image"); getWrappedComponent().setIcon(imageComponent); init(imageComponent); }
Example #10
Source File: AppBarImageProfileButtonBuilder.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
private AppBarImageProfileButtonBuilder(Image image) { appBarProfileButton = new ImageProfileButton(image); }
Example #11
Source File: AppBarImageProfileButtonBuilder.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
public static AppBarImageProfileButtonBuilder get(Image image) { return new AppBarImageProfileButtonBuilder(image); }