Package org.jdesktop.swingx.plaf
Class DefaultsList
java.lang.Object
org.jdesktop.swingx.plaf.DefaultsList
A specialty "list" for working with UI defaults. Requires adds to be done
using key/value pairs. The purpose of this list is to enforce additions as
pairs.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a key/value pair to the defaults list.void
Adds a key/value pair to the defaults list.private static <T> T
asUIResource
(T value, String message) Object[]
toArray()
Gets a copy of this list as an array.
-
Field Details
-
delegate
-
-
Constructor Details
-
DefaultsList
public DefaultsList()Creates aDefaultsList
.
-
-
Method Details
-
add
Adds a key/value pair to the defaults list. This implementation defers toadd(Object, Object, boolean)
withenableChecking
set totrue
.- Parameters:
key
- the key that will be used to queryUIDefaults
value
- the value associated with the key- Throws:
NullPointerException
- ifkey
isnull
IllegalArgumentException
- ifvalue
is a type that should be aUIResource
but is not. For instance, passing in aBorder
that is not aUIResource
will cause an exception. This checking must be enabled.
-
add
Adds a key/value pair to the defaults list. A pair with anull
value is treated specially. Anull
-value pair is never added to the list and, furthermore, if a key/value pair exists in this list with the same key as the newly added one, it is removed.- Parameters:
key
- the key that will be used to queryUIDefaults
value
- the value associated with the keyenableChecking
- iftrue
then the value is checked to ensure that it is aUIResource
, if appropriate- Throws:
NullPointerException
- ifkey
isnull
IllegalArgumentException
- ifvalue
is a type that should be aUIResource
but is not. For instance, passing in aBorder
that is not aUIResource
will cause an exception. This checking must be enabled.
-
asUIResource
-
toArray
Gets a copy of this list as an array.- Returns:
- an array containing all of the key/value pairs added to this list
-