|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.AbstractDBEntry
com.antelmann.util.Country
public class Country
allows to treat a country just like any other DBEntry object and includes useful components to use countries in tables and lists. The ID of a Country is its 2-letter country code based on ISO 3166.
I18n,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
Country.Store
provides a convenient read-only store for all existing Country objects without having to hold them all in memory constantly |
| Nested classes/interfaces inherited from interface com.antelmann.util.Localizable |
|---|
Localizable.Adapter |
| Field Summary |
|---|
| Fields inherited from interface com.antelmann.db.DBEntry |
|---|
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR |
| Constructor Summary | |
|---|---|
Country(String countryCode)
|
|
Country(String countryCode,
boolean showFullNameOnToString)
|
|
| Method Summary | |
|---|---|
int |
compareTo(Country c)
|
static Country[] |
getAll()
|
static DefaultCellEditor |
getCellEditor(boolean showFullName,
boolean showIcon)
|
static JComboBox |
getComboBox()
|
static JComboBox |
getComboBox(boolean showFullName,
boolean showIcon,
Locale locale,
Country... limitToTheseCountries)
uses a DefaultComboBoxModel with Country instances |
static JComboBox |
getComboBox(Locale locale)
|
static Country[] |
getCountries(Filter<Country> filter)
|
String |
getCountryCode()
returns AbstractDBEntry.getID() |
static DefaultListCellRenderer |
getCountryListRenderer(boolean showFullName,
boolean showIcon)
|
static DefaultListCellRenderer |
getCountryListRenderer(boolean showFullName,
boolean showIcon,
Locale l)
|
static Country |
getDefaultCountry()
|
static Country[] |
getEU()
|
ImageIcon |
getIcon()
|
static ImageIcon |
getIcon(String countryCode)
|
Locale |
getLocale()
represents the 2-letter country code based on ISO 3166 |
String |
getName()
|
String |
getName(Locale l)
|
static FormattedCellRenderer |
getRenderer(boolean showFullName,
boolean showIcon,
Locale l)
|
static DefaultTableCellRenderer |
getTableCellRenderer(boolean showFullName,
boolean showIcon)
|
static DefaultTableCellRenderer |
getTableCellRenderer(boolean showFullName,
boolean showIcon,
Locale l)
|
boolean |
isEUCountry()
|
static DBClassStore<Country> |
makeStore(Database<?> db,
boolean readOnly)
returns a collection store containing all countries that is yet to be put into the database |
void |
setLocale(Locale locale)
|
void |
setLocale(Locale locale,
Object context)
sets the Locale for this object so that all subsequent return values of method calls to this instance can be localized accordingly until a different Locale is set. |
String |
toString()
|
| Methods inherited from class com.antelmann.db.AbstractDBEntry |
|---|
equals, getID, hashCode, hashEntry, sameEntry |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Country(String countryCode)
throws IllegalArgumentException
IllegalArgumentException
public Country(String countryCode,
boolean showFullNameOnToString)
throws IllegalArgumentException
IllegalArgumentException| Method Detail |
|---|
public Locale getLocale()
getLocale in interface LocalizableLocalizable.setLocale(Locale, Object)
public void setLocale(Locale locale,
Object context)
Localizable
setLocale in interface Localizablelocale - the Locale that is to be used to determine return values for all methods
of this instance; if set to null, the default locale is to be used.context - a context that may be required for this instance to load the resources for the given locale;
this context may be null for objects that do not require an external context.
Examples of a context may be a database, a resource file, some map or no context at all.Localizable.getLocale()public void setLocale(Locale locale)
public String getCountryCode()
AbstractDBEntry.getID()
public String toString()
toString in class AbstractDBEntrypublic int compareTo(Country c)
compareTo in interface Comparable<Country>@Localized public String getName()
public String getName(Locale l)
public boolean isEUCountry()
I18n.getEUCountryCodes()public static Country[] getAll()
public static Country[] getEU()
public static Country[] getCountries(Filter<Country> filter)
public static Country getDefaultCountry()
public static DBClassStore<Country> makeStore(Database<?> db,
boolean readOnly)
public ImageIcon getIcon()
public static ImageIcon getIcon(String countryCode)
public static JComboBox getComboBox()
public static JComboBox getComboBox(Locale locale)
public static JComboBox getComboBox(boolean showFullName,
boolean showIcon,
Locale locale,
Country... limitToTheseCountries)
DefaultComboBoxModel with Country instances
public static DefaultListCellRenderer getCountryListRenderer(boolean showFullName,
boolean showIcon)
public static DefaultListCellRenderer getCountryListRenderer(boolean showFullName,
boolean showIcon,
Locale l)
public static FormattedCellRenderer getRenderer(boolean showFullName,
boolean showIcon,
Locale l)
public static DefaultTableCellRenderer getTableCellRenderer(boolean showFullName,
boolean showIcon)
public static DefaultTableCellRenderer getTableCellRenderer(boolean showFullName,
boolean showIcon,
Locale l)
public static DefaultCellEditor getCellEditor(boolean showFullName,
boolean showIcon)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||