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 TypeMethodDescriptionvoidAdds a key/value pair to the defaults list.voidAdds a key/value pair to the defaults list.private static <T> TasUIResource(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)withenableCheckingset totrue.- Parameters:
key- the key that will be used to queryUIDefaultsvalue- the value associated with the key- Throws:
NullPointerException- ifkeyisnullIllegalArgumentException- ifvalueis a type that should be aUIResourcebut is not. For instance, passing in aBorderthat is not aUIResourcewill cause an exception. This checking must be enabled.
-
add
Adds a key/value pair to the defaults list. A pair with anullvalue 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 queryUIDefaultsvalue- the value associated with the keyenableChecking- iftruethen the value is checked to ensure that it is aUIResource, if appropriate- Throws:
NullPointerException- ifkeyisnullIllegalArgumentException- ifvalueis a type that should be aUIResourcebut is not. For instance, passing in aBorderthat is not aUIResourcewill 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
-