Search in sources :

Example 6 with ExternalResourceManagerEx

use of com.intellij.javaee.ExternalResourceManagerEx in project intellij-community by JetBrains.

the class XmlHighlightingTest method disableHtmlSupport.

private void disableHtmlSupport() {
    final ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx();
    myOldDoctype = manager.getDefaultHtmlDoctype(getProject());
    manager.setDefaultHtmlDoctype("fake", getProject());
}
Also used : ExternalResourceManagerEx(com.intellij.javaee.ExternalResourceManagerEx)

Example 7 with ExternalResourceManagerEx

use of com.intellij.javaee.ExternalResourceManagerEx in project intellij-community by JetBrains.

the class XmlHighlightingTest method testExternalValidatorOnValidXmlWithNamespacesNotSetup2.

@HighlightingFlags(HighlightingFlag.SkipExternalValidation)
public void testExternalValidatorOnValidXmlWithNamespacesNotSetup2() throws Exception {
    final ExternalResourceManagerEx instanceEx = ExternalResourceManagerEx.getInstanceEx();
    try {
        WriteCommandAction.runWriteCommandAction(null, () -> instanceEx.addIgnoredResource(""));
        doTest(getFullRelativeTestName(".xml"), true, false);
    } finally {
        WriteCommandAction.runWriteCommandAction(null, () -> instanceEx.removeIgnoredResource(""));
    }
}
Also used : ExternalResourceManagerEx(com.intellij.javaee.ExternalResourceManagerEx)

Example 8 with ExternalResourceManagerEx

use of com.intellij.javaee.ExternalResourceManagerEx in project intellij-community by JetBrains.

the class XmlHighlightingTest method testXInclude.

public void testXInclude() throws Exception {
    final String testName = getTestName(false);
    configureByFiles(null, BASE_PATH + testName + ".xml", BASE_PATH + testName + "-inc.xml", BASE_PATH + testName + "TestSchema.xsd");
    ExternalResourceManagerEx externalResourceManager = ExternalResourceManagerEx.getInstanceEx();
    try {
        ApplicationManager.getApplication().runWriteAction(() -> externalResourceManager.addIgnoredResource("oxf:/apps/somefile.xml"));
        doDoTest(true, false, true);
        VirtualFile[] includedFiles = FileIncludeManager.getManager(getProject()).getIncludedFiles(getFile().getVirtualFile(), true);
        assertEquals(1, includedFiles.length);
    } finally {
        ApplicationManager.getApplication().runWriteAction(() -> externalResourceManager.removeIgnoredResource("oxf:/apps/somefile.xml"));
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ExternalResourceManagerEx(com.intellij.javaee.ExternalResourceManagerEx)

Example 9 with ExternalResourceManagerEx

use of com.intellij.javaee.ExternalResourceManagerEx in project intellij-community by JetBrains.

the class XmlHighlightingTest method testExternalValidatorOnValidXmlWithNamespacesNotSetup.

public void testExternalValidatorOnValidXmlWithNamespacesNotSetup() throws Exception {
    final ExternalResourceManagerEx instanceEx = ExternalResourceManagerEx.getInstanceEx();
    WriteCommandAction.runWriteCommandAction(null, () -> {
        instanceEx.addIgnoredResource("http://xml.apache.org/axis/wsdd2/");
        instanceEx.addIgnoredResource("http://xml.apache.org/axis/wsdd2/providers/java");
        instanceEx.addIgnoredResource("http://soapinterop.org/xsd2");
    });
    doTest(getFullRelativeTestName(".xml"), true, false);
}
Also used : ExternalResourceManagerEx(com.intellij.javaee.ExternalResourceManagerEx)

Example 10 with ExternalResourceManagerEx

use of com.intellij.javaee.ExternalResourceManagerEx in project intellij-plugins by JetBrains.

the class CfmlCompletionTest method testTagCompletionAfterAngleBracket.

public void testTagCompletionAfterAngleBracket() throws Throwable {
    final ExternalResourceManagerEx manager = ExternalResourceManagerEx.getInstanceEx();
    final String doctype = manager.getDefaultHtmlDoctype(getProject());
    manager.setDefaultHtmlDoctype(XmlUtil.XHTML_URI, getProject());
    try {
        doTestCompletionContainsVariants("cffunction", "center", "cfset", "h1");
    } finally {
        manager.setDefaultHtmlDoctype(doctype, getProject());
    }
}
Also used : ExternalResourceManagerEx(com.intellij.javaee.ExternalResourceManagerEx)

Aggregations

ExternalResourceManagerEx (com.intellij.javaee.ExternalResourceManagerEx)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 Project (com.intellij.openapi.project.Project)1 NotNull (org.jetbrains.annotations.NotNull)1