public class KeyEntry extends VizEntry
KeyEntry
is essentially a basic Entry
with a single caveat:
Its value and allowed values are managed by a IKeyManager
. If a key
is not allowed, then the KeyEntry
will not set its value to that key.
Multiple KeyEntry
s can and should share a IKeyManager
and
KeyEntryContentProvider
.
iComponentListener
Constructor and Description |
---|
KeyEntry(KeyEntry entry)
The copy constructor.
|
KeyEntry(KeyEntryContentProvider contentProvider)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
This operation provides a deep copy of the Entry.
|
boolean |
equals(java.lang.Object object)
This method is used to check equality between the Entry and another
Entry.
|
int |
hashCode()
This operation returns the hashcode value of the Entry.
|
void |
setContentProvider(IVizEntryContentProvider contentProvider)
Overrides the parent method to enforce the rule that content providers
*must* be
KeyEntryContentProvider s. |
void |
setContentProvider(KeyEntryContentProvider contentProvider)
Sets the content provider.
|
boolean |
setValue(java.lang.String newValue)
If the specified value is an allowed key for the
#keyManager ,
then this KeyEntry will assume that key within the key manager. |
copy, getAllowedValues, getComment, getDefaultValue, getErrorMessage, getParent, getTag, getValue, getValueType, isModified, isReady, isRequired, isSecret, setComment, setParent, setReady, setRequired, setTag, update
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister
getClass, notify, notifyAll, toString, wait, wait, wait
register, unregister
public KeyEntry(KeyEntry entry) throws java.lang.NullPointerException
KeyEntry
s will use the
exact same #keyManager
(but valid or unique keys).entry
- The other KeyEntry
to copy.java.lang.NullPointerException
- An NPE is thrown if the provided entry to copy is null, as a
valid KeyEntryContentProvider
cannot be acquired from
a null entry.public KeyEntry(KeyEntryContentProvider contentProvider) throws java.lang.NullPointerException
contentProvider
- The Entry
's content provider.manager
- The manager for the keys stored in this and other
KeyEntry
s.java.lang.NullPointerException
- An NPE is thrown if the provided content provider is null, as
a valid KeyEntryContentProvider
is required.public java.lang.Object clone()
VizEntry
clone
in interface IVizObject
clone
in class VizEntry
public boolean equals(java.lang.Object object)
VizEntry
equals
in interface IVizObject
equals
in class VizEntry
object
- The Entry that should be checked for equality.Identifiable#equals(Object otherObject)
public int hashCode()
VizEntry
hashCode
in interface IVizObject
hashCode
in class VizEntry
Identifiable#hashCode()
public void setContentProvider(IVizEntryContentProvider contentProvider)
KeyEntryContentProvider
s.setContentProvider
in class VizEntry
contentProvider
- The content provider.public void setContentProvider(KeyEntryContentProvider contentProvider)
contentProvider
- The new KeyEntryContentProvider
. If null, nothing is
done.public boolean setValue(java.lang.String newValue)
#keyManager
,
then this KeyEntry
will assume that key within the key manager.
Otherwise, this method will return false and set an appropriate error
message.