This enum holds only a small subset of the keys currently used within Swing, but we may move more of them here in the future.
Adding an item to, and using, this class instead of String for
client properties protects against conflicts with developer-set client
properties. Using this class also avoids a problem with StringBuilder
and StringBuffer keys, whereby the keys are not recognized upon
deserialization.
When a client property value associated with one of these keys does not
implement Serializable, the result during serialization depends
on how the key is defined here. Historically, client properties with values
not implementing Serializable have simply been dropped and left out
of the serialized representation. To define keys with such behavior in this
enum, provide a value of false for the reportValueNotSerializable
property. When migrating existing properties to this enum, one may wish to
consider using this by default, to preserve backward compatibility.
To instead have a NotSerializableException thrown when a
non-Serializable property is encountered, provide the value of
true for the reportValueNotSerializable property. This
is useful when the property represents something that the developer
needs to know about when it cannot be serialized.
| Modifier and Type | Field and Description |
|---|---|
| public static final ClientPropertyKey | JComponent_ANCESTOR_NOTIFIER
Key used by JComponent for storing AncestorNotifier. |
| public static final ClientPropertyKey | JComponent_INPUT_VERIFIER
Key used by JComponent for storing InputVerifier. |
| public static final ClientPropertyKey | JComponent_TRANSFER_HANDLER
Key used by JComponent for storing TransferHandler. |
| public static final ClientPropertyKey | PopupFactory_FORCE_HEAVYWEIGHT_POPUP
Key used by PopupFactory to force heavy weight popups for a component. |
| private final boolean | reportValueNotSerializable
Whether or not a |
| Access | Constructor and Description |
|---|---|
| private | |
| private | ClientPropertyKey(boolean reportValueNotSerializable)
Constructs a key with the |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | getReportValueNotSerializable()
Returns whether or not a |
| public static ClientPropertyKey | |
| public static ClientPropertyKey[] |
| JComponent_ANCESTOR_NOTIFIER | back to summary |
|---|---|
| public static final ClientPropertyKey JComponent_ANCESTOR_NOTIFIER Key used by JComponent for storing AncestorNotifier. | |
| JComponent_INPUT_VERIFIER | back to summary |
|---|---|
| public static final ClientPropertyKey JComponent_INPUT_VERIFIER Key used by JComponent for storing InputVerifier. | |
| JComponent_TRANSFER_HANDLER | back to summary |
|---|---|
| public static final ClientPropertyKey JComponent_TRANSFER_HANDLER Key used by JComponent for storing TransferHandler. | |
| PopupFactory_FORCE_HEAVYWEIGHT_POPUP | back to summary |
|---|---|
| public static final ClientPropertyKey PopupFactory_FORCE_HEAVYWEIGHT_POPUP Key used by PopupFactory to force heavy weight popups for a component. | |
| reportValueNotSerializable | back to summary |
|---|---|
| private final boolean reportValueNotSerializable Whether or not a | |
| ClientPropertyKey | back to summary |
|---|---|
| private ClientPropertyKey() Constructs a key with the | |
| ClientPropertyKey | back to summary |
|---|---|
| private ClientPropertyKey(boolean reportValueNotSerializable) Constructs a key with the | |
| getReportValueNotSerializable | back to summary |
|---|---|
| public boolean getReportValueNotSerializable() Returns whether or not a | |
| valueOf | back to summary |
|---|---|
| public static ClientPropertyKey valueOf(String name) | |
| values | back to summary |
|---|---|
| public static ClientPropertyKey[] values() | |