public class KeyEntryContentProvider extends BasicVizEntryContentProvider implements IKeyChangeListener
IEntryContentProvider
geared toward
KeyEntry
s whose allowed keys are managed by a IKeyManager
.
The purpose of this class is to interface some IKeyManager
implementation with a KeyEntry
. The KeyEntry
does not need to
manage allowed values or default values. Likewise, the IKeyManager
does not need to worry about how Entry
s work.
Notifications sent from the key manager will automatically update the default and allowed values for this content provider.
iComponentListener
Constructor and Description |
---|
KeyEntryContentProvider(IKeyManager keyManager)
The default constructor.
|
KeyEntryContentProvider(KeyEntryContentProvider provider)
A copy constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
This operation provides a deep copy of the BasicEntryContentProvider.
|
boolean |
equals(java.lang.Object object)
(non-Javadoc)
|
int |
hashCode()
Returns the hashCode.
|
boolean |
keyAvailable(java.lang.String key)
Gets whether the specified key is available for this content provider.
|
void |
keyChanged(java.lang.String oldKey,
java.lang.String newKey)
This method is called with the specified keys have somehow been
manipulated.
|
void |
setAllowedValues(java.util.ArrayList<java.lang.String> allowedValues)
Overrides the parent behavior to do nothing.
|
void |
setAllowedValueType(VizAllowedValueType allowedValueType)
Overrides the parent behavior to do nothing.
|
void |
setDefaultValue(java.lang.String defaultValue)
Overrides the parent behavior to do nothing.
|
copy, getAllowedValues, getAllowedValueType, getDefaultValue, getParent, getTag, setParent, setTag
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister, update
public KeyEntryContentProvider(IKeyManager keyManager) throws java.lang.NullPointerException
manager
- This manages all allowed keys for associated KeyEntry
s.java.lang.NullPointerException
- An NPE is thrown if the specified key manager is null, as a
valid key manager is required.public KeyEntryContentProvider(KeyEntryContentProvider provider) throws java.lang.NullPointerException
Note that the key manager is not re-created for the copy.
otherProvider
- The other KeyEntryContentProvider to copy.java.lang.NullPointerException
- An NPE is thrown if the specified content provider is null,
as its valid key manager is required.public java.lang.Object clone()
BasicVizEntryContentProvider
This operation provides a deep copy of the BasicEntryContentProvider.
clone
in interface IVizEntryContentProvider
clone
in interface IVizObject
clone
in class BasicVizEntryContentProvider
A clone of the BasicEntryContentProvider.
public boolean equals(java.lang.Object object)
IVizObject
equals
in interface IVizEntryContentProvider
equals
in interface IVizObject
equals
in class BasicVizEntryContentProvider
object
- The other provider to compare against.
Identifiable#equals(Object otherObject)
public int hashCode()
BasicVizEntryContentProvider
Returns the hashCode.
hashCode
in interface IVizEntryContentProvider
hashCode
in interface IVizObject
hashCode
in class BasicVizEntryContentProvider
The hash.
Identifiable#hashCode()
public boolean keyAvailable(java.lang.String key)
This provides an alternative to checking BasicVizEntryContentProvider.getAllowedValues()
when
the key set is unlimited or "undefined" (in which case the other method
returns an empty list).
key
- The key to check for availability.public void keyChanged(java.lang.String oldKey, java.lang.String newKey)
IKeyChangeListener
keyChanged
in interface IKeyChangeListener
oldKey
- The previous value of the key. This is null
if the key
did not previously exist. For "discrete" key managers, this
key was available previously but has been taken.newKey
- The new value of the key. This is null
if the key no
longer exists. For "discrete" key managers, this key was taken
previously but is now available.public void setAllowedValues(java.util.ArrayList<java.lang.String> allowedValues)
keyManager
.setAllowedValues
in interface IVizEntryContentProvider
setAllowedValues
in class BasicVizEntryContentProvider
allowedValues
- public void setAllowedValueType(VizAllowedValueType allowedValueType)
keyManager
.setAllowedValueType
in interface IVizEntryContentProvider
setAllowedValueType
in class BasicVizEntryContentProvider
allowedValueType
- IVizEntryContentProvider#setAllowedValueType(AllowedValueType
allowedValueType)
public void setDefaultValue(java.lang.String defaultValue)
keyManager
.setDefaultValue
in interface IVizEntryContentProvider
setDefaultValue
in class BasicVizEntryContentProvider
defaultValue
- IVizEntryContentProvider.setDefaultValue(String defaultValue)