You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BootstrapFragmentResponse.java 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import java.util.List;
  18. import org.jsoup.nodes.Node;
  19. import com.vaadin.ui.UI;
  20. /**
  21. * A representation of a bootstrap fragment being generated. The bootstrap
  22. * fragment is the HTML code that will make up the actual application. This also
  23. * includes the JavaScript that initializes the application.
  24. *
  25. * @author Vaadin Ltd
  26. * @since 7.0.0
  27. */
  28. public class BootstrapFragmentResponse extends BootstrapResponse {
  29. private final List<Node> fragmentNodes;
  30. /**
  31. * Crate a new bootstrap fragment response.
  32. *
  33. * @see BootstrapResponse#BootstrapResponse(BootstrapHandler, VaadinRequest,
  34. * VaadinSession, Class, UIProvider)
  35. *
  36. * @param handler
  37. * the bootstrap handler that is firing the event
  38. * @param request
  39. * the Vaadin request for which the bootstrap page should be
  40. * generated
  41. * @param session
  42. * the service session for which the bootstrap page should be
  43. * generated
  44. * @param uiClass
  45. * the class of the UI that will be displayed on the page
  46. * @param fragmentNodes
  47. * a mutable list containing the DOM nodes that will make up the
  48. * application HTML
  49. * @param uiProvider
  50. * the UI provider for the bootstrap
  51. */
  52. public BootstrapFragmentResponse(BootstrapHandler handler,
  53. VaadinRequest request, VaadinSession session,
  54. Class<? extends UI> uiClass, List<Node> fragmentNodes,
  55. UIProvider uiProvider) {
  56. super(handler, request, session, uiClass, uiProvider);
  57. this.fragmentNodes = fragmentNodes;
  58. }
  59. /**
  60. * Gets the list of DOM nodes that will be used to generate the fragment
  61. * HTML. Changes to the returned list will be reflected in the generated
  62. * HTML.
  63. *
  64. * @return the current list of DOM nodes that makes up the application
  65. * fragment
  66. */
  67. public List<Node> getFragmentNodes() {
  68. return fragmentNodes;
  69. }
  70. }