Package org.jdesktop.swingx.plaf
Class DefaultsList
- java.lang.Object
-
- org.jdesktop.swingx.plaf.DefaultsList
-
public final class DefaultsList extends java.lang.ObjectA 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 Modifier and Type Field Description private java.util.List<java.lang.Object>delegate
-
Constructor Summary
Constructors Constructor Description DefaultsList()Creates aDefaultsList.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Object key, java.lang.Object value)Adds a key/value pair to the defaults list.voidadd(java.lang.Object key, java.lang.Object value, boolean enableChecking)Adds a key/value pair to the defaults list.private static <T> TasUIResource(T value, java.lang.String message)java.lang.Object[]toArray()Gets a copy of this list as an array.
-
-
-
Method Detail
-
add
public void add(java.lang.Object key, java.lang.Object value)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:
java.lang.NullPointerException- ifkeyisnulljava.lang.IllegalArgumentException- 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
public void add(java.lang.Object key, java.lang.Object value, boolean enableChecking)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:
java.lang.NullPointerException- ifkeyisnulljava.lang.IllegalArgumentException- 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
private static <T> T asUIResource(T value, java.lang.String message)
-
toArray
public java.lang.Object[] toArray()
Gets a copy of this list as an array.- Returns:
- an array containing all of the key/value pairs added to this list
-
-