1. Introduction
Provides a shortcut for adding flag icons for all counties listed at Wikipedia’s ISO_3166-1_alpha-2 country codes. Icons based on Mark Jame’s FamFamFam Flag Icons.
Country names are i18n aware. The default language is English, there are no additional language versions.
Provide a suitable griffon.plugins.flagicons.countrynames_<locale>.properties
file for your Locale if
you wish to use a different translation for a Country name.
Missing flags
The following country codes have no flags assigned to them because the Flag icon collection does not provide one.
-
AQ - Antartica
-
GG - Guernsey
-
IM - Isle of Man
-
JE - Jersey
Non-standard country names
This plugin assigns the following non standard country names to some additional flags found in the Flag icon set. Be warned that these country codes are not sanctioned by ISO 3166-1 alpha-2.
-
CT - Catalonia
-
EN - England
-
EU - European Union
-
WL - Wales
-
XL - Scotland
Griffon version: 2.2.0
2. Usage
2.1. Swing
The griffon-flag-swing:1.1.0
JAR provides a new Icon class: griffon.swing.support.flagicons.FlagIcon
.
You may use this class with any Swing component that supports an Icon property.
2.2. JavaFX
The griffon-flag-javafx:1.1.0
JAR provides a new Node class: griffon.javafx.support.flagicons.FlagIcon
.
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
.
2.3. Action Resources
Action icons can be set using resources files if the following format is used:
iconClassName|code
Here’s an example using the Swing icon
org.example.AppController.action.Preferences.icon=griffon.swing.support.flag.FlagIcon|ch
The JavaFX version for the same icon value is
org.example.AppController.action.Preferences.icon=griffon.javafx.support.flag.FlagIcon|ch
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-flagicons-plugin:1.1.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
dependencies {
compile 'org.codehaus.griffon.plugins:griffon-flagicons-swing:1.1.0'
}
dependencies {
compile 'org.codehaus.griffon.plugins:griffon-flagicons-javafx:1.1.0'
}
dependencies {
compile 'org.codehaus.griffon.plugins:griffon-flagicons-swing-groovy:1.1.0'
}
dependencies {
compile 'org.codehaus.griffon.plugins:griffon-flagicons-javafx-groovy:1.1.0'
}
3.2. Maven
First configure the griffon-flagicons-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-flagicons-plugin</artifactId>
<version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Next configure dependencies as required by your particular setup
<dependency>
<groupId>org.codehaus.griffon.plugins</groupId>
<artifactId>griffon-flagicons-swing</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.griffon.plugins</groupId>
<artifactId>griffon-flagicons-javafx</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.griffon.plugins</groupId>
<artifactId>griffon-flagicons-swing-groovy</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.griffon.plugins</groupId>
<artifactId>griffon-flagicons-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: flagicons-javafx-groovy
Depends on: javafx-groovy
bind(BuilderCustomizer.class)
.to(FlagIconsJavaFXBuilderCustomizer.class)
.asSingleton();
The following nodes will become available on a Groovy View
Node | Type |
---|---|
flagIcon |
6. Icon Cheat Sheet
The following table shows all available icons.
Country | Code | Flag |
---|---|---|
Andorra |
AD |
|
United Arab Emirates |
AE |
|
Afghanistan |
AF |
|
Antigua and Barbuda |
AG |
|
Anguilla |
AI |
|
Albania |
AL |
|
Armenia |
AM |
|
Netherlands Antilles |
AN |
|
Angola |
AO |
|
Antarctica |
AQ |
|
Argentina |
AR |
|
American Samoa |
AS |
|
Austria |
AT |
|
Australia |
AU |
|
Aruba |
AW |
|
Aland Islands |
AX |
|
Azerbaijan |
AZ |
|
Bosnia and Herzegovina |
BA |
|
Barbados |
BB |
|
Bangladesh |
BD |
|
Belgium |
BE |
|
Burkina Faso |
BF |
|
Bulgaria |
BG |
|
Bahrain |
BH |
|
Burundi |
BI |
|
Benin |
BJ |
|
Saint Barthelemy |
BL |
|
Bermuda |
BM |
|
Brunei Darussalam |
BN |
|
Bolivia |
BO |
|
Brazil |
BR |
|
Bahamas |
BS |
|
Bhutan |
BT |
|
Bouvet Island |
BV |
|
Botswana |
BW |
|
Belarus |
BY |
|
Belize |
BZ |
|
Canada |
CA |
|
Cocos (Keeling) Islands |
CC |
|
Democratic Republic of the Congo |
CD |
|
Central African Republic |
CF |
|
Congo |
CG |
|
Switzerland |
CH |
|
Cote d’Ivoire |
CI |
|
Cook Islands |
CK |
|
Chile |
CL |
|
Cameroon |
CM |
|
China |
CN |
|
Colombia |
CO |
|
Costa Rica |
CR |
|
Catalonia |
CT |
|
Cuba |
CU |
|
Cape Verde |
CV |
|
Christmas Island |
CX |
|
Cyprus |
CY |
|
Czech Republic |
CZ |
|
Germany |
DE |
|
Djibouti |
DJ |
|
Denmark |
DK |
|
Dominica |
DM |
|
Dominican Republic |
DO |
|
Algeria |
DZ |
|
Ecuador |
EC |
|
Estonia |
EE |
|
Egypt |
EG |
|
Western Sahara |
EH |
|
England |
EN |
|
Eritrea |
ER |
|
Spain |
ES |
|
Ethiopia |
ET |
|
European Union |
EU |
|
Finland |
FI |
|
Fiji |
FJ |
|
Falkland Islands (Malvinas) |
FK |
|
Federated States of Micronesia |
FM |
|
Faroe Islands |
FO |
|
France |
FR |
|
Gabon |
GA |
|
United Kingdom |
GB |
|
Grenada |
GD |
|
Georgia |
GE |
|
French Guiana |
GF |
|
Guernsey |
GG |
|
Ghana |
GH |
|
Gibraltar |
GI |
|
Greenland |
GL |
|
Gambia |
GM |
|
Guinea |
GN |
|
Guadeloupe |
GP |
|
Equatorial Guinea |
GQ |
|
Greece |
GR |
|
South Georgia and the South Sandwich Islands |
GS |
|
Guatemala |
GT |
|
Guam |
GU |
|
Guinea-Bissau |
GW |
|
Guyana |
GY |
|
Hong Kong |
HK |
|
Heard Island and McDonald Islands |
HM |
|
Honduras |
HN |
|
Croatia |
HR |
|
Haiti |
HT |
|
Hungary |
HU |
|
Indonesia |
ID |
|
Ireland |
IE |
|
Israel |
IL |
|
Isle of Man |
IM |
|
India |
IN |
|
British Indian Ocean Territory |
IO |
|
Iraq |
IQ |
|
Islamic Republic of Iran |
IR |
|
Iceland |
IS |
|
Italy |
IT |
|
Jersey |
JE |
|
Jamaica |
JM |
|
Jordan |
JO |
|
Japan |
JP |
|
Kenya |
KE |
|
Kyrgyzstan |
KG |
|
Cambodia |
KH |
|
Kiribati |
KI |
|
Comoros |
KM |
|
Saint Kitts and Nevis |
KN |
|
Democratic People’s Republic of Korea |
KP |
|
Republic of Korea |
KR |
|
Kuwait |
KW |
|
Cayman Islands |
KY |
|
Kazakhstan |
KZ |
|
Lao People’s Democratic Republic |
LA |
|
Lebanon |
LB |
|
Saint Lucia |
LC |
|
Liechtenstein |
LI |
|
Sri Lanka |
LK |
|
Liberia |
LR |
|
Lesotho |
LS |
|
Lithuania |
LT |
|
Luxembourg |
LU |
|
Latvia |
LV |
|
Libyan Arab Jamahiriya |
LY |
|
Morocco |
MA |
|
Monaco |
MC |
|
Republic of Moldova |
MD |
|
Montenegro |
ME |
|
Saint Martin (French part) |
MF |
|
Madagascar |
MG |
|
Marshall Islands |
MH |
|
Macedonia |
MK |
|
Mali |
ML |
|
Myanmar |
MM |
|
Mongolia |
MN |
|
Macao |
MO |
|
Northern Mariana Islands |
MP |
|
Martinique |
MQ |
|
Mauritania |
MR |
|
Montserrat |
MS |
|
Malta |
MT |
|
Mauritius |
MU |
|
Maldives |
MV |
|
Malawi |
MW |
|
Mexico |
MX |
|
Malaysia |
MY |
|
Mozambique |
MZ |
|
Namibia |
NA |
|
New Caledonia |
NC |
|
Niger |
NE |
|
Norfolk Island |
NF |
|
Nigeria |
NG |
|
Nicaragua |
NI |
|
Netherlands |
NL |
|
Norway |
NO |
|
Nepal |
NP |
|
Nauru |
NR |
|
Niue |
NU |
|
New Zealand |
NZ |
|
Oman |
OM |
|
Panama |
PA |
|
Peru |
PE |
|
French Polynesia |
PF |
|
Papua New Guinea |
PG |
|
Philippines |
PH |
|
Pakistan |
PK |
|
Poland |
PL |
|
Saint Pierre and Miquelon |
PM |
|
Pitcairn |
PN |
|
Puerto Rico |
PR |
|
Occupied Palestinian Territory |
PS |
|
Portugal |
PT |
|
Palau |
PW |
|
Paraguay |
PY |
|
Qatar |
QA |
|
Reunion |
RE |
|
Romania |
RO |
|
Serbia |
RS |
|
Russian Federation |
RU |
|
Rwanda |
RW |
|
Saudi Arabia |
SA |
|
Solomon Islands |
SB |
|
Seychelles |
SC |
|
Sudan |
SD |
|
Sweden |
SE |
|
Singapore |
SG |
|
Ascension and Tristan da Cunha Saint Helena |
SH |
|
Slovenia |
SI |
|
Svalbard and Jan Mayen |
SJ |
|
Slovakia |
SK |
|
Sierra Leone |
SL |
|
San Marino |
SM |
|
Senegal |
SN |
|
Somalia |
SO |
|
Suriname |
SR |
|
South Sudan |
SS |
|
Sao Tome and Principe |
ST |
|
El Salvador |
SV |
|
Syrian Arab Republic |
SY |
|
Swaziland |
SZ |
|
Turks and Caicos Islands |
TC |
|
Chad |
TD |
|
French Southern Territories |
TF |
|
Togo |
TG |
|
Thailand |
TH |
|
Tajikistan |
TJ |
|
Tokelau |
TK |
|
Timor-Leste |
TL |
|
Turkmenistan |
TM |
|
Tunisia |
TN |
|
Tonga |
TO |
|
Turkey |
TR |
|
Trinidad and Tobago |
TT |
|
Tuvalu |
TV |
|
Taiwan |
TW |
|
United Republic of Tanzania |
TZ |
|
Ukraine |
UA |
|
Uganda |
UG |
|
United States Minor Outlying Islands |
UM |
|
United States |
US |
|
Uruguay |
UY |
|
Uzbekistan |
UZ |
|
Holy See (Vatican City State) |
VA |
|
Saint Vincent and the Grenadines |
VC |
|
Venezuela |
VE |
|
Virgin Islands, British |
VG |
|
Virgin Islands, U.S. |
VI |
|
Viet Nam |
VN |
|
Vanuatu |
VU |
|
Wallis and Futuna |
WF |
|
Wales |
WL |
|
Samoa |
WS |
|
Scotland |
XL |
|
Yemen |
YE |
|
Mayotte |
YT |
|
South Africa |
ZA |
|
Zambia |
ZM |
|
Zimbabwe |
ZW |