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.

ValoTheme.java 36KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090
  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.ui.themes;
  17. import com.vaadin.ui.Notification.Type;
  18. /**
  19. * <p>
  20. * Additional style names which can be used with the Valo theme.
  21. * </p>
  22. *
  23. * <p>
  24. * These styles are only available if the
  25. * <code>$v-included-additional-styles</code> Sass list variable contains the
  26. * name of the component for that additional style name (e.g.
  27. * <code>button, textfield, table</code>).
  28. * </p>
  29. *
  30. * <p>
  31. * Most of these additional style names can be included individually into your
  32. * custom theme using the component specific Sass mixins, in which case you can
  33. * also define the style names yourself. See the Valo theme Sass API
  34. * documentation for additional information.
  35. * </p>
  36. *
  37. * TODO link to Sass API documentation
  38. *
  39. * @since 7.3
  40. * @author Vaadin Ltd
  41. */
  42. public class ValoTheme {
  43. public static final String THEME_NAME = "valo";
  44. /***************************************************************************
  45. *
  46. * Notification styles
  47. *
  48. **************************************************************************/
  49. /**
  50. * Styles the notification to look like {@link Type#TRAY_NOTIFICATION},
  51. * without setting the position and delay. Can be combined with any other
  52. * Notification style.
  53. */
  54. public static final String NOTIFICATION_TRAY = "tray";
  55. /**
  56. * Styles the notification to look like {@link Type#WARNING_MESSAGE},
  57. * without setting the position and delay. Can be combined with any other
  58. * Notification style.
  59. */
  60. public static final String NOTIFICATION_WARNING = "warning";
  61. /**
  62. * Styles the notification to look like {@link Type#ERROR_MESSAGE}, without
  63. * setting the position and delay. Can be combined with any other
  64. * Notification style.
  65. */
  66. public static final String NOTIFICATION_ERROR = "error";
  67. /**
  68. * Styles the notification to look like a system notification. Can be
  69. * combined with any other Notification style.
  70. */
  71. public static final String NOTIFICATION_SYSTEM = "system";
  72. /**
  73. * Styles the notification to span the entire width of the viewport. Can be
  74. * combined with any other Notification style.
  75. */
  76. public static final String NOTIFICATION_BAR = "bar";
  77. /**
  78. * Smaller padding and font size for the notification. Can be combined with
  79. * any other Notification style.
  80. */
  81. public static final String NOTIFICATION_SMALL = "small";
  82. /**
  83. * Adds a close button to the notification to imply that the user must click
  84. * on the notification to dismiss it. Use in combination with an infinite
  85. * delay (<code>-1</code>). Can be combined with any other Notification
  86. * style.
  87. */
  88. public static final String NOTIFICATION_CLOSABLE = "closable";
  89. /**
  90. * Success notification style. Adds a border around the notification and an
  91. * icon next to the title. Can be combined with any other Notification style.
  92. */
  93. public static final String NOTIFICATION_SUCCESS = "success";
  94. /**
  95. * Failure notification style. Adds a border around the notification and an
  96. * icon next to the title. Can be combined with any other Notification style.
  97. */
  98. public static final String NOTIFICATION_FAILURE = "failure";
  99. /**
  100. * Styles the notification to look like {@link Type#ERROR_MESSAGE}, without
  101. * setting the position and delay and without the close button. Can be
  102. * combined with any other Notification style.
  103. */
  104. public static final String NOTIFICATION_CRITICAL_ERROR = "critical-error";
  105. /**
  106. * Styles the notification to be dark variant. Can be combined with any
  107. * other Notification style.
  108. */
  109. public static final String NOTIFICATION_DARK = "dark";
  110. /***************************************************************************
  111. *
  112. * Label styles
  113. *
  114. **************************************************************************/
  115. /**
  116. * Header style for main application headings. Can be combined with any
  117. * other Label style.
  118. */
  119. public static final String LABEL_H1 = "h1";
  120. /**
  121. * Header style for different sections in the application. Can be combined
  122. * with any other Label style.
  123. */
  124. public static final String LABEL_H2 = "h2";
  125. /**
  126. * Header style for different sub-sections in the application. Can be
  127. * combined with any other Label style.
  128. */
  129. public static final String LABEL_H3 = "h3";
  130. /**
  131. * Header style for different sub-sections in the application. Can be
  132. * combined with any other Label style.
  133. */
  134. public static final String LABEL_H4 = "h4";
  135. /**
  136. * A utility style that can be combined with the {@link #LABEL_H1},
  137. * {@link #LABEL_H2}, {@link #LABEL_H3} and {@link #LABEL_H4} styles to
  138. * remove the default margins from the header.
  139. */
  140. public static final String LABEL_NO_MARGIN = "no-margin";
  141. /**
  142. * Tiny font size. Suitable for additional/supplementary UI text. Can be
  143. * combined with any other Label style.
  144. */
  145. public static final String LABEL_TINY = "tiny";
  146. /**
  147. * Small font size. Suitable for additional/supplementary UI text. Can be
  148. * combined with any other Label style.
  149. */
  150. public static final String LABEL_SMALL = "small";
  151. /**
  152. * Large font size. Suitable for important/prominent UI text. Can be
  153. * combined with any other Label style.
  154. */
  155. public static final String LABEL_LARGE = "large";
  156. /**
  157. * Huge font size. Suitable for important/prominent UI text. Can be combined
  158. * with any other Label style.
  159. */
  160. public static final String LABEL_HUGE = "huge";
  161. /**
  162. * Lighter font weight. Suitable for additional/supplementary UI text. Can
  163. * be combined with any other Label style.
  164. */
  165. public static final String LABEL_LIGHT = "light";
  166. /**
  167. * Bolder font weight. Suitable for important/prominent UI text. Can be
  168. * combined with any other Label style.
  169. */
  170. public static final String LABEL_BOLD = "bold";
  171. /**
  172. * Colored text. Can be combined with any other Label style.
  173. */
  174. public static final String LABEL_COLORED = "colored";
  175. /**
  176. * Success badge style. Adds a border around the label and an icon next to
  177. * the text. Suitable for UI notifications that need to in the direct
  178. * context of some component. Can be combined with any other Label style.
  179. */
  180. public static final String LABEL_SUCCESS = "success";
  181. /**
  182. * Failure badge style. Adds a border around the label and an icon next to
  183. * the text. Suitable for UI notifications that need to in the direct
  184. * context of some component. Can be combined with any other Label style.
  185. */
  186. public static final String LABEL_FAILURE = "failure";
  187. /**
  188. * Spinner style. Add this style name to an empty Label to create a spinner.
  189. *
  190. * <h4>Example</h4>
  191. *
  192. * <pre>
  193. * Label spinner = new Label();
  194. * spinner.addStyleName(ValoTheme.LABEL_SPINNER);
  195. * </pre>
  196. */
  197. public static final String LABEL_SPINNER = "spinner";
  198. /***************************************************************************
  199. *
  200. * Button styles
  201. *
  202. **************************************************************************/
  203. /**
  204. * Primary action button (e.g. the button that should get activated when the
  205. * user presses the <code>enter</code> key in a form). Use sparingly, only
  206. * one default button per view should be visible. Can be combined with any
  207. * other Button style.
  208. */
  209. public static final String BUTTON_PRIMARY = "primary";
  210. /**
  211. * A prominent button that can be used instead of the
  212. * {@link #BUTTON_PRIMARY} for primary actions when the action is considered
  213. * <b>safe</b> for the user (i.e. does not cause any data loss or any other
  214. * irreversible action). Can be combined with any other Button style.
  215. */
  216. public static final String BUTTON_FRIENDLY = "friendly";
  217. /**
  218. * A prominent button that can be used when the action is considered
  219. * <b>unsafe</b> for the user (i.e. it causes data loss or some other
  220. * irreversible action). Can be combined with any other Button style.
  221. */
  222. public static final String BUTTON_DANGER = "danger";
  223. /**
  224. * Borderless button. Can be combined with any other Button style.
  225. */
  226. public static final String BUTTON_BORDERLESS = "borderless";
  227. /**
  228. * Borderless button with a colored caption text. Can be combined with any
  229. * other Button style.
  230. */
  231. public static final String BUTTON_BORDERLESS_COLORED = "borderless-colored";
  232. /**
  233. * "Quiet" button, which looks like {@link #BUTTON_BORDERLESS} until you
  234. * hover over it with the mouse. Can be combined with any other Button
  235. * style.
  236. */
  237. public static final String BUTTON_QUIET = "quiet";
  238. /**
  239. * Makes the button look like the Link component. Can be combined with any
  240. * other Button style.
  241. */
  242. public static final String BUTTON_LINK = "link";
  243. /**
  244. * Tiny size button. Can be combined with any other Button style.
  245. */
  246. public static final String BUTTON_TINY = "tiny";
  247. /**
  248. * Small size button. Can be combined with any other Button style.
  249. */
  250. public static final String BUTTON_SMALL = "small";
  251. /**
  252. * Large size button. Can be combined with any other Button style.
  253. */
  254. public static final String BUTTON_LARGE = "large";
  255. /**
  256. * Huge size button. Can be combined with any other Button style.
  257. */
  258. public static final String BUTTON_HUGE = "huge";
  259. /**
  260. * Align the icon to the right side of the button caption. Can be combined
  261. * with any other Button style.
  262. */
  263. public static final String BUTTON_ICON_ALIGN_RIGHT = "icon-align-right";
  264. /**
  265. * Stack the icon on top of the button caption. Can be combined with any
  266. * other Button style.
  267. */
  268. public static final String BUTTON_ICON_ALIGN_TOP = "icon-align-top";
  269. /**
  270. * Only show the icon in the button, and size the button to a square shape.
  271. */
  272. public static final String BUTTON_ICON_ONLY = "icon-only";
  273. /***************************************************************************
  274. *
  275. * Link styles
  276. *
  277. **************************************************************************/
  278. /**
  279. * Small size link.
  280. */
  281. public static final String LINK_SMALL = "small";
  282. /**
  283. * Large size link.
  284. */
  285. public static final String LINK_LARGE = "large";
  286. /***************************************************************************
  287. *
  288. * TextField styles
  289. *
  290. **************************************************************************/
  291. /**
  292. * Tiny size text field. Can be combined with any other TextField style.
  293. */
  294. public static final String TEXTFIELD_TINY = "tiny";
  295. /**
  296. * Small size text field. Can be combined with any other TextField style.
  297. */
  298. public static final String TEXTFIELD_SMALL = "small";
  299. /**
  300. * Large size text field. Can be combined with any other TextField style.
  301. */
  302. public static final String TEXTFIELD_LARGE = "large";
  303. /**
  304. * Huge size text field. Can be combined with any other TextField style.
  305. */
  306. public static final String TEXTFIELD_HUGE = "huge";
  307. /**
  308. * Removes the border and background from the text field. Can be combined
  309. * with any other TextField style.
  310. */
  311. public static final String TEXTFIELD_BORDERLESS = "borderless";
  312. /**
  313. * Align the text inside the field to the right. Can be combined with any
  314. * other TextField style.
  315. */
  316. public static final String TEXTFIELD_ALIGN_RIGHT = "align-right";
  317. /**
  318. * Align the text inside the field to center. Can be combined with any other
  319. * TextField style.
  320. */
  321. public static final String TEXTFIELD_ALIGN_CENTER = "align-center";
  322. /**
  323. * Move the default caption icon inside the text field. Can be combined with
  324. * any other TextField style.
  325. */
  326. public static final String TEXTFIELD_INLINE_ICON = "inline-icon";
  327. /***************************************************************************
  328. *
  329. * TextArea styles
  330. *
  331. **************************************************************************/
  332. /**
  333. * Tiny size text area. Can be combined with any other TextArea style.
  334. */
  335. public static final String TEXTAREA_TINY = "tiny";
  336. /**
  337. * Small size text area. Can be combined with any other TextArea style.
  338. */
  339. public static final String TEXTAREA_SMALL = "small";
  340. /**
  341. * Large size text area. Can be combined with any other TextArea style.
  342. */
  343. public static final String TEXTAREA_LARGE = "large";
  344. /**
  345. * Huge size text area. Can be combined with any other TextArea style.
  346. */
  347. public static final String TEXTAREA_HUGE = "huge";
  348. /**
  349. * Removes the border and background from the text area. Can be combined
  350. * with any other TextArea style.
  351. */
  352. public static final String TEXTAREA_BORDERLESS = "borderless";
  353. /**
  354. * Align the text inside the area to the right. Can be combined with any
  355. * other TextArea style.
  356. */
  357. public static final String TEXTAREA_ALIGN_RIGHT = "align-right";
  358. /**
  359. * Align the text inside the area to center. Can be combined with any other
  360. * TextArea style.
  361. */
  362. public static final String TEXTAREA_ALIGN_CENTER = "align-center";
  363. /***************************************************************************
  364. *
  365. * DateField styles
  366. *
  367. **************************************************************************/
  368. /**
  369. * Tiny size date field. Can be combined with any other DateField style.
  370. */
  371. public static final String DATEFIELD_TINY = "tiny";
  372. /**
  373. * Small size date field. Can be combined with any other DateField style.
  374. */
  375. public static final String DATEFIELD_SMALL = "small";
  376. /**
  377. * Large size date field. Can be combined with any other DateField style.
  378. */
  379. public static final String DATEFIELD_LARGE = "large";
  380. /**
  381. * Huge size date field. Can be combined with any other DateField style.
  382. */
  383. public static final String DATEFIELD_HUGE = "huge";
  384. /**
  385. * Removes the border and background from the date field. Can be combined
  386. * with any other DateField style.
  387. */
  388. public static final String DATEFIELD_BORDERLESS = "borderless";
  389. /**
  390. * Align the text inside the field to the right. Can be combined with any
  391. * other DateField style.
  392. */
  393. public static final String DATEFIELD_ALIGN_RIGHT = "align-right";
  394. /**
  395. * Align the text inside the field to center. Can be combined with any other
  396. * DateField style.
  397. */
  398. public static final String DATEFIELD_ALIGN_CENTER = "align-center";
  399. /***************************************************************************
  400. *
  401. * ComboBox styles
  402. *
  403. **************************************************************************/
  404. /**
  405. * Tiny size combo box. Can be combined with any other ComboBox style.
  406. */
  407. public static final String COMBOBOX_TINY = "tiny";
  408. /**
  409. * Small size combo box. Can be combined with any other ComboBox style.
  410. */
  411. public static final String COMBOBOX_SMALL = "small";
  412. /**
  413. * Large size combo box. Can be combined with any other ComboBox style.
  414. */
  415. public static final String COMBOBOX_LARGE = "large";
  416. /**
  417. * Huge size combo box. Can be combined with any other ComboBox style.
  418. */
  419. public static final String COMBOBOX_HUGE = "huge";
  420. /**
  421. * Removes the border and background from the combo box. Can be combined
  422. * with any other ComboBox style.
  423. */
  424. public static final String COMBOBOX_BORDERLESS = "borderless";
  425. /**
  426. * Align the text inside the combo box to the right. Can be combined with
  427. * any other TextField style.
  428. */
  429. public static final String COMBOBOX_ALIGN_RIGHT = "align-right";
  430. /**
  431. * Align the text inside the combo box to center. Can be combined with any
  432. * other TextField style.
  433. */
  434. public static final String COMBOBOX_ALIGN_CENTER = "align-center";
  435. /***************************************************************************
  436. *
  437. * CheckBox styles
  438. *
  439. **************************************************************************/
  440. /**
  441. * Small size check box. Can be combined with any other CheckBox style.
  442. */
  443. public static final String CHECKBOX_SMALL = "small";
  444. /**
  445. * Large size check box. Can be combined with any other CheckBox style.
  446. */
  447. public static final String CHECKBOX_LARGE = "large";
  448. /***************************************************************************
  449. *
  450. * RadioButtonGroup/CheckBoxGroup styles
  451. *
  452. **************************************************************************/
  453. /**
  454. * Small size option group. Can be combined with any other
  455. * RadioButtonGroup/CheckBoxGroup style.
  456. */
  457. public static final String OPTIONGROUP_SMALL = "small";
  458. /**
  459. * Large size option group. Can be combined with any other
  460. * RadioButtonGroup/CheckBoxGroup style.
  461. */
  462. public static final String OPTIONGROUP_LARGE = "large";
  463. /**
  464. * Display the options horizontally in a row (by default the items are
  465. * stacked vertically).
  466. */
  467. public static final String OPTIONGROUP_HORIZONTAL = "horizontal";
  468. /***************************************************************************
  469. *
  470. * Slider styles
  471. *
  472. **************************************************************************/
  473. /**
  474. * Hide the indicator bar from the slider. Can be combined with any other
  475. * Slider style.
  476. */
  477. public static final String SLIDER_NO_INDICATOR = "no-indicator";
  478. /***************************************************************************
  479. *
  480. * ProgressBar styles
  481. *
  482. **************************************************************************/
  483. /**
  484. * Make the progress bar indicator appear as a dot which progresses over the
  485. * progress bar track (instead of a growing bar).
  486. */
  487. public static final String PROGRESSBAR_POINT = "point";
  488. /***************************************************************************
  489. *
  490. * MenuBar styles
  491. *
  492. **************************************************************************/
  493. /**
  494. * Small size menu bar. Can be combined with any other MenuBar style.
  495. */
  496. public static final String MENUBAR_SMALL = "small";
  497. /**
  498. * Borderless menu bar. Can be combined with any other MenuBar style.
  499. */
  500. public static final String MENUBAR_BORDERLESS = "borderless";
  501. /***************************************************************************
  502. *
  503. * Table and TreeTable styles
  504. *
  505. **************************************************************************/
  506. /**
  507. * Remove the alternating row colors. Can be combined with any other
  508. * Table/TreeTable style.
  509. */
  510. public static final String TABLE_NO_STRIPES = "no-stripes";
  511. /**
  512. * See {@link #TABLE_NO_STRIPES}.
  513. */
  514. public static final String TREETABLE_NO_STRIPES = TABLE_NO_STRIPES;
  515. /**
  516. * Remove the vertical divider lines between the table columns. Can be
  517. * combined with any other Table/TreeTable style.
  518. */
  519. public static final String TABLE_NO_VERTICAL_LINES = "no-vertical-lines";
  520. /**
  521. * See {@link #TABLE_NO_VERTICAL_LINES}.
  522. */
  523. public static final String TREETABLE_NO_VERTICAL_LINES = TABLE_NO_VERTICAL_LINES;
  524. /**
  525. * Remove the horizontal divider lines between the table rows. Can be
  526. * combined with any other Table/TreeTable style.
  527. */
  528. public static final String TABLE_NO_HORIZONTAL_LINES = "no-horizontal-lines";
  529. /**
  530. * See {@link #TABLE_NO_HORIZONTAL_LINES}.
  531. */
  532. public static final String TREETABLE_NO_HORIZONTAL_LINES = TABLE_NO_HORIZONTAL_LINES;
  533. /**
  534. * Hide the table column headers (effectively the same as
  535. * {@code ColumnHeaderMode.HIDDEN}). Can be combined with any other
  536. * Table/TreeTable style.
  537. */
  538. public static final String TABLE_NO_HEADER = "no-header";
  539. /**
  540. * See {@link #TABLE_NO_HEADER}.
  541. */
  542. public static final String TREETABLE_NO_HEADER = TABLE_NO_HEADER;
  543. /**
  544. * Remove the outer border of the table. Can be combined with any other
  545. * Table/TreeTable style.
  546. */
  547. public static final String TABLE_BORDERLESS = "borderless";
  548. /**
  549. * See {@link #TABLE_BORDERLESS}.
  550. */
  551. public static final String TREETABLE_BORDERLESS = TABLE_BORDERLESS;
  552. /**
  553. * Reduce the white space inside the table cells. Can be combined with any
  554. * other Table/TreeTable style.
  555. */
  556. public static final String TABLE_COMPACT = "compact";
  557. /**
  558. * See {@link #TABLE_COMPACT}.
  559. */
  560. public static final String TREETABLE_COMPACT = TABLE_COMPACT;
  561. /**
  562. * Small font size and reduced the white space inside the table cells. Can
  563. * be combined with any other Table/TreeTable style.
  564. */
  565. public static final String TABLE_SMALL = "small";
  566. /**
  567. * See {@link #TABLE_SMALL}.
  568. */
  569. public static final String TREETABLE_SMALL = TABLE_SMALL;
  570. /***************************************************************************
  571. *
  572. * DragAndDropWrapper styles
  573. *
  574. **************************************************************************/
  575. /**
  576. * Hide the "box drag hints" (i.e. the style which gets applied when the
  577. * drag is in the middle/center area of the drag target).
  578. */
  579. public static final String DRAG_AND_DROP_WRAPPER_NO_BOX_DRAG_HINTS = "no-box-drag-hints";
  580. /**
  581. * Hide the "vertical drag hints" (i.e. the style which gets applied when
  582. * the drag is in the top/bottom part of the drag target).
  583. */
  584. public static final String DRAG_AND_DROP_WRAPPER_NO_VERTICAL_DRAG_HINTS = "no-vertical-drag-hints";
  585. /**
  586. * Hide the "horizontal drag hints" (i.e. the style which gets applied when
  587. * the drag is in the left/right part of the drag target).
  588. */
  589. public static final String DRAG_AND_DROP_WRAPPER_NO_HORIZONTAL_DRAG_HINTS = "no-horizontal-drag-hints";
  590. /***************************************************************************
  591. *
  592. * Panel styles
  593. *
  594. **************************************************************************/
  595. /**
  596. * Remove borders and the background color of the panel. Can be combined
  597. * with any other Panel style.
  598. */
  599. public static final String PANEL_BORDERLESS = "borderless";
  600. /**
  601. * Show a divider between the panel caption and content when the content
  602. * area is scrolled. Suitable with the {@link #PANEL_BORDERLESS} style. Can
  603. * be combined with any other Panel style.
  604. */
  605. public static final String PANEL_SCROLL_INDICATOR = "scroll-divider";
  606. /**
  607. * Inset panel style. Can be combined with any other Panel style.
  608. */
  609. public static final String PANEL_WELL = "well";
  610. /***************************************************************************
  611. *
  612. * SplitPanel styles
  613. *
  614. **************************************************************************/
  615. /**
  616. * Make the split handle wider.
  617. */
  618. public static final String SPLITPANEL_LARGE = "large";
  619. /***************************************************************************
  620. *
  621. * TabSheet styles
  622. *
  623. **************************************************************************/
  624. /**
  625. * Adds a border around the whole component as well as around individual
  626. * tabs in the tab bar. Can be combined with any other TabSheet style.
  627. */
  628. public static final String TABSHEET_FRAMED = "framed";
  629. /**
  630. * Center the tabs inside the tab bar. Works best if all the tabs fit
  631. * completely in the tab bar (i.e. no tab bar scrolling). Can be combined
  632. * with any other TabSheet style.
  633. */
  634. public static final String TABSHEET_CENTERED_TABS = "centered-tabs";
  635. /**
  636. * Give equal amount of space to all tabs in the tab bar (.i.e expand ratio
  637. * == 1 for all tabs). The tab captions will be truncated if they do not fit
  638. * in to the tab. Tab scrolling will be disabled when this style is applied
  639. * (all tabs will be visible at the same time). Can be combined with any
  640. * other TabSheet style.
  641. */
  642. public static final String TABSHEET_EQUAL_WIDTH_TABS = "equal-width-tabs";
  643. /**
  644. * Add a small amount of padding around the tabs in the tab bar, so that
  645. * they don't touch the outer edges of the component. Can be combined with
  646. * any other TabSheet style.
  647. */
  648. public static final String TABSHEET_PADDED_TABBAR = "padded-tabbar";
  649. /**
  650. * Reduce the whitespace around the tabs in the tab bar. Can be combined
  651. * with any other TabSheet style.
  652. */
  653. public static final String TABSHEET_COMPACT_TABBAR = "compact-tabbar";
  654. /**
  655. * Display tab icons on top of the tab captions (by default the icons are
  656. * place on the left side of the caption). Can be combined with any other
  657. * TabSheet style.
  658. */
  659. public static final String TABSHEET_ICONS_ON_TOP = "icons-on-top";
  660. /**
  661. * Only the selected tab has the close button visible. Does not prevent
  662. * closing the tab programmatically, it only hides the button from the end
  663. * user. Can be combined with any other TabSheet style.
  664. */
  665. public static final String TABSHEET_ONLY_SELECTED_TAB_IS_CLOSABLE = "only-selected-closable";
  666. /***************************************************************************
  667. *
  668. * Accordion styles
  669. *
  670. **************************************************************************/
  671. /**
  672. * Remove the outer border from the accordion. Can be combined with any
  673. * other Accordion style.
  674. */
  675. public static final String ACCORDION_BORDERLESS = "borderless";
  676. /***************************************************************************
  677. *
  678. * Window and related styles
  679. *
  680. **************************************************************************/
  681. /**
  682. * Add this style to any layout component (e.g. CssLayout, VerticalLayout or
  683. * HorizontalLayout) and place it inside the root layout of the window to
  684. * create a toolbar area for the window. You can then place any other
  685. * components inside the toolbar layout, e.g. a MenuBar.
  686. */
  687. public static final String WINDOW_TOP_TOOLBAR = "v-window-top-toolbar";
  688. /**
  689. * Add this style to any layout component (e.g. CssLayout, VerticalLayout or
  690. * HorizontalLayout) and place it inside the root layout of the window to
  691. * create a toolbar area for the window. You can then place any other
  692. * components inside the toolbar layout, e.g. a MenuBar.
  693. */
  694. public static final String WINDOW_BOTTOM_TOOLBAR = "v-window-bottom-toolbar";
  695. /***************************************************************************
  696. *
  697. * FormLayout styles
  698. *
  699. **************************************************************************/
  700. /**
  701. * Removes the borders and background from any direct child field components
  702. * (TextField, TextArea, DateField, ComboBox) in the layout. Reduces the
  703. * spacing between the form rows and adds separator lines between them.
  704. */
  705. public static final String FORMLAYOUT_LIGHT = "light";
  706. /***************************************************************************
  707. *
  708. * Layout styles
  709. *
  710. **************************************************************************/
  711. /**
  712. * Make a layout look like the Panel component (resembles visually a card).
  713. * Add an additional <code>v-panel-caption</code> style name to any layout
  714. * inside the card layout to make it look like a Panel's caption.
  715. */
  716. public static final String LAYOUT_CARD = "card";
  717. /**
  718. * Make a layout look like the {@link #PANEL_WELL} style. Add an additional
  719. * <code>v-panel-caption</code> style name to any layout inside the card
  720. * layout to make it look like a Panel's caption.
  721. */
  722. public static final String LAYOUT_WELL = "well";
  723. /**
  724. * Make a HorizontalLayout wrap contained components to a new line when the
  725. * isn't enough space.
  726. */
  727. public static final String LAYOUT_HORIZONTAL_WRAPPING = "wrapping";
  728. /**
  729. * Add this style name to a CssLayout to create a grouped set of components,
  730. * i.e. a row of components which are joined seamlessly together.
  731. *
  732. * <h4>Example</h4>
  733. *
  734. * <pre>
  735. * CssLayout group = new CssLayout();
  736. * group.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
  737. *
  738. * TextField field = new TextField();
  739. * group.addComponent(field);
  740. *
  741. * Button button = new Button(&quot;Action&quot;);
  742. * group.addComponent(button);
  743. * </pre>
  744. */
  745. public static final String LAYOUT_COMPONENT_GROUP = "v-component-group";
  746. /***************************************************************************
  747. *
  748. * Valo menu styles
  749. *
  750. **************************************************************************/
  751. /**
  752. * <p>
  753. * When you use the Valo menu and wish to enable responsive features of the
  754. * menu, you need to add this style name to the UI containing the menu.
  755. * </p>
  756. *
  757. * <p>
  758. * You only need to add this style name to the UI containing a Valo menu, if
  759. * you're using the Responsive extension with the UI.
  760. * </p>
  761. *
  762. * <h4>Example</h4>
  763. *
  764. * <p>
  765. * To enable responsivity in the Valo menu, the following example code
  766. * should be executed in your UI containing the menu.
  767. * </p>
  768. *
  769. * <pre>
  770. * Responsive.makeResponsive(this);
  771. * addStyleName(ValoTheme.UI_WITH_MENU);
  772. * </pre>
  773. */
  774. public static final String UI_WITH_MENU = "valo-menu-responsive";
  775. /**
  776. * <p>
  777. * Set the <em><b>primary</b></em> style name of a CssLayout to this, and
  778. * add any number of layouts with the {@link #MENU_PART} style inside it.
  779. * </p>
  780. *
  781. * <p>
  782. * The menu style is used to create a sidebar navigation menu for the
  783. * application, usually action as the main navigation for the different
  784. * sections of the application. It usually consists of at least a number of
  785. * {@link #MENU_ITEM}s, and possibly some {@link #MENU_SUBTITLE}s and a
  786. * {@link #MENU_TITLE}.
  787. * </p>
  788. *
  789. * <h4>Example</h4>
  790. *
  791. * <pre>
  792. * CssLayout menuArea = new CssLayout();
  793. * menuArea.setPrimaryStyleName(ValoTheme.MENU_ROOT);
  794. * </pre>
  795. */
  796. public static final String MENU_ROOT = "valo-menu";
  797. /**
  798. * Add this style name to any layout and place it inside a layout with the
  799. * {@link #MENU_ROOT} style to build a menu component. Use the additional
  800. * MENU styles for individual components inside the layout.
  801. *
  802. * <h4>Example</h4>
  803. *
  804. * <pre>
  805. * CssLayout menu = new CssLayout();
  806. * menu.addStyleName(ValoTheme.MENU_PART);
  807. * </pre>
  808. */
  809. public static final String MENU_PART = "valo-menu-part";
  810. /**
  811. * Add this style name to any layout with the {@link #MENU_PART} style name
  812. * to make any menu items inside the menu emphasize the icons more than the
  813. * captions. Useful on narrower viewport widths, since the menu width is
  814. * decreased quite dramatically, making more space for the content of the
  815. * application.
  816. *
  817. * <h4>Example</h4>
  818. *
  819. * <pre>
  820. * CssLayout menu = new CssLayout();
  821. * menu.addStyleName(ValoTheme.MENU_PART);
  822. * menu.addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
  823. * </pre>
  824. */
  825. public static final String MENU_PART_LARGE_ICONS = "large-icons";
  826. /**
  827. * <p>
  828. * Add this style name to any layout to make a header area for a menu
  829. * (intended to be placed in side a {@link #MENU_PART} layout). You can add
  830. * any components inside it, but usually you would place a Label inside.
  831. * </p>
  832. *
  833. * <p>
  834. * Any MenuBar component that you place inside this layout will match the
  835. * style of the title, allowing an easy way to add a toolbar to the title
  836. * layout.
  837. * </p>
  838. */
  839. public static final String MENU_TITLE = "valo-menu-title";
  840. /**
  841. * Set the <em><b>primary</b></em> style name of a Label or a Button to this
  842. * style name to create a section divider in a menu.
  843. */
  844. public static final String MENU_SUBTITLE = "valo-menu-subtitle";
  845. /**
  846. * <p>
  847. * Set the <em><b>primary</b></em> style name of a Button to this style name
  848. * to create a clickable menu item in the menu.
  849. * </p>
  850. *
  851. * <h4>Selected item</h4>
  852. * <p>
  853. * Add an additional style name <b><code>selected</code></b> to it to make
  854. * it the selected item in the menu.
  855. * </p>
  856. *
  857. * <h4>Example</h4>
  858. *
  859. * <pre>
  860. * Button item = new Button();
  861. * item.setPrimaryStyleName(ValoTheme.MENU_ITEM);
  862. * item.addStyleName(&quot;selected&quot;);
  863. * </pre>
  864. */
  865. public static final String MENU_ITEM = "valo-menu-item";
  866. /**
  867. * Add a SPAN element with this style name inside a {@link #MENU_SUBTITLE}
  868. * or {@link #MENU_ITEM} to add an additional badge indicator to the
  869. * subtitle/item. The Label/Button needs to allow HTML content in order to
  870. * use this style name.
  871. *
  872. * <h4>Examples</h4>
  873. *
  874. * <pre>
  875. * Button item = new Button();
  876. * item.setPrimaryStyleName(ValoTheme.MENU_ITEM);
  877. * item.setHtmlContentAllowed(true);
  878. * item.setCaption(&quot;Item Caption &lt;span class=\&quot;&quot; + ValoTheme.MENU_BADGE
  879. * + &quot;\&quot;&gt;Badge text&lt;/span&gt;&quot;);
  880. * </pre>
  881. *
  882. * <pre>
  883. * Label item = new Label();
  884. * item.setPrimaryStyleName(ValoTheme.MENU_ITEM);
  885. * item.setContentMode(ContentMode.HTML);
  886. * item.setCaption(&quot;Item Caption &lt;span class=\&quot;&quot; + ValoTheme.MENU_BADGE
  887. * + &quot;\&quot;&gt;Badge text&lt;/span&gt;&quot;);
  888. * </pre>
  889. */
  890. public static final String MENU_BADGE = "valo-menu-badge";
  891. /**
  892. * <p>
  893. * Set the <em><b>primary</b></em> style name of a Label or a Button to this
  894. * style name to create an application logo. The logo is designed to be
  895. * placed inside a {@link #MENU_PART} layout.
  896. *
  897. * <p>
  898. * The text content of the logo should be very short, since the logo area
  899. * only shows approximately three letters. Using one of the Vaadin Icons is
  900. * a good way to quickly create a logo for your application. Vaadin Icons
  901. * are included in the Valo theme.
  902. * <p>
  903. *
  904. * <h4>Example</h4>
  905. *
  906. * <pre>
  907. * Label logo = new Label(VaadinIcons.ROCKET.getHtml(), ContentMode.HTML);
  908. * logo.setSizeUndefined();
  909. * logo.setPrimaryStyleName(ValoTheme.MENU_LOGO);
  910. * </pre>
  911. */
  912. public static final String MENU_LOGO = "valo-menu-logo";
  913. /**
  914. * Add this style name to your {@link #UI_WITH_MENU responsive}
  915. * {@link #MENU_ROOT valo menu} element to make it appear automatically on
  916. * hover - without adding any code.
  917. * <p>
  918. * The menu will appear on mouse over on desktop, or when tapping on touch
  919. * devices.
  920. * <p>
  921. * <h4>Example</h4>
  922. *
  923. * <pre>
  924. * HorizontalLayout menu = new HorizontalLayout();
  925. * Responsive.makeResponsive(menu);
  926. * menu.addStyleName(ValoTheme.UI_WITH_MENU);
  927. *
  928. * CssLayout menuArea = new CssLayout();
  929. * menuArea.setPrimaryStyleName(ValoTheme.MENU_ROOT);
  930. * menuArea.addStyleName(ValoTheme.MENU_APPEAR_ON_HOVER);
  931. * menu.addComponent(menuArea);
  932. * </pre>
  933. */
  934. public static final String MENU_APPEAR_ON_HOVER = "valo-menu-hover";
  935. protected ValoTheme() {
  936. }
  937. }