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.

themes-eclipse.asciidoc 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ---
  2. title: Creating a Theme in Eclipse
  3. order: 6
  4. layout: page
  5. ---
  6. [[themes.eclipse]]
  7. = Creating a Theme in Eclipse
  8. The Eclipse plugin automatically creates a theme stub for new Vaadin projects.
  9. It also includes a wizard for creating new custom themes. Do the following steps
  10. to create a new theme.
  11. . Select "File > New > Other..." in the main menu or right-click the
  12. [guilabel]#Project Explorer# and select "New > Other...". A window will open.
  13. . In the [guilabel]#Select a wizard# step, select the "Vaadin > Vaadin Theme"
  14. wizard.
  15. +
  16. image::img/eclipse-theme-new.png[]
  17. +
  18. Click [guibutton]#Next# to proceed to the next step.
  19. . In the [guilabel]#Create a new Vaadin theme# step, you have the following
  20. settings:
  21. [guilabel]#Project#(mandatory):: The project in which the theme should be created.
  22. [guilabel]#Theme name#(mandatory):: The theme name is used as the name of the theme folder and in a CSS tag
  23. (prefixed with " [literal]#++v-theme-++#"), so it must be a proper identifier.
  24. Only latin alphanumerics, underscore, and minus sign are allowed.
  25. [guilabel]#Modify application classes to use theme#(optional):: The setting allows the wizard to write a code statement that enables the theme
  26. in the constructor of the selected application (UI) class(es). If you need to
  27. control the theme with dynamic logic, you can leave the setting unchecked or
  28. change the generated line later.
  29. +
  30. image::img/eclipse-theme-settings.png[]
  31. +
  32. Click [guibutton]#Finish# to create the theme.
  33. The wizard creates the theme folder under the
  34. [filename]#WebContent/VAADIN/themes# folder and the actual style sheet as
  35. [filename]#mytheme.scss# and [filename]#styles.scss# files, as illustrated in
  36. <<figure.eclipse.theme.created>>.
  37. [[figure.eclipse.theme.created]]
  38. .Newly Created Theme
  39. image::img/eclipse-theme-created-annotated-hi.png[]
  40. The created theme extends a built-in base theme with an [literal]#++@import++#
  41. statement. See the explanation of theme inheritance in
  42. <<themes-creating#themes.creating,"Creating and
  43. Using Themes">>. Notice that the [filename]#reindeer# theme is not located in
  44. the [filename]#widgetsets# folder, but in the Vaadin JAR. See
  45. <<themes-creating#themes.creating.builtin,"Built-in
  46. Themes">> for information for serving the built-in themes.
  47. If you selected a UI class or classes in the [guilabel]#Modify application
  48. classes to use theme# in the theme wizard, the wizard will add the
  49. [literal]#++@Theme++# annotation to the UI class.
  50. If you later rename the theme in Eclipse, notice that changing the name of the
  51. folder will not automatically change the [literal]#++@Theme++# annotation. You
  52. need to change such references to theme names in the calls manually.