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 35KB

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