mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Javafx: Allow fx:value attribute's value to start with $ character. Test added (IDEA-154239)
This commit is contained in:
+4
@@ -370,6 +370,10 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testLiteralValue() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFactoryMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ public class JavaFxBuiltInAttributeDescriptor extends JavaFxPropertyAttributeDes
|
||||
return "Unable to coerce '" + value + "' to " + tagClass.getQualifiedName() + ".";
|
||||
}
|
||||
}
|
||||
return super.validateAttributeValue(xmlAttributeValue, value);
|
||||
return validateLiteral(xmlAttributeValue, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ public class JavaFxPropertyAttributeDescriptor extends BasicXmlAttributeDescript
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String validateLiteral(@NotNull XmlAttributeValue xmlAttributeValue, @NotNull String value) {
|
||||
protected static String validateLiteral(@NotNull XmlAttributeValue xmlAttributeValue, @NotNull String value) {
|
||||
final PsiClass tagClass = JavaFxPsiUtil.getTagClass(xmlAttributeValue);
|
||||
final PsiElement declaration = JavaFxPsiUtil.getAttributeDeclaration(xmlAttributeValue);
|
||||
final String boxedQName;
|
||||
|
||||
+5
@@ -26,6 +26,7 @@ import com.intellij.psi.util.InheritanceUtil;
|
||||
import com.intellij.psi.util.PropertyUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlAttributeValue;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -48,6 +49,10 @@ class JavaFxComponentIdReferenceProvider extends PsiReferenceProvider {
|
||||
@Override
|
||||
public PsiReference[] getReferencesByElement(@NotNull PsiElement element,
|
||||
@NotNull ProcessingContext context) {
|
||||
final PsiElement parent = element.getParent();
|
||||
if (parent instanceof XmlAttribute && FxmlConstants.FX_VALUE.equals(((XmlAttribute)parent).getName())) {
|
||||
return PsiReference.EMPTY_ARRAY;
|
||||
}
|
||||
final XmlAttributeValue xmlAttributeValue = (XmlAttributeValue)element;
|
||||
final String value = xmlAttributeValue.getValue();
|
||||
if (JavaFxPsiUtil.isIncorrectExpressionBinding(value)) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import java.lang.String?>
|
||||
<VBox xmlns:fx="http://javafx.com/fxml">
|
||||
<Label>
|
||||
<String fx:value="$1000"/>
|
||||
</Label>
|
||||
<Label>
|
||||
<String fx:value="${name"/>
|
||||
</Label>
|
||||
</VBox>
|
||||
Reference in New Issue
Block a user