Using ‘Font Awesome’ Icons with JavaFX [Update 1]

Refer for latest updates here.

I have revisited the code and made some improvements:

Get the complete source code here:
https://bitbucket.org/Jerady/fontawesomefx

Now using WebJar Maven-Repo instead of “/font/awesome.ttf”

<dependency>
	<groupId>org.webjars</groupId>
	<artifactId>font-awesome</artifactId>
	<version>3.0.0</version>
</dependency>

Absolute Path to Awesome Font is now

/META-INF/resources/webjars/font-awesome/3.0.0/font/fontawesome-webfont.ttf

AwesomeIcons class is now an Character-Enum instead of static Strings mappings

public enum AwesomeIcons
{

    ICON_GLASS('\uf000'),
    ICON_MUSIC('\uf001'),
    ICON_SEARCH('\uf002'),
    ICON_ENVELOPE('\uf003'),
    ICON_HEART('\uf004'),
    ICON_STAR('\uf005'),
    ICON_STAR_EMPTY('\uf006'),
    ICON_USER('\uf007'),
    ICON_FILM('\uf008'),
    ICON_TH_LARGE('\uf009'),
    ICON_TH('\uf00a'),
    ICON_TH_LIST('\uf00b'),
    ICON_OK('\uf00c'),
    ICON_REMOVE('\uf00d'),
    ICON_ZOOM_IN('\uf00e'),
    ICON_ZOOM_OUT('\uf010'),
    ICON_OFF('\uf011'),
    ICON_SIGNAL('\uf012'),
    ICON_COG('\uf013'),
    ICON_TRASH('\uf014'),
    ICON_HOME('\uf015'),
    ICON_FILE('\uf016'),
    ICON_TIME('\uf017'),
    ICON_ROAD('\uf018'),
    ICON_DOWNLOAD_ALT('\uf019'),
    ICON_DOWNLOAD('\uf01a'),
    ICON_UPLOAD('\uf01b'),
    ICON_INBOX('\uf01c'),
    ICON_PLAY_CIRCLE('\uf01d'),
    ICON_REPEAT('\uf01e'),
    ICON_REFRESH('\uf021'),
    ICON_LIST_ALT('\uf022'),
    ICON_LOCK('\uf023'),
    ICON_FLAG('\uf024'),
    ICON_HEADPHONES('\uf025'),
    ICON_VOLUME_OFF('\uf026'),
    ICON_VOLUME_DOWN('\uf027'),
    ICON_VOLUME_UP('\uf028'),
    ICON_QRCODE('\uf029'),
    ICON_BARCODE('\uf02a'),
    ICON_TAG('\uf02b'),
    ICON_TAGS('\uf02c'),
    ICON_BOOK('\uf02d'),
    ICON_BOOKMARK('\uf02e'),
    ICON_PRINT('\uf02f'),
    ICON_CAMERA('\uf030'),
    ICON_FONT('\uf031'),
    ICON_BOLD('\uf032'),
    ICON_ITALIC('\uf033'),
    ICON_TEXT_HEIGHT('\uf034'),
    ICON_TEXT_WIDTH('\uf035'),
    ICON_ALIGN_LEFT('\uf036'),
    ICON_ALIGN_CENTER('\uf037'),
    ICON_ALIGN_RIGHT('\uf038'),
    ICON_ALIGN_JUSTIFY('\uf039'),
    ICON_LIST('\uf03a'),
    ICON_INDENT_LEFT('\uf03b'),
    ICON_INDENT_RIGHT('\uf03c'),
    ICON_FACETIME_VIDEO('\uf03d'),
    ICON_PICTURE('\uf03e'),
    ICON_PENCIL('\uf040'),
    ICON_MAP_MARKER('\uf041'),
    ICON_ADJUST('\uf042'),
    ICON_TINT('\uf043'),
    ICON_EDIT('\uf044'),
    ICON_SHARE('\uf045'),
    ICON_CHECK('\uf046'),
    ICON_MOVE('\uf047'),
    ICON_STEP_BACKWARD('\uf048'),
    ICON_FAST_BACKWARD('\uf049'),
    ICON_BACKWARD('\uf04a'),
    ICON_PLAY('\uf04b'),
    ICON_PAUSE('\uf04c'),
    ICON_STOP('\uf04d'),
    ICON_FORWARD('\uf04e'),
    ICON_FAST_FORWARD('\uf050'),
    ICON_STEP_FORWARD('\uf051'),
    ICON_EJECT('\uf052'),
    ICON_CHEVRON_LEFT('\uf053'),
    ICON_CHEVRON_RIGHT('\uf054'),
    ICON_PLUS_SIGN('\uf055'),
    ICON_MINUS_SIGN('\uf056'),
    ICON_REMOVE_SIGN('\uf057'),
    ICON_OK_SIGN('\uf058'),
    ICON_QUESTION_SIGN('\uf059'),
    ICON_INFO_SIGN('\uf05a'),
    ICON_SCREENSHOT('\uf05b'),
    ICON_REMOVE_CIRCLE('\uf05c'),
    ICON_OK_CIRCLE('\uf05d'),
    ICON_BAN_CIRCLE('\uf05e'),
    ICON_ARROW_LEFT('\uf060'),
    ICON_ARROW_RIGHT('\uf061'),
    ICON_ARROW_UP('\uf062'),
    ICON_ARROW_DOWN('\uf063'),
    ICON_SHARE_ALT('\uf064'),
    ICON_RESIZE_FULL('\uf065'),
    ICON_RESIZE_SMALL('\uf066'),
    ICON_PLUS('\uf067'),
    ICON_MINUS('\uf068'),
    ICON_ASTERISK('\uf069'),
    ICON_EXCLAMATION_SIGN('\uf06a'),
    ICON_GIFT('\uf06b'),
    ICON_LEAF('\uf06c'),
    ICON_FIRE('\uf06d'),
    ICON_EYE_OPEN('\uf06e'),
    ICON_EYE_CLOSE('\uf070'),
    ICON_WARNING_SIGN('\uf071'),
    ICON_PLANE('\uf072'),
    ICON_CALENDAR('\uf073'),
    ICON_RANDOM('\uf074'),
    ICON_COMMENT('\uf075'),
    ICON_MAGNET('\uf076'),
    ICON_CHEVRON_UP('\uf077'),
    ICON_CHEVRON_DOWN('\uf078'),
    ICON_RETWEET('\uf079'),
    ICON_SHOPPING_CART('\uf07a'),
    ICON_FOLDER_CLOSE('\uf07b'),
    ICON_FOLDER_OPEN('\uf07c'),
    ICON_RESIZE_VERTICAL('\uf07d'),
    ICON_RESIZE_HORIZONTAL('\uf07e'),
    ICON_BAR_CHART('\uf080'),
    ICON_TWITTER_SIGN('\uf081'),
    ICON_FACEBOOK_SIGN('\uf082'),
    ICON_CAMERA_RETRO('\uf083'),
    ICON_KEY('\uf084'),
    ICON_COGS('\uf085'),
    ICON_COMMENTS('\uf086'),
    ICON_THUMBS_UP('\uf087'),
    ICON_THUMBS_DOWN('\uf088'),
    ICON_STAR_HALF('\uf089'),
    ICON_HEART_EMPTY('\uf08a'),
    ICON_SIGNOUT('\uf08b'),
    ICON_LINKEDIN_SIGN('\uf08c'),
    ICON_PUSHPIN('\uf08d'),
    ICON_EXTERNAL_LINK('\uf08e'),
    ICON_SIGNIN('\uf090'),
    ICON_TROPHY('\uf091'),
    ICON_GITHUB_SIGN('\uf092'),
    ICON_UPLOAD_ALT('\uf093'),
    ICON_LEMON('\uf094'),
    ICON_PHONE('\uf095'),
    ICON_CHECK_EMPTY('\uf096'),
    ICON_BOOKMARK_EMPTY('\uf097'),
    ICON_PHONE_SIGN('\uf098'),
    ICON_TWITTER('\uf099'),
    ICON_FACEBOOK('\uf09a'),
    ICON_GITHUB('\uf09b'),
    ICON_UNLOCK('\uf09c'),
    ICON_CREDIT_CARD('\uf09d'),
    ICON_RSS('\uf09e'),
    ICON_HDD('\uf0a0'),
    ICON_BULLHORN('\uf0a1'),
    ICON_BELL('\uf0a2'),
    ICON_CERTIFICATE('\uf0a3'),
    ICON_HAND_RIGHT('\uf0a4'),
    ICON_HAND_LEFT('\uf0a5'),
    ICON_HAND_UP('\uf0a6'),
    ICON_HAND_DOWN('\uf0a7'),
    ICON_CIRCLE_ARROW_LEFT('\uf0a8'),
    ICON_CIRCLE_ARROW_RIGHT('\uf0a9'),
    ICON_CIRCLE_ARROW_UP('\uf0aa'),
    ICON_CIRCLE_ARROW_DOWN('\uf0ab'),
    ICON_GLOBE('\uf0ac'),
    ICON_WRENCH('\uf0ad'),
    ICON_TASKS('\uf0ae'),
    ICON_FILTER('\uf0b0'),
    ICON_BRIEFCASE('\uf0b1'),
    ICON_FULLSCREEN('\uf0b2'),
    ICON_GROUP('\uf0c0'),
    ICON_LINK('\uf0c1'),
    ICON_CLOUD('\uf0c2'),
    ICON_BEAKER('\uf0c3'),
    ICON_CUT('\uf0c4'),
    ICON_COPY('\uf0c5'),
    ICON_PAPER_CLIP('\uf0c6'),
    ICON_SAVE('\uf0c7'),
    ICON_SIGN_BLANK('\uf0c8'),
    ICON_REORDER('\uf0c9'),
    ICON_LIST_UL('\uf0ca'),
    ICON_LIST_OL('\uf0cb'),
    ICON_STRIKETHROUGH('\uf0cc'),
    ICON_UNDERLINE('\uf0cd'),
    ICON_TABLE('\uf0ce'),
    ICON_MAGIC('\uf0d0'),
    ICON_TRUCK('\uf0d1'),
    ICON_PINTEREST('\uf0d2'),
    ICON_PINTEREST_SIGN('\uf0d3'),
    ICON_GOOGLE_PLUS_SIGN('\uf0d4'),
    ICON_GOOGLE_PLUS('\uf0d5'),
    ICON_MONEY('\uf0d6'),
    ICON_CARET_DOWN('\uf0d7'),
    ICON_CARET_UP('\uf0d8'),
    ICON_CARET_LEFT('\uf0d9'),
    ICON_CARET_RIGHT('\uf0da'),
    ICON_COLUMNS('\uf0db'),
    ICON_SORT('\uf0dc'),
    ICON_SORT_DOWN('\uf0dd'),
    ICON_SORT_UP('\uf0de'),
    ICON_ENVELOPE_ALT('\uf0e0'),
    ICON_LINKEDIN('\uf0e1'),
    ICON_UNDO('\uf0e2'),
    ICON_LEGAL('\uf0e3'),
    ICON_DASHBOARD('\uf0e4'),
    ICON_COMMENT_ALT('\uf0e5'),
    ICON_COMMENTS_ALT('\uf0e6'),
    ICON_BOLT('\uf0e7'),
    ICON_SITEMAP('\uf0e8'),
    ICON_UMBRELLA('\uf0e9'),
    ICON_PASTE('\uf0ea'),
    ICON_LIGHTBULB('\uf0eb'),
    ICON_EXCHANGE('\uf0ec'),
    ICON_CLOUD_DOWNLOAD('\uf0ed'),
    ICON_CLOUD_UPLOAD('\uf0ee'),
    ICON_USER_MD('\uf0f0'),
    ICON_STETHOSCOPE('\uf0f1'),
    ICON_SUITCASE('\uf0f2'),
    ICON_BELL_ALT('\uf0f3'),
    ICON_COFFEE('\uf0f4'),
    ICON_FOOD('\uf0f5'),
    ICON_FILE_ALT('\uf0f6'),
    ICON_BUILDING('\uf0f7'),
    ICON_HOSPITAL('\uf0f8'),
    ICON_AMBULANCE('\uf0f9'),
    ICON_MEDKIT('\uf0fa'),
    ICON_FIGHTER_JET('\uf0fb'),
    ICON_BEER('\uf0fc'),
    ICON_H_SIGN('\uf0fd'),
    ICON_PLUS_SIGN_ALT('\uf0fe'),
    ICON_DOUBLE_ANGLE_LEFT('\uf100'),
    ICON_DOUBLE_ANGLE_RIGHT('\uf101'),
    ICON_DOUBLE_ANGLE_UP('\uf102'),
    ICON_DOUBLE_ANGLE_DOWN('\uf103'),
    ICON_ANGLE_LEFT('\uf104'),
    ICON_ANGLE_RIGHT('\uf105'),
    ICON_ANGLE_UP('\uf106'),
    ICON_ANGLE_DOWN('\uf107'),
    ICON_DESKTOP('\uf108'),
    ICON_LAPTOP('\uf109'),
    ICON_TABLET('\uf10a'),
    ICON_MOBILE_PHONE('\uf10b'),
    ICON_CIRCLE_BLANK('\uf10c'),
    ICON_QUOTE_LEFT('\uf10d'),
    ICON_QUOTE_RIGHT('\uf10e'),
    ICON_SPINNER('\uf110'),
    ICON_CIRCLE('\uf111'),
    ICON_REPLY('\uf112'),
    ICON_GITHUB_ALT('\uf113'),
    ICON_FOLDER_CLOSE_ALT('\uf114'),
    ICON_FOLDER_OPEN_ALT('\uf115');
    private final Character character;

    private AwesomeIcons(Character character)
    {
        this.character = character;
    }

    public Character character()
    {
        return character;
    }

    @Override
    public String toString()
    {
        return character.toString();
    }
}

Comments are closed.