+ bool result = isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL);
+ if(!result && myIsProcessWidgets) {
+ result = isNode(theNode, NODE_FEATURE, NULL);
+ }
+ return result;
+}
+
+void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode,
+ const std::shared_ptr<Config_FeatureMessage>& outFeatureMessage)
+{
+ outFeatureMessage->setId(getProperty(theFeatureNode, _ID));
+ outFeatureMessage->setPluginLibrary(myLibraryName);
+ outFeatureMessage->setNestedFeatures(getProperty(theFeatureNode, FEATURE_NESTED));
+ outFeatureMessage->setActionsWhenNested(getNormalizedProperty(theFeatureNode, FEATURE_WHEN_NESTED));
+
+ bool isInternal = getBooleanAttribute(theFeatureNode, ATTR_INTERNAL, false);
+ outFeatureMessage->setInternal(isInternal);
+ if (isInternal) {
+ //Internal feature has no visual representation.
+ return;
+ }
+ outFeatureMessage->setText(getProperty(theFeatureNode, FEATURE_TEXT));
+ outFeatureMessage->setTooltip(getProperty(theFeatureNode, FEATURE_TOOLTIP));
+ outFeatureMessage->setIcon(getProperty(theFeatureNode, FEATURE_ICON));
+ outFeatureMessage->setKeysequence(getProperty(theFeatureNode, FEATURE_KEYSEQUENCE));
+ outFeatureMessage->setGroupId(restoreAttribute(NODE_GROUP, _ID));
+ outFeatureMessage->setWorkbenchId(restoreAttribute(NODE_WORKBENCH, _ID));
+ // Get document kind of a feature, if empty set workbench's kind (might be empty too)
+ std::string aDocKind = getProperty(theFeatureNode, FEATURE_DOC);
+ if(aDocKind.empty()) {
+ aDocKind = restoreAttribute(NODE_WORKBENCH, WORKBENCH_DOC);
+ }
+ outFeatureMessage->setDocumentKind(aDocKind);
+}
+
+void Config_FeatureReader::storeAttribute(xmlNodePtr theNode,
+ const char* theNodeAttribute)
+{
+ std::string aKey = getNodeName(theNode) + ":" + std::string(theNodeAttribute);
+ std::string aValue = getProperty(theNode, theNodeAttribute);
+ if(!aValue.empty()) {
+ myParentAttributes[aKey] = aValue;
+ }