Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

BootstrapFragmentResponse.java 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.terminal.gwt.server;
  17. import java.util.List;
  18. import org.jsoup.nodes.Node;
  19. import com.vaadin.Application;
  20. import com.vaadin.terminal.WrappedRequest;
  21. /**
  22. * A representation of a bootstrap fragment being generated. The bootstrap
  23. * fragment is the HTML code that will make up the actual application. This also
  24. * includes the JavaScript that initializes the application.
  25. *
  26. * @author Vaadin Ltd
  27. * @since 7.0.0
  28. */
  29. public class BootstrapFragmentResponse extends BootstrapResponse {
  30. private final List<Node> fragmentNodes;
  31. /**
  32. * Crate a new bootstrap fragment response.
  33. *
  34. * @see BootstrapResponse#BootstrapResponse(BootstrapHandler,
  35. * WrappedRequest, Application, Integer)
  36. *
  37. * @param handler
  38. * the bootstrap handler that is firing the event
  39. * @param request
  40. * the wrapped request for which the bootstrap page should be
  41. * generated
  42. * @param application
  43. * the application for which the bootstrap page should be
  44. * generated
  45. * @param uiId
  46. * the generated id of the UI that will be displayed on the page
  47. * @param fragmentNodes
  48. * a mutable list containing the DOM nodes that will make up the
  49. * application HTML
  50. */
  51. public BootstrapFragmentResponse(BootstrapHandler handler,
  52. WrappedRequest request, Application application, Integer uiId,
  53. List<Node> fragmentNodes) {
  54. super(handler, request, application, uiId);
  55. this.fragmentNodes = fragmentNodes;
  56. }
  57. /**
  58. * Gets the list of DOM nodes that will be used to generate the fragment
  59. * HTML. Changes to the returned list will be reflected in the generated
  60. * HTML.
  61. *
  62. * @return the current list of DOM nodes that makes up the application
  63. * fragment
  64. */
  65. public List<Node> getFragmentNodes() {
  66. return fragmentNodes;
  67. }
  68. }