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.

StyleSheet.java 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.annotations;
  17. import java.lang.annotation.ElementType;
  18. import java.lang.annotation.Retention;
  19. import java.lang.annotation.RetentionPolicy;
  20. import java.lang.annotation.Target;
  21. import com.vaadin.server.ClientConnector;
  22. /**
  23. * If this annotation is present on a {@link ClientConnector} class, the
  24. * framework ensures the referenced style sheets are loaded before the init
  25. * method for the corresponding client-side connector is invoked.
  26. * <p>
  27. * Example: {@code @StyleSheet( "http://host.com/file1.css", "file2.css"})} on
  28. * the class com.example.MyConnector would load the file
  29. * http://host.com/file1.css as is and file2.css from /com/example/file2.css on
  30. * the server's classpath using the ClassLoader that was used to load
  31. * com.example.MyConnector.
  32. *
  33. * @author Vaadin Ltd
  34. * @since 7.0.0
  35. */
  36. @Retention(RetentionPolicy.RUNTIME)
  37. @Target(ElementType.TYPE)
  38. public @interface StyleSheet {
  39. /**
  40. * Style sheets to load before initializing the client-side connector.
  41. *
  42. * @return an array of style sheet urls
  43. */
  44. public String[] value();
  45. }