Hi *,
The Facade contains the following functions:
/**
* Return Changeability of a StructuralFeature or a AssociationEnd.
*
* @param handle the StructuralFeature or AssociationEnd
* @return the Changeability
* @deprecated for 0.25.4 by tfmorris. Use [EMAIL PROTECTED]
#isReadOnly(Object)}.
*/
@Deprecated
Object getChangeability(Object handle);
/**
* Return the value of the isReadOnly attribute. This replaces the
* ChangeableKind enumeration of UML 1.x and is equivalent to a
* ChangeableKind of FROZEN. The UML 1.x enum of ADD_ONLY has been
removed
* from UML 2.x.
*
* @param handle
* the StructuralFeature
* @return true if the element is readonly
* @since 0.25.4
*/
boolean isReadOnly(Object handle);
The problem here is, that for the 3 cases, this latter method only has 2
answers.
E.g. see my commit 14834; I replaced this:
if (Model.getFacade().getChangeability(modelElement) != null) {
if (Model.getChangeableKind().getFrozen().equals(
Model.getFacade().getChangeability(modelElement))) {
changeableKind = "frozen";
}
}
with this:
if (Model.getFacade().isReadOnly(modelElement)) {
changeableKind = "frozen";
}
So, in this case there was no problem (although the code is less readable
now).
But with the isReadOnly() method, there is no way anymore to find out if the
attribute is set, i.e. if there is a value filled in. Some day, we might
need this functionality...
One solution is to make this method isReadOnly return a Boolean if the value
is set, and null if it is not.
Should we not adapt the Facade in this way?
Regards,
Michiel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]