com.vaadin.flow.component.html.Paragraph Java Examples
The following examples show how to use
com.vaadin.flow.component.html.Paragraph.
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: PostponeProceedView.java From flow with Apache License 2.0 | 6 votes |
public PostponeProceedView() { RouterLink link = new RouterLink("Navigate to another view", ProceedResultView.class); link.setId("link"); add(link, new Paragraph()); RouterLink delayedProceedLink = new RouterLink( "Navigate to another view with delayed proceed", DelayedProceedTargetView.class); delayedProceedLink.setId("delayedProceedLink"); NativeButton postponedNavigateButton = new NativeButton( "Postponed navigate", event -> UI.getCurrent() .navigate(DelayedProceedTargetView.class)); postponedNavigateButton.setId("postponedNavigateButton"); NativeButton proceedButton = new NativeButton("proceed", event -> continueNavigationAction.proceed()); proceedButton.setId("proceedButton"); add(delayedProceedLink, new Paragraph(), postponedNavigateButton, new Paragraph(), proceedButton); }
Example #2
Source File: PreventLeavingView.java From flow with Apache License 2.0 | 6 votes |
public PreventLeavingView() { Input input = new Input(); input.setId("preventRouteInput"); add(input); NativeButton submitPreventRoute = new NativeButton( "Submit prevent route"); submitPreventRoute .addClickListener(event -> { preventRoute = input.getValue(); String preventedMessage = String .format("preventing navigation to '%s'", preventRoute); Paragraph paragraph = new Paragraph(preventedMessage); paragraph.setClassName("prevented-route"); add(paragraph); }); submitPreventRoute.setId("preventRouteButton"); add(submitPreventRoute); }
Example #3
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 6 votes |
public View1(@Autowired MessageBean bean, @Autowired MainAppLayout appLayout) { Button button = new Button("Click me", e -> Notification.show(bean.getMessage())); add(button); // can access the AppLayout instance via dependency injection int notificationCount = appLayout.getNotifications().getNotificationSize(); add(new Paragraph("You have "+notificationCount+" notification(s)")); add(getLabel()); add(getLabel()); add(getLabel()); add(getLabel()); add(getLabel()); add(getLabel()); }
Example #4
Source File: DefaultValueInitializationComponent.java From flow with Apache License 2.0 | 5 votes |
public DefaultValueInitializationComponent() { valueParagraph = new Paragraph(); valueParagraph.setId("value"); updateParagraph = new Paragraph(); updateParagraph.setId("counter"); updateParagraphs(); add(valueParagraph, updateParagraph); }
Example #5
Source File: KeyboardEventView.java From flow with Apache License 2.0 | 5 votes |
public KeyboardEventView() { input.setId("input"); Paragraph paragraph = new Paragraph(); paragraph.setId("paragraph"); ComponentUtil.addListener(input, KeyDownEvent.class, event -> { /* for each event, sets a string "keyvalue:codevalue;" to the paragraph. For 'Q' the string would be "Q:KeyQ" */ String keyText = String.join(",", event.getKey().getKeys()); String codeText = (event.getCode().isPresent() ? String.join(",", event.getCode().get().getKeys()) : ""); paragraph.setText(keyText + ":" + codeText); }); add(input, paragraph); Paragraph keyUpParagraph = new Paragraph(); keyUpParagraph.setId("keyUpParagraph"); ComponentUtil.addListener(input, KeyUpEvent.class, event -> keyUpParagraph .setText(String.join(",", event.getKey().getKeys()))); sendInvalidKeyUp.setId("sendInvalidKeyUp"); sendInvalidKeyUp.addClickListener(event -> { getUI().ifPresent(ui -> ui.getPage().executeJs( "$0.dispatchEvent(new KeyboardEvent('keyup', {}))", input.getElement())); }); add(sendInvalidKeyUp, keyUpParagraph); UI.getCurrent().getSession().setErrorHandler(event -> keyUpParagraph .setText(event.getThrowable().getMessage())); }
Example #6
Source File: DevModeConfigView.java From flow with Apache License 2.0 | 5 votes |
public DevModeConfigView() { Paragraph productionMode = new Paragraph(String.valueOf(VaadinService .getCurrent().getDeploymentConfiguration().isProductionMode())); productionMode.setId("productionMode"); Paragraph devModeLiveReloadEnabled = new Paragraph( String.valueOf(VaadinService.getCurrent() .getDeploymentConfiguration().isDevModeLiveReloadEnabled())); devModeLiveReloadEnabled.setId("devModeLiveReloadEnabled"); add(productionMode, devModeLiveReloadEnabled); }
Example #7
Source File: FAQView.java From alibaba-rsocket-broker with Apache License 2.0 | 5 votes |
public FAQView() { add(new H1("FAQ")); Accordion accordion = new Accordion(); accordion.add("RSocket Broker是如何控制服务调用的?", new Paragraph("RSocket Broker采用org和Service Account来控制服务调用,只有相同org和service account才能相互访问,如果不是则需要进行ACL访问授权!")); accordion.add("RSocket Broker的集群是如何管理?", new Paragraph("目前主要是基于Gossip进行集群管理")); accordion.add("RSocket Broker支持DNS吗?", new Paragraph("RSocket支持DNS-over-HTTP和DNS-over-RSocket,OkHttp3默认支持!")); accordion.add("RSocket的相关资料有吗?", new Paragraph("请访问 http://rsocketbyexample.info 和 https://github.com/alibaba/alibaba-rsocket-broker/wiki")); add(accordion); }
Example #8
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #9
Source File: FactoryExporter.java From flow with Apache License 2.0 | 4 votes |
public InterfaceBasedComponent() { Paragraph paragraph = new Paragraph("Hello world"); paragraph.setId("paragraph"); add(paragraph); }
Example #10
Source File: AbstractDebounceSynchronizeView.java From flow with Apache License 2.0 | 4 votes |
protected void addChangeMessage(Serializable value) { messages.add(new Paragraph("Value: " + value)); }
Example #11
Source File: DomEventFilterView.java From flow with Apache License 2.0 | 4 votes |
public DomEventFilterView() { Element space = new Element("input"); space.setAttribute("id", "space"); space.addEventListener("keypress", e -> addMessage("Space listener triggered")) .setFilter("event.key == ' ' || event.key == 'Spacebar'"); // The key is called 'Spacebar' on IE11 Element debounce = new Element("input"); debounce.setAttribute("id", "debounce"); debounce.addEventListener("input", e -> addMessage("Trailing: " + e.getEventData().getString("element.value"))) .debounce(1000).addEventData("element.value"); debounce.addEventListener("input", e -> addMessage("Leading: " + e.getEventData().getString("element.value"))) .debounce(1000, DebouncePhase.LEADING); debounce.addEventListener("input", e -> addMessage("Throttle: " + e.getEventData().getString("element.value"))) .throttle(1000); DebounceComponent component = new DebounceComponent(); component.setId("debounce-component"); component.addInputListener( e -> addMessage("Component: " + e.getValue()), 1000); messages.setAttribute("id", "messages"); getElement().appendChild(space, debounce, component.getElement(), messages); // tests for#5090 final AtomicReference<DomListenerRegistration> atomicReference = new AtomicReference<>(); final Paragraph resultParagraph = new Paragraph(); resultParagraph.setId("result-paragraph"); NativeButton removalButton = new NativeButton("Remove DOM listener", event -> { resultParagraph.setText("REMOVED"); atomicReference.get().remove(); }); removalButton.setId("listener-removal-button"); Input listenerInput = new Input(ValueChangeMode.ON_CHANGE); listenerInput.setId("listener-input"); /* The event.preventDefault() is here to make sure that the listener has been cleaned on the client-side as well. The server-side cleaning is not really in question. */ ComponentUtil.addListener(listenerInput, KeyDownEvent.class, event -> resultParagraph.setText("A"), registration -> { atomicReference.set(registration); registration.setFilter("event.key === 'a' && " + "(event.preventDefault() || true)"); }); ComponentUtil.addListener(listenerInput, KeyDownEvent.class, event -> resultParagraph.setText("B"), registration -> registration.setFilter("event.key === 'b' && " + "(event.preventDefault() || true)")); add(listenerInput, removalButton, resultParagraph); }
Example #12
Source File: ViewWithAllEvents.java From flow with Apache License 2.0 | 4 votes |
private void addLog(String log) { logger.add(new Paragraph("ViewWithAllEvents: " + log)); }
Example #13
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #14
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #15
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #16
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #17
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #18
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #19
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #20
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #21
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #22
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #23
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #24
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #25
Source File: View1.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph("........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #26
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }
Example #27
Source File: SubContent.java From vaadin-app-layout with Apache License 2.0 | 4 votes |
Paragraph getLabel() { Paragraph label = new Paragraph(" SubContent ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ ........................................ "); label.setWidth("100%"); return label; }