Java Code Examples for java.awt.Component#getLocale()

The following examples show how to use java.awt.Component#getLocale() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private static String getString(Object key, Component c) {
	Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
	return UIManager.getString(key, l);
}
 
Example 2
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 3
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 4
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 5
Source Project: jdk8u60   File: UIManager.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 6
Source Project: JDKSourceCode1.8   File: UIManager.java    License: MIT License 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 7
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 8
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 9
Source Project: Bytecoder   File: UIManager.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 10
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 11
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 12
Source Project: Java8CN   File: UIManager.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 13
Source Project: hottub   File: UIManager.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 14
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 15
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 16
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 17
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}
 
Example 18
/**
 * Returns a string from the defaults that is appropriate for the
 * given locale.  If the value for
 * {@code key} is not a {@code String}, {@code null} is returned.
 *
 * @param key  an <code>Object</code> specifying the string
 * @param c {@code Component} used to determine the locale;
 *          {@code null} implies the default locale as
 *          returned by {@code Locale.getDefault()}
 * @return the <code>String</code>
 * @throws NullPointerException if {@code key} is {@code null}
 */
static String getString(Object key, Component c) {
    Locale l = (c == null) ? Locale.getDefault() : c.getLocale();
    return getString(key, l);
}