APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing

pack-priv final Enum ClientPropertyKey

extends Enum<ClientPropertyKey>
Class Inheritance
Imports
sun.awt.AWTAccessor

An enumeration for keys used as client properties within the Swing implementation.

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.

Author
Shannon Hickey

Field Summary

Modifier and TypeField 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 NotSerializableException should be thrown during serialization, when the value associated with this key does not implement Serializable.

Constructor Summary

AccessConstructor and Description
private
ClientPropertyKey()

Constructs a key with the reportValueNotSerializable property set to false.

private
ClientPropertyKey(boolean reportValueNotSerializable)

Constructs a key with the reportValueNotSerializable property set to the given value.

Method Summary

Modifier and TypeMethod and Description
public boolean
getReportValueNotSerializable()

Returns whether or not a NotSerializableException should be thrown during serialization, when the value associated with this key does not implement Serializable.

public static ClientPropertyKey
public static ClientPropertyKey[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

JComponent_ANCESTOR_NOTIFIERback to summary
public static final ClientPropertyKey JComponent_ANCESTOR_NOTIFIER

Key used by JComponent for storing AncestorNotifier.

JComponent_INPUT_VERIFIERback to summary
public static final ClientPropertyKey JComponent_INPUT_VERIFIER

Key used by JComponent for storing InputVerifier.

JComponent_TRANSFER_HANDLERback to summary
public static final ClientPropertyKey JComponent_TRANSFER_HANDLER

Key used by JComponent for storing TransferHandler.

PopupFactory_FORCE_HEAVYWEIGHT_POPUPback to summary
public static final ClientPropertyKey PopupFactory_FORCE_HEAVYWEIGHT_POPUP

Key used by PopupFactory to force heavy weight popups for a component.

reportValueNotSerializableback to summary
private final boolean reportValueNotSerializable

Whether or not a NotSerializableException should be thrown during serialization, when the value associated with this key does not implement Serializable.

Constructor Detail

ClientPropertyKeyback to summary
private ClientPropertyKey()

Constructs a key with the reportValueNotSerializable property set to false.

ClientPropertyKeyback to summary
private ClientPropertyKey(boolean reportValueNotSerializable)

Constructs a key with the reportValueNotSerializable property set to the given value.

Method Detail

getReportValueNotSerializableback to summary
public boolean getReportValueNotSerializable()

Returns whether or not a NotSerializableException should be thrown during serialization, when the value associated with this key does not implement Serializable.

valueOfback to summary
public static ClientPropertyKey valueOf(String name)
valuesback to summary
public static ClientPropertyKey[] values()