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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2011 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.Application;
  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,
  34. * WrappedRequest, Application, Integer)
  35. *
  36. * @param handler
  37. * the bootstrap handler that is firing the event
  38. * @param request
  39. * the wrapped request for which the bootstrap page should be
  40. * generated
  41. * @param application
  42. * the application for which the bootstrap page should be
  43. * generated
  44. * @param uiId
  45. * the generated id 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. */
  50. public BootstrapFragmentResponse(BootstrapHandler handler,
  51. WrappedRequest request, Application application, Integer uiId,
  52. List<Node> fragmentNodes) {
  53. super(handler, request, application, uiId);
  54. this.fragmentNodes = fragmentNodes;
  55. }
  56. /**
  57. * Gets the list of DOM nodes that will be used to generate the fragment
  58. * HTML. Changes to the returned list will be reflected in the generated
  59. * HTML.
  60. *
  61. * @return the current list of DOM nodes that makes up the application
  62. * fragment
  63. */
  64. public List<Node> getFragmentNodes() {
  65. return fragmentNodes;
  66. }
  67. }