1. Introduction

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

Currently supported Octicons version is 2.4.1.

Octicons is © 2012-2015 GitHub

When using the GitHub logos, be sure to follow the GitHub logo guidelines (https://github.com/logos)

Font License: SIL OFL 1.1 (http://scripts.sil.org/OFL)
Applies to all font files

Code License: MIT (http://choosealicense.com/licenses/mit/)
Applies to all other files

Griffon version: 2.3.0

2. Usage

2.1. Swing

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

2.2. JavaFX

The griffon-octicons-javafx:1.2.0 JAR provides a new Node class: griffon.javafx.support.octicons.OctIcon. 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.octicons.OctIcon?>

<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>
                <OctIcon octIcon="ZAP" iconSize="64"/>
            </graphic>
        </Button>
    </children>
</GridPane>

The JavaFX icon requires the usage of the OctIcon 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.octicons.OctIcon|zap:64

The JavaFX version for the same icon value is

griffon-app/i18n/messages.properties
org.example.AppController.action.Preferences.icon=griffon.javafx.support.octicons.OctIcon|zap: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-octicons-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-octicons-swing:1.2.0'
}
Java + JavaFX
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-octicons-javafx:1.2.0'
}
Groovy + Swing
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-octicons-swing-groovy:1.2.0'
}
Groovy + JavaFX
dependencies {
    compile 'org.codehaus.griffon.plugins:griffon-octicons-javafx-groovy:1.2.0'
}

3.2. Maven

First configure the griffon-octicons-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-octicons-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-octicons-swing</artifactId>
</dependency>
Java + JavaFX
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-octicons-javafx</artifactId>
</dependency>
Groovy + Swing
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-octicons-swing-groovy</artifactId>
</dependency>
Groovy + JavaFX
<dependency>
    <groupId>org.codehaus.griffon.plugins</groupId>
    <artifactId>griffon-octicons-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: octicons-javafx-groovy

Depends on: javafx-groovy

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

The following nodes will become available on a Groovy View

Node Type

octIcon

griffon.javafx.support.octicons.OctIcon

4.2. Swing

Module name: octicons-swing-groovy

Depends on: swing-groovy

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

The following nodes will become available on a Groovy View

Node Type

octIcon

griffon.swing.support.octicons.OctIcon

6. Icon Cheat Sheet

The following tables show all available icons.

Enum Name Icon

ALERT

alert

ALIGNMENT_ALIGN

alignment-align

ALIGNMENT_ALIGNED_TO

alignment-aligned-to

ALIGNMENT_UNALIGN

alignment-unalign

ARROW_DOWN

arrow-down

ARROW_LEFT

arrow-left

ARROW_RIGHT

arrow-right

ARROW_SMALL_DOWN

arrow-small-down

ARROW_SMALL_LEFT

arrow-small-left

ARROW_SMALL_RIGHT

arrow-small-right

ARROW_SMALL_UP

arrow-small-up

ARROW_UP

arrow-up

BEER

beer

BOOK

book

BOOKMARK

bookmark

BRIEFCASE

briefcase

BROADCAST

broadcast

BROWSER

browser

BUG

bug

CALENDAR

calendar

CHECK

check

CHECKLIST

checklist

CHEVRON_DOWN

chevron-down

CHEVRON_LEFT

chevron-left

CHEVRON_RIGHT

chevron-right

CHEVRON_UP

chevron-up

CIRCLE_SLASH

circle-slash

CIRCUIT_BOARD

circuit-board

CLIPPY

clippy

CLOCK

clock

CLOUD_DOWNLOAD

cloud-download

CLOUD_UPLOAD

cloud-upload

CODE

code

COLOR_MODE

color-mode

COMMENT

comment

COMMENT_ADD

comment-add

COMMENT_DISCUSSION

comment-discussion

CREDIT_CARD

credit-card

DASH

dash

DASHBOARD

dashboard

DATABASE

database

DEVICE_CAMERA

device-camera

DEVICE_CAMERA_VIDEO

device-camera-video

DEVICE_DESKTOP

device-desktop

DEVICE_MOBILE

device-mobile

DIFF

diff

DIFF_ADDED

diff-added

DIFF_IGNORED

diff-ignored

DIFF_MODIFIED

diff-modified

DIFF_REMOVED

diff-removed

DIFF_RENAMED

diff-renamed

ELLIPSIS

ellipsis

EYE

eye

EYE_UNWATCH

eye-unwatch

EYE_WATCH

eye-watch

FILE_ADD

file-add

FILE_BINARY

file-binary

FILE_CODE

file-code

FILE_DIRECTORY

file-directory

FILE_DIRECTORY_CREATE

file-directory-create

FILE_MEDIA

file-media

FILE_PDF

file-pdf

