mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Javafx: Don't highlight absolute (remote) URL as invalid in FXML. Test added (IDEA-154132)
This commit is contained in:
+4
@@ -428,6 +428,10 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase {
|
||||
myFixture.testHighlighting(true, false, false, getTestName(false) + ".java");
|
||||
}
|
||||
|
||||
public void testAbsoluteRemoteUrl() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
myFixture.testHighlighting(false, false, false, getTestName(true) + ".fxml");
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public class FxmlConstants {
|
||||
|
||||
@NonNls public static final String STYLE_CLASS = "styleClass";
|
||||
@NonNls public static final String STYLESHEETS = "stylesheets";
|
||||
@NonNls public static final String URL = "url";
|
||||
|
||||
@NonNls public static final String SOURCE = "source";
|
||||
|
||||
|
||||
+4
-2
@@ -99,8 +99,10 @@ public class FxmlReferencesContributor extends PsiReferenceContributor {
|
||||
.and(attributeValueInFxml),
|
||||
new JavaFxComponentIdReferenceProvider());
|
||||
|
||||
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName("url")).and(attributeValueInFxml),
|
||||
new JavaFxLocationReferenceProvider(false, "png"));
|
||||
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.URL))
|
||||
.andNot(XmlPatterns.xmlAttributeValue().withValue(string().matches("^http(s)?://.*")))
|
||||
.and(attributeValueInFxml),
|
||||
new JavaFxLocationReferenceProvider(false, "png", "jpg", "gif", "bmp"));
|
||||
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.STYLESHEETS)).and(attributeValueInFxml),
|
||||
new JavaFxLocationReferenceProvider(true, "css"));
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<VBox>
|
||||
<ImageView>
|
||||
<Image url="https://upload.wikimedia.org/wikipedia/commons/b/b5/Kotlin-logo.png" />
|
||||
</ImageView>
|
||||
<ImageView>
|
||||
<image>
|
||||
<Image url="http://thedeliciousrevolution.com/wp-content/uploads/2008/08/Pears.png"/>
|
||||
</image>
|
||||
</ImageView>
|
||||
<ImageView>
|
||||
<image>
|
||||
<Image url="https://upload.wikimedia.org/wikipedia/commons/a/aa/SmallFullColourGIF.gif "/>
|
||||
</image>
|
||||
</ImageView>
|
||||
</VBox>
|
||||
Reference in New Issue
Block a user