Package com.vaadin.client.ui
Class FontIcon
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.vaadin.client.ui.Icon
-
- com.vaadin.client.ui.FontIcon
-
- All Implemented Interfaces:
com.google.gwt.user.client.ui.HasVisibility
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
-
-
Constructor Summary
Constructors Constructor Description FontIcon()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCodepoint()
Gets the codepoint indicating which particular icon (character) within the font-family this is.String
getFontFamily()
Gets the font-family from which this icon comes.protected String
getFontStylename()
Get the font-family based stylename used to apply the font-family.String
getUri()
Gets the current URI for this icon.static boolean
isFontIconUri(String uri)
Checks whether or not the given uri is a font icon uri.void
setAlternateText(String alternateText)
Not implemeted forFontIcon
yet.protected void
setCodepoint(int codepoint)
Sets the codepoint indicating which particular icon (character) within the font-family this is.protected void
setFontFamily(String fontFamily)
Sets the font-family from which this icon comes.void
setUri(String uri)
Sets the URI for the icon.-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, sinkEvents, toString, unsinkEvents
-
-
-
-
Method Detail
-
setUri
public void setUri(String uri)
Description copied from class:Icon
Sets the URI for the icon. The URI should be run troughApplicationConnection.translateVaadinUri(String)
before setting.This might be a URL referencing a image (e.g
ImageIcon
) or a custom URI (e.gFontIcon
).
-
setAlternateText
public void setAlternateText(String alternateText)
Not implemeted forFontIcon
yet.- Specified by:
setAlternateText
in classIcon
- Parameters:
alternateText
- with the alternate text.- See Also:
Icon.setAlternateText(java.lang.String)
-
setFontFamily
protected void setFontFamily(String fontFamily)
Sets the font-family from which this icon comes. UsesetCodepoint(int)
to specify a particular icon (character) within the font.- Parameters:
fontFamily
- font-family name
-
getFontFamily
public String getFontFamily()
Gets the font-family from which this icon comes. UsegetCodepoint()
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 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(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
-
-