I've created an extension property and added some validation code - but how do I identify the extension property within the message so the error marker is placed on the field for my extension property?
Here is my code:
@Override
public MessageList validate(IIpsObjectPartContainer ipsObjectPart, Object value) throws CoreException {
MessageList ml = new MessageList();
if (!(value instanceof Bearbeitbarkeit)) {
ml.newError(MSG_WRONG_TYPE, "Der Typ des Werts passt nicht zum Extension Property", ipsObjectPart);
}
return ml;
}
Just add the qualified extension point ID ('<your contributing plugin's ID>.<your extension point's ID>' as an additional parameter to the newError-method. The ExtensionPropertyControlFactory uses that ID to bind the UI elements to the ipsObjectPart.