|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.forms.util.FormUtils
public final class FormUtils
A library-internal class that consists only of static utility methods. Note: This class is not part of the public Forms API. It's intended for library implementation purposes only. The class's API may change at any time.
Method Summary | |
---|---|
static void |
assertNotBlank(java.lang.String text,
java.lang.String description)
Throws an exception if the specified text is blank using the given text description. |
static void |
assertNotNull(java.lang.Object object,
java.lang.String description)
Throws an NPE if the given object is null that uses
the specified text to describe the object. |
static void |
clearLookAndFeelBasedCaches()
Clears cached internal Forms state that is based on the Look&Feel, for example dialog base units. |
static boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Checks and answers if the two objects are both null or equal. |
static boolean |
isBlank(java.lang.String str)
Checks and answers if the given string is whitespace, empty (""), or null . |
static boolean |
isLafAqua()
Lazily checks and answers whether the Aqua look&feel is active. |
static boolean |
isNotBlank(java.lang.String str)
Checks and answers if the given string is not empty (""), not null and not whitespace only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void assertNotBlank(java.lang.String text, java.lang.String description)
text
- the text to checkdescription
- describes the text, used in the exception message
java.lang.NullPointerException
- if text
is null
java.lang.IllegalArgumentException
- if text
is empty, or blankpublic static void assertNotNull(java.lang.Object object, java.lang.String description)
null
that uses
the specified text to describe the object.
object
- the text to checkdescription
- describes the object, used in the exception message
java.lang.NullPointerException
- if object
is null
public static boolean equals(java.lang.Object o1, java.lang.Object o2)
null
or equal.
#equals(null, null) == true #equals("Hi", "Hi") == true #equals("Hi", null) == false #equals(null, "Hi") == false #equals("Hi", "Ho") == false
o1
- the first object to compareo2
- the second object to compare
true
if and only if
both objects are null
or equalpublic static boolean isBlank(java.lang.String str)
null
.
FormUtils.isBlank(null) == true FormUtils.isBlank("") == true FormUtils.isBlank(" ") == true FormUtils.isBlank(" abc") == false FormUtils.isBlank("abc ") == false FormUtils.isBlank(" abc ") == false
str
- the string to check, may benull
true
if the string is whitespace, empty, or null
public static boolean isNotBlank(java.lang.String str)
null
and not whitespace only.
FormUtils.isNotBlank(null) == false FormUtils.isNotBlank("") == false FormUtils.isNotBlank(" ") == false FormUtils.isNotBlank(" abc") == true FormUtils.isNotBlank("abc ") == true FormUtils.isNotBlank(" abc ") == true
str
- the string to check, may be null
true
if the string is not empty
and not null
and not whitespace onlypublic static boolean isLafAqua()
true
if the current look&feel is Aquapublic static void clearLookAndFeelBasedCaches()
There's typically no need to call this method directly.
It'll be invoked automatically, if the L&F has been changed
via UIManager.setLookAndFeel(javax.swing.LookAndFeel)
and cached data is requested.
It's been made public to allow cache invalidation for cases
where the L&F is changed temporarily by replacing the UIDefaults,
for example in a visual editor.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |