public final class IdentifyUtils extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
IdentifyUtils.IconBundleStrategy
Strategy used to find an icon bundle for a bean.
|
(package private) static interface |
IdentifyUtils.NameStrategy
Strategy used to determine the value for a name
property on a bean.
|
Modifier and Type | Method and Description |
---|---|
(package private) static IconTextDirection |
determineTextDirection(JLabel label)
Determine a text direction from the component orientation of
the specified label.
|
IconBundle |
getDefaultIconBundle()
Return the icon bundle to use as a default icon bundle,
in the case the icon bundle strategy is unable to find an
icon bundle for a bean.
|
static IconBundle |
getIconBundleFor(Object bean)
Return an icon bundle for the specified bean using the
set icon bundle strategy.
|
IdentifyUtils.IconBundleStrategy |
getIconBundleStrategy()
Return the strategy used to find an icon bundle for
a bean.
|
static IdentifyUtils |
getInstance()
Return the static instance of IdentifyUtils.
|
static String |
getNameFor(Object bean)
Return a name for the specified bean using the set name
strategy.
|
IdentifyUtils.NameStrategy |
getNameStrategy()
Return the strategy used to determine the value for
a name property on a bean.
|
static boolean |
isGTKLookAndFeel()
Return true if the current look and feel is the GTK look and feel.
|
static boolean |
isMacOSXLookAndFeel()
Return true if the current look and feel is the MacOSX look and feel.
|
static boolean |
isWindowsLookAndFeel()
Return true if the current look and feel is the Windows look and feel.
|
void |
setDefaultIconBundle(IconBundle defaultIconBundle)
Set the default icon bundle to
defaultIconBundle . |
void |
setIconBundleStrategy(IdentifyUtils.IconBundleStrategy iconBundleStrategy)
Set the strategy used to find an icon bundle for a bean
to
iconBundleStrategy . |
void |
setNameStrategy(IdentifyUtils.NameStrategy nameStrategy)
Set the strategy used to determine the value for
a name property on a bean to
nameStrategy . |
public static IdentifyUtils getInstance()
public static String getNameFor(Object bean)
"null"
if
bean
is null.bean
- beangetNameStrategy()
public static IconBundle getIconBundleFor(Object bean)
null
if
bean
is null, and the default icon bundle
if an icon bundle cannot otherwise be found.bean
- beangetIconBundleStrategy()
,
getDefaultIconBundle()
public static boolean isGTKLookAndFeel()
GTK_LOOK_AND_FEEL_CLASS_NAME
public static boolean isMacOSXLookAndFeel()
JDK15_MAC_OSX_LOOK_AND_FEEL_CLASS_NAME
,
JDK16_MAC_OSX_LOOK_AND_FEEL_CLASS_NAME
public static boolean isWindowsLookAndFeel()
WINDOWS_LOOK_AND_FEEL_CLASS_NAME
public IdentifyUtils.NameStrategy getNameStrategy()
public void setNameStrategy(IdentifyUtils.NameStrategy nameStrategy)
nameStrategy
.nameStrategy
- name strategy, must not be nullpublic IdentifyUtils.IconBundleStrategy getIconBundleStrategy()
public void setIconBundleStrategy(IdentifyUtils.IconBundleStrategy iconBundleStrategy)
iconBundleStrategy
.iconBundleStrategy
- icon bundle strategy, must not
be nullpublic IconBundle getDefaultIconBundle()
public void setDefaultIconBundle(IconBundle defaultIconBundle)
defaultIconBundle
.defaultIconBundle
- the default icon bundle, must
not be nullstatic IconTextDirection determineTextDirection(JLabel label)
label
- labelCopyright (c) 2003-2019 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).