Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

FontIcon.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.server;
  17. import com.vaadin.shared.ui.ContentMode;
  18. import com.vaadin.ui.Label;
  19. /**
  20. * A font icon is a type of icon that is made by displaying one character from a
  21. * specially constructed font containing icons ("icon font").
  22. * <p>
  23. * {@link FontIcon} is a custom resource type which uses the URI scheme
  24. * <code>fonticon://&lt;fontfamily&gt;/&lt;codepoint&gt;</code> to reference a
  25. * specific icon from a specific icon font. <br/>
  26. * </p>
  27. *
  28. * @since 7.2
  29. * @author Vaadin Ltd
  30. */
  31. public interface FontIcon extends Resource {
  32. /**
  33. * Returns the name (font family) of the font from which this icon comes.
  34. * The name is used to apply the correct font where the icon is used.
  35. *
  36. * @since 7.2
  37. * @return
  38. */
  39. public String getFontFamily();
  40. /**
  41. * Returns the unicode codepoint (character location) for this icon within
  42. * the font given in {@link #getFontFamily()}.
  43. * <p>
  44. * For example, 0x0021 would in a regular font be the codepoint for the
  45. * exclamation-point character.<br/>
  46. * When constructing icon fonts, it might be a good idea to use the
  47. * codepoints in the "Private use area", from 0xE000 0xF8FF.
  48. * </p>
  49. *
  50. * @since 7.2
  51. * @return
  52. */
  53. public int getCodepoint();
  54. /**
  55. * Returns HTML that can be used to display the icon in places where HTML
  56. * can be used, such as a {@link Label} with {@link ContentMode#HTML}.
  57. *
  58. *
  59. * @since 7.2
  60. * @return HTML needed to display icon
  61. */
  62. public String getHtml();
  63. }