1. Introduction

DevIcons gives you scalable vector icons. This plugin enables toolkit specific icon support.

Currently supported DevIcons version is 1.8.0.

Devicons Font by Theodore Vorillas (@vorillas)

Griffon version: 2.3.0

2. Usage

2.1. Swing

The griffon-devicons-swing:1.2.0 JAR provides a new Icon class: griffon.swing.support.devicons.DevIcon. You may use this class with any Swing component that supports an Icon property.

2.2. JavaFX

The griffon-devicons-javafx:1.2.0 JAR provides a new Node class: griffon.javafx.support.devicons.DevIcon. You may use this class with any JavaFX control that accepts a graphic property. You may also use the icon directly as it is a subclass of javafx.scene.control.Label. The icon class can be used inside an FXML file too.

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.GridPane?>
<?import griffon.javafx.support.devicons.DevIcon?>

<GridPane prefHeight="60.0" prefWidth="200.0"
          xmlns:fx="http://javafx.com/fxml"
          fx:controller="org.example.AppController">
    <children>
        <Button fx:id="preferencesActionTarget"
                GridPane.columnIndex="0" GridPane.rowIndex="0"
                mnemonicParsing="false"
                prefWidth="200.0">
            <graphic>
                <DevIcon devIcon="JAVA" iconSize="64"/>
            </graphic>
        </Button>
    </children>
</GridPane>

The JavaFX icon requires the usage of the DevIcon enum value.

2.3. Action Resources

Action icons can be set using resources files if the following format is used:

iconClassName|name:size:color

size and color are optional.

Here’s an example using the Swing icon

griffon-app/i18n/messages.properties
org.example.AppController.action.Preferences.small_icon=griffon.swing.support.devicons.DevIcon|java:64

The JavaFX version for the same icon value is

griffon-app/i18n/messages.properties
org.example.AppController.action.Preferences.icon=griffon.javafx.support.devicons.DevIcon|java:64

3. Configuration

The plugin delivers artifacts for both Swing and JavaFX. It also contains Groovy enhancements that can be used in combination with the respective UI toolkit DSL (SwingBuilder and GroovyFX).

3.1. Gradle

You have two options for configuring this plugin: automatic and manual.

3.1.1. Automatic

As long as the project has the org.codehaus.griffon.griffon plugin applied to it you may include the following snippet in build.gradle

dependencies {
    griffon 'org.codehaus.griffon.plugins:griffon-devicons-plugin:1.2.0'
}

The griffon plugin will take care of the rest given its configuration.

3.1.2. Manual

You will need to configure any of the following blocks depending on your setup

Java + Swing
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-devicons-swing:1.2.0'
}
Java + JavaFX
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-devicons-javafx:1.2.0'
}
Groovy + Swing
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-devicons-swing-groovy:1.2.0'
}
Groovy + JavaFX
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-devicons-javafx-groovy:1.2.0'
}

3.2. Maven

First configure the griffon-devicons-plugin BOM in your POM file, by placing the following snippet before the <build> element

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.griffon.plugins</groupId>
            <artifactId>griffon-devicons-plugin</artifactId>
            <version>1.2.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Next configure dependencies as required by your particular setup

Java + Swing
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-devicons-swing</artifactId>
</dependency>
Java + JavaFX
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-devicons-javafx</artifactId>
</dependency>
Groovy + Swing
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-devicons-swing-groovy</artifactId>
</dependency>
Groovy + JavaFX
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-devicons-javafx-groovy</artifactId>
</dependency>

4. Modules

The following sections display all bindings per module. Use this information to successfully override a binding on your own modules or to troubleshoot a module binding if the wrong type has been applied by the Griffon runtime.

4.1. JavaFX

Module name: devicons-javafx-groovy

Depends on: javafx-groovy

bind(BuilderCustomizer.class)
    .to(DevIconsJavaFXBuilderCustomizer.class)
    .asSingleton();

The following nodes will become available on a Groovy View

Node Type

devIcon

griffon.javafx.support.devicons.DevIcon

4.2. Swing

Module name: devicons-swing-groovy

Depends on: swing-groovy

bind(BuilderCustomizer.class)
    .to(DevIconsSwingBuilderCustomizer.class)
    .asSingleton();

The following nodes will become available on a Groovy View

Node Type

devIcon

griffon.swing.support.devicons.DevIcon

6. Icon Cheat Sheet

The following tables show all available icons.

Enum Name Icon

ANDROID

android

ANGULAR

angular

APPCELERATOR

appcelerator

APPLE

apple

APPSTORE

appstore

APTANA

aptana

ASTERISK

asterisk

ATLASSIAN

atlassian

ATOM

atom

AWS

aws

BACKBONE

backbone

BING_SMALL

bing_small

BINTRAY

bintray

BITBUCKET

bitbucket

BLACKBERRY

blackberry

BOOTSTRAP

bootstrap

BOWER

bower

BRACKETS

brackets

BUGSENSE

bugsense

CELLULOID

celluloid

CHROME

chrome

CISCO

cisco

CLOJURE

clojure

CLOJURE_ALT

clojure_alt

CLOUD9

cloud9

CODA

coda

CODE

code

