com.vaadin.client.ui
Class FontIcon

java.lang.Object
  extended by UIObject
      extended by com.vaadin.client.ui.Icon
          extended by com.vaadin.client.ui.FontIcon

public class FontIcon
extends Icon

A font-based icon implementation.

The icon represents a specific character (identified by codepoint, getCodepoint(), setCodepoint(int)) within a specific font (identified by font-family, getFontFamily(), setFontFamily(String)).

Since:
7.2
Author:
Vaadin Ltd

Field Summary
 
Fields inherited from class com.vaadin.client.ui.Icon
CLASSNAME
 
Constructor Summary
FontIcon()
           
 
Method Summary
 int getCodepoint()
          Gets the codepoint indicating which particular icon (character) within the font-family this is.
 java.lang.String getFontFamily()
          Gets the font-family from which this icon comes.
protected  java.lang.String getFontStylename()
          Get the font-family based stylename used to apply the font-family.
 java.lang.String getUri()
          Gets the current URI for this icon.
static boolean isFontIconUri(java.lang.String uri)
          Checks whether or not the given uri is a font icon uri.
 void setAlternateText(java.lang.String alternateText)
          Not implemeted for FontIcon yet.
protected  void setCodepoint(int codepoint)
          Sets the codepoint indicating which particular icon (character) within the font-family this is.
protected  void setFontFamily(java.lang.String fontFamily)
          Sets the font-family from which this icon comes.
 void setUri(java.lang.String uri)
          Sets the URI for the icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontIcon

public FontIcon()
Method Detail

setUri

public void setUri(java.lang.String uri)
Description copied from class: Icon
Sets the URI for the icon. The URI should be run trough ApplicationConnection.translateVaadinUri(String) before setting.

This might be a URL referencing a image (e.g ImageIcon) or a custom URI (e.g FontIcon).

Specified by:
setUri in class Icon
Parameters:
uri - the URI for this icon

setAlternateText

public void setAlternateText(java.lang.String alternateText)
Not implemeted for FontIcon yet.

Specified by:
setAlternateText in class Icon
Parameters:
alternateText - with the alternate text.
See Also:
Icon.setAlternateText(java.lang.String)

setFontFamily

protected void setFontFamily(java.lang.String fontFamily)
Sets the font-family from which this icon comes. Use setCodepoint(int) to specify a particular icon (character) within the font.

Parameters:
fontFamily - font-family name

getFontFamily

public java.lang.String getFontFamily()
Gets the font-family from which this icon comes. Use getCodepoint() to find out which particular icon (character) within the font this is.

Returns:
font-family name

setCodepoint

protected void setCodepoint(int codepoint)
Sets the codepoint indicating which particular icon (character) within the font-family this is.

Parameters:
codepoint -

getCodepoint

public int getCodepoint()
Gets the codepoint indicating which particular icon (character) within the font-family this is.

Returns:

getFontStylename

protected java.lang.String getFontStylename()
Get the font-family based stylename used to apply the font-family.

Returns:
stylename used to apply font-family
Since:
7.2

isFontIconUri

public static boolean isFontIconUri(java.lang.String uri)
Checks whether or not the given uri is a font icon uri. Does not check whether or not the font icon is available and can be rendered.

Parameters:
uri -
Returns:
true if it's a fonticon uri
Since:
7.2

getUri

public java.lang.String getUri()
Description copied from class: Icon
Gets the current URI for this icon.

Specified by:
getUri in class Icon
Returns:
URI in use


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.