override fun loadState()

in src/main/kotlin/mobi/hsz/idea/gitignore/settings/IgnoreSettings.kt [174:210]


    override fun loadState(element: Element) {
        element.apply {
            getAttributeValue(KEY.MISSING_GITIGNORE.toString())?.let {
                missingGitignore = it.toBoolean()
            }
            getAttributeValue(KEY.IGNORED_FILE_STATUS.toString())?.let {
                ignoredFileStatus = it.toBoolean()
            }
            getAttributeValue(KEY.STARRED_TEMPLATES.toString())?.let {
                starredTemplates = (StringUtil.split(it, Constants.DOLLAR))
            }
            getAttributeValue(KEY.NOTIFY_IGNORED_EDITING.toString())?.let {
                notifyIgnoredEditing = it.toBoolean()
            }

            getChild(KEY.LANGUAGES.toString()).children.forEach {
                val data = TreeMap<IgnoreLanguagesSettings.KEY, Any>()
                for (key in IgnoreLanguagesSettings.KEY.entries) {
                    data[key] = it.getAttributeValue(key.name)
                }

                val id = it.getAttributeValue(KEY.LANGUAGES_ID.toString())
                val language = IgnoreBundle.LANGUAGES[id]
                languagesSettings[language] = data
            }

            getAttributeValue(KEY.UNIGNORE_ACTIONS.toString())?.let {
                unignoreActions = it.toBoolean()
            }

            userTemplates.clear()
            userTemplates.addAll(loadTemplates(this))
            IgnoreBundle.LANGUAGES
                .filter { !it.isVCS || IgnoreBundle.isExcludedFromHighlighting(it) }
                .forEach { languagesSettings[it]?.apply { this[IgnoreLanguagesSettings.KEY.ENABLE] = false } }
        }
    }