Search in sources :

Example 6 with ZenCodingFilter

use of com.intellij.codeInsight.template.emmet.filters.ZenCodingFilter in project intellij-community by JetBrains.

the class XmlEmmetConfigurable method reset.

@Override
public void reset() {
    EmmetOptions emmetOptions = EmmetOptions.getInstance();
    myEnableEmmetJBCheckBox.setSelected(emmetOptions.isEmmetEnabled());
    myEnablePreviewJBCheckBox.setEnabled(emmetOptions.isEmmetEnabled());
    myEnablePreviewJBCheckBox.setSelected(emmetOptions.isPreviewEnabled());
    myEnableHrefAutodetectJBCheckBox.setEnabled(emmetOptions.isEmmetEnabled());
    myEnableHrefAutodetectJBCheckBox.setSelected(emmetOptions.isHrefAutoDetectEnabled());
    myAddEditPointAtTheEndOfTemplateJBCheckBox.setEnabled(emmetOptions.isEmmetEnabled());
    myAddEditPointAtTheEndOfTemplateJBCheckBox.setSelected(emmetOptions.isAddEditPointAtTheEndOfTemplate());
    myBemElementSeparatorTextField.setText(emmetOptions.getBemElementSeparator());
    myBemModifierSeparatorTextField.setText(emmetOptions.getBemModifierSeparator());
    myBemShortElementPrefixTextField.setText(emmetOptions.getBemShortElementPrefix());
    Set<String> enabledByDefault = emmetOptions.getFiltersEnabledByDefault();
    for (ZenCodingFilter filter : ZenCodingFilter.getInstances()) {
        final String filterSuffix = filter.getSuffix();
        final JBCheckBox checkBox = myFilterCheckboxes.get(filterSuffix);
        if (checkBox != null) {
            checkBox.setEnabled(emmetOptions.isEmmetEnabled());
            checkBox.setSelected(enabledByDefault.contains(filterSuffix));
        }
    }
}
Also used : ZenCodingFilter(com.intellij.codeInsight.template.emmet.filters.ZenCodingFilter) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Aggregations

ZenCodingFilter (com.intellij.codeInsight.template.emmet.filters.ZenCodingFilter)6 LiveTemplateBuilder (com.intellij.codeInsight.template.LiveTemplateBuilder)2 SingleLineEmmetFilter (com.intellij.codeInsight.template.emmet.filters.SingleLineEmmetFilter)2 XmlZenCodingGenerator (com.intellij.codeInsight.template.emmet.generators.XmlZenCodingGenerator)2 JBCheckBox (com.intellij.ui.components.JBCheckBox)2 ZenCodingGenerator (com.intellij.codeInsight.template.emmet.generators.ZenCodingGenerator)1 TemplateToken (com.intellij.codeInsight.template.emmet.tokens.TemplateToken)1 TemplateImpl (com.intellij.codeInsight.template.impl.TemplateImpl)1 DocumentWindowImpl (com.intellij.injected.editor.DocumentWindowImpl)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 PsiElement (com.intellij.psi.PsiElement)1 CodeStyleSettings (com.intellij.psi.codeStyle.CodeStyleSettings)1 NotNull (org.jetbrains.annotations.NotNull)1