Class WIcon
- java.lang.Object
-
public class WIcon extends WInteractWidget
A widget that represents a Font-Aweswome icon.By default, JWt will load the default Font-Awesome included with it. This is version 4.3.0. For a list of all icons, visit: https://fontawesome.com/v4/icons/
- See Also:
setName(String name)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Field Summary
-
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_, noDefault
-
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS
-
-
Constructor Summary
Constructors Constructor Description WIcon()Creates an empty icon.WIcon(WContainerWidget parentContainer)Creates an empty icon.WIcon(java.lang.String name)Creates an icon with the given name.WIcon(java.lang.String name, WContainerWidget parentContainer)Creates an icon with the given name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Returns the icon name.doublegetSize()Returns the icon size.static voidloadIconFont()Loads the Font-Aweswome css style sheet.voidsetName(java.lang.String name)Set the icon name.voidsetSize(double factor)Changes the icon's size.-
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, remove, render, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
-
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, enableAjax, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getDomChanges, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, hideToolTip, isCanReceiveFocus, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, refresh, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
-
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, applyThemeStyles, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
-
Methods inherited from class eu.webtoolkit.jwt.WObject
getObjectName, setFormData
-
-
-
-
Constructor Detail
-
WIcon
public WIcon(WContainerWidget parentContainer)
Creates an empty icon.
-
WIcon
public WIcon()
Creates an empty icon.
-
WIcon
public WIcon(java.lang.String name, WContainerWidget parentContainer)Creates an icon with the given name.- See Also:
setName(String name)
-
WIcon
public WIcon(java.lang.String name)
Creates an icon with the given name.
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Set the icon name.This sets the name of the icon. The name should be a the name of a Font-Aweswome icon, without the
fa-prefix.Usage example: The "play" icon: https://fontawesome.com/v4/icon/play can be included with:
WApplication app = WApplication.getInstance(); app.getRoot().addWidget(new WIcon("play"));Note: The name can be followed by sizing information separated by a space if the Font Aweswome version used allows it. E.g.
"play fa-4"
-
getName
public java.lang.String getName()
Returns the icon name.- See Also:
setName(String name)
-
setSize
public void setSize(double factor)
Changes the icon's size.Note: This is done in CSS, not using the
fa-{size}method.
-
getSize
public double getSize()
Returns the icon size.- See Also:
setSize(double factor)
-
loadIconFont
public static void loadIconFont()
Loads the Font-Aweswome css style sheet.This is a convenience function that adds Font-Aweswome's CSS style sheet to the list of used style sheets.
By default this will load the stylesheet present at:
resources/font-awesome/css/font-awesome.min.cssTheresourcesdirectory can be set with a command-line option, namely–resources-dir, see Wt's configuration options.Note: This is automatically called when needed by
WIcon.
-
-