Search in sources :

Example 1 with XPathSupportProxy

use of org.intellij.plugins.intelliLang.inject.config.XPathSupportProxy in project intellij-community by JetBrains.

the class AdvancedXmlPanel method createUIComponents.

private void createUIComponents() {
    myValuePattern = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getValuePattern(), new LanguageTextField.SimpleDocumentCreator() {

        public void customizePsiFile(PsiFile psiFile) {
            psiFile.putCopyableUserData(ValueRegExpAnnotator.KEY, Boolean.TRUE);
        }
    });
    // don't even bother to look up the language when xpath-evaluation isn't possible
    final XPathSupportProxy proxy = XPathSupportProxy.getInstance();
    myXPathCondition = new LanguageTextField(proxy != null ? InjectedLanguage.findLanguageById("XPath") : null, myProject, myOrigInjection.getXPathCondition(), new LanguageTextField.SimpleDocumentCreator() {

        public void customizePsiFile(PsiFile psiFile) {
            // like lower-case(), file-type(), file-ext(), file-name(), etc.
            if (proxy != null) {
                proxy.attachContext(psiFile);
            }
        }
    });
}
Also used : XPathSupportProxy(org.intellij.plugins.intelliLang.inject.config.XPathSupportProxy) PsiFile(com.intellij.psi.PsiFile) LanguageTextField(com.intellij.ui.LanguageTextField)

Aggregations

PsiFile (com.intellij.psi.PsiFile)1 LanguageTextField (com.intellij.ui.LanguageTextField)1 XPathSupportProxy (org.intellij.plugins.intelliLang.inject.config.XPathSupportProxy)1