CODEIGNITER

codeigniter

CODEPEN

codepen

CODE_BADGE

code_badge

CODROPS

codrops

COFFEESCRIPT

coffeescript

COMPASS

compass

COMPOSER

composer

CREATIVECOMMONS

creativecommons

CREATIVECOMMONS_BADGE

creativecommons_badge

CSS3

css3

CSS3_FULL

css3_full

CSSDECK

cssdeck

CSS_TRICKS

css_tricks

DART

dart

DATABASE

database

DEBIAN

debian

DIGITAL_OCEAN

digital-ocean

DJANGO

django

DLANG

dlang

DOCKER

docker

DOCTRINE

doctrine

DOJO

dojo

DOTNET

dotnet

DREAMWEAVER

dreamweaver

DROPBOX

dropbox

DRUPAL

drupal

ECLIPSE

eclipse

EMBER

ember

ENVATO

envato

ERLANG

erlang

EXTJS

extjs

FIREBASE

firebase

FIREFOX

firefox

FSHARP

fsharp

GHOST

ghost

GHOST_SMALL

ghost_small

GIT

git

GITHUB

github

GITHUB_ALT

github_alt

GITHUB_BADGE

github_badge

GITHUB_FULL

github_full

GIT_BRANCH

git_branch

GIT_COMMIT

git_commit

GIT_COMPARE

git_compare

GIT_MERGE

git_merge

GIT_PULL_REQUEST

git_pull_request

GNU

gnu

GO

go

GOOGLE_ANALYTICS

google_analytics

GOOGLE_CLOUD_PLATFORM

google-cloud-platform

GOOGLE_DRIVE

google_drive

GRAILS

grails

GROOVY

groovy

GRUNT

grunt

GULP

gulp

HACKERNEWS

hackernews

HASKELL

haskell

HEROKU

heroku

HTML5

html5

HTML5_3D_EFFECTS

html5_3d_effects

HTML5_CONNECTIVITY

html5_connectivity

HTML5_DEVICE_ACCESS

html5_device_access

HTML5_MULTIMEDIA

html5_multimedia

IE

ie

ILLUSTRATOR

illustrator

INTELLIJ

intellij

IONIC

ionic

JAVA

java

JAVASCRIPT

javascript

JAVASCRIPT_BADGE

javascript_badge

JAVASCRIPT_SHIELD

javascript_shield

JEKYLL_SMALL

jekyll_small

JENKINS

jenkins

JIRA

jira

JOOMLA

joomla

JQUERY

jquery

JQUERY_UI

jquery_ui

KOMODO

komodo

KRAKENJS

krakenjs

KRAKENJS_BADGE

krakenjs_badge

LARAVEL

laravel

LESS

less

LINUX

linux

MAGENTO

magento

MAILCHIMP

mailchimp

MARKDOWN

markdown

MATERIALIZECSS

materializecss

METEOR

meteor

METEORFULL

meteorfull

MITLICENCE

mitlicence

MODERNIZR

modernizr

MONGODB

mongodb

MOOTOOLS

mootools

MOOTOOLS_BADGE

mootools_badge

MOZILLA

mozilla

MSQL_SERVER

msql_server

MYSQL

mysql

NANCY

nancy

NETBEANS

netbeans

NETMAGAZINE

netmagazine

NGINX

nginx

NODEJS

nodejs

NODEJS_SMALL

nodejs_small

NPM

npm

ONEDRIVE

onedrive

OPENSHIFT

openshift

OPENSOURCE

opensource

OPERA

opera

PERL

perl

PHONEGAP

phonegap

PHOTOSHOP

photoshop

PHP

php

POSTGRESQL

postgresql

PROLOG

prolog

PYTHON

python

RACKSPACE

rackspace

RAPHAEL

raphael

RASPBERRY_PI

raspberry_pi

REACT

react

REDHAT

redhat

REDIS

redis

REQUIREJS

requirejs

RESPONSIVE

responsive

RUBY

ruby

RUBY_ON_RAILS

ruby_on_rails

RUBY_ROUGH

ruby_rough

RUST

rust

SAFARI

safari

SASS

sass

SCALA

scala

SCRIPTCS

scriptcs

SCRUM

scrum

SENCHATOUCH

senchatouch

SIZZLEJS

sizzlejs

SMASHING_MAGAZINE

smashing_magazine

SNAP_SVG

snap_svg

SQLLITE

sqllite

STACKOVERFLOW

stackoverflow

STREAMLINE

streamline

STYLUS

stylus

SWIFT

swift

SYMFONY

symfony

SYMFONY_BADGE

symfony_badge

TECHCRUNCH

techcrunch

TERMINAL

terminal

TERMINAL_BADGE

terminal_badge

TRAVIS

travis

TRELLO

trello

TYPO3

typo3

UBUNTU

ubuntu

UIKIT

uikit

UNITY_SMALL

unity_small

VIM

vim

VISUALSTUDIO

visualstudio

W3C

w3c

WEBPLATFORM

webplatform

WINDOWS

windows

WORDPRESS

wordpress

YAHOO

yahoo

YAHOO_SMALL

yahoo_small

YEOMAN

yeoman

YII

yii

ZEND

zend