FILE_SUBMODULE

file-submodule

FILE_SYMLINK_DIRECTORY

file-symlink-directory

FILE_SYMLINK_FILE

file-symlink-file

FILE_TEXT

file-text

FILE_ZIP

file-zip

FLAME

flame

FOLD

fold

GEAR

gear

GIFT

gift

GIST

gist

GIST_FORK

gist-fork

GIST_NEW

gist-new

GIST_PRIVATE

gist-private

GIST_SECRET

gist-secret

GIT_BRANCH

git-branch

GIT_BRANCH_CREATE

git-branch-create

GIT_BRANCH_DELETE

git-branch-delete

GIT_COMMIT

git-commit

GIT_COMPARE

git-compare

GIT_FORK_PRIVATE

git-fork-private

GIT_MERGE

git-merge

GIT_PULL_REQUEST_ABANDONED

git-pull-request-abandoned

GIT_PULL_REQUEST

git-pull-request

GLOBE

globe

GRAPH

graph

HEART

heart

HISTORY

history

HOME

home

HORIZONTAL_RULE

horizontal-rule

HOURGLASS

hourglass

HUBOT

hubot

INBOX

inbox

INFO

info

ISSUE_CLOSED

issue-closed

ISSUE_OPENED

issue-opened

ISSUE_REOPENED

issue-reopened

JERSEY

jersey

JUMP_DOWN

jump-down

JUMP_LEFT

jump-left

JUMP_RIGHT

jump-right

JUMP_UP

jump-up

KEY

key

KEYBOARD

keyboard

LAW

law

LIGHT_BULB

light-bulb

LINK

link

LINK_EXTERNAL

link-external

LIST_ORDERED

list-ordered

LIST_UNORDERED

list-unordered

LOCATION

location

LOCK

lock

LOGO_GITHUB

logo-github

LOG_IN

log-in

LOG_OUT

log-out

MAIL

mail

MAIL_READ

mail-read

MAIL_REPLY

mail-reply

MARKDOWN

markdown

MARK_GITHUB

mark-github

MEGAPHONE

megaphone

MENTION

mention

MICROSCOPE

microscope

MILESTONE

milestone

MIRROR

mirror

MIRROR_PRIVATE

mirror-private

MIRROR_PUBLIC

mirror-public

MORTAR_BOARD

mortar-board

MOVE_DOWN

move-down

MOVE_LEFT

move-left

MOVE_RIGHT

move-right

MOVE_UP

move-up

MUTE

mute

NO_NEWLINE

no-newline

OCTOFACE

octoface

ORGANIZATION

organization

PACKAGE

package

PAINTCAN

paintcan

PENCIL

pencil

PERSON

person

PERSON_ADD

person-add

PERSON_FOLLOW

person-follow

PIN

pin

PLAYBACK_FAST_FORWARD

playback-fast-forward

PLAYBACK_PAUSE

playback-pause

PLAYBACK_PLAY

playback-play

PLAYBACK_REWIND

playback-rewind

PLUG

plug

PLUS

plus

PODIUM

podium

PRIMITIVE_DOT

primitive-dot

PRIMITIVE_SQUARE

primitive-square

PULSE

pulse

PUZZLE

puzzle

QUESTION

question

QUOTE

quote

RADIO_TOWER

radio-tower

REMOVE_CLOSE

remove-close

REPO

repo

REPO_CLONE

repo-clone

REPO_CREATE

repo-create

REPO_DELETE

repo-delete

REPO_FORCE_PUSH

repo-force-push

REPO_FORKED

repo-forked

REPO_PULL

repo-pull

REPO_PUSH

repo-push

REPO_SYNC

repo-sync

ROCKET

rocket

RSS

rss

RUBY

ruby

SCREEN_FULL

screen-full

SCREEN_NORMAL

screen-normal

SEARCH

search

SEARCH_SAVE

search-save

SERVER

server

SETTINGS

settings

SIGN_IN

sign-in

SIGN_OUT

sign-out

SPLIT

split

SQUIRREL

squirrel

STAR

star

STAR_ADD

star-add

STAR_DELETE

star-delete

STEPS

steps

STOP

stop

SYNC

sync

TAG

tag

TAG_ADD

tag-add

TAG_REMOVE

tag-remove

TELESCOPE

telescope

TERMINAL

terminal

THREE_BARS

three-bars

THUMBSDOWN

thumbsdown

THUMBSUP

thumbsup

TOOLS

tools

TRASHCAN

trashcan

TRIANGLE_DOWN

triangle-down

TRIANGLE_LEFT

triangle-left

TRIANGLE_RIGHT

triangle-right

TRIANGLE_UP

triangle-up

UNFOLD

unfold

UNMUTE

unmute

VERSIONS

versions

X

x

ZAP

zap