+ return aMessage;
+}
+
+//**************************************************************
+QString ModuleBase_ModelWidget::getError(const bool theValueStateChecked) const
+{
+ QString anError;
+
+ if (!feature().get())
+ return anError;
+
+ std::string aFeatureID = feature()->getKind();
+ std::string anAttributeID = attributeID();
+ AttributePtr anAttribute = feature()->attribute(anAttributeID);
+ if (!anAttribute.get())
+ return anError;
+
+ std::string aValidatorID;
+ Events_InfoMessage anErrorMsg;
+
+ static ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators();
+ if (!aValidators->validate(anAttribute, aValidatorID, anErrorMsg)) {
+ if (anErrorMsg.empty())
+ anErrorMsg = "Unknown error.";
+
+ if (anErrorMsg.context().empty()) {
+ anErrorMsg.setContext(aFeatureID + ":" + anAttributeID + ":" + aValidatorID);
+ }
+ }
+
+ if (anErrorMsg.empty() && theValueStateChecked) {
+ anErrorMsg = getValueStateError();
+ }
+
+ if (!anErrorMsg.empty()) {
+ anError = ModuleBase_Tools::translate(anErrorMsg);
+ }
+