javafx: accept resources/charset in fx:include attributes

This commit is contained in:
anna
2013-03-28 12:32:19 +01:00
parent 014605459f
commit f4b3f6ca4d
3 changed files with 13 additions and 2 deletions
@@ -307,6 +307,12 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase {
doTest();
}
public void testCharsetInInclude() throws Exception {
myFixture.addFileToProject("sample.fxml", "<?import javafx.scene.layout.GridPane?>\n" +
"<fx:root type=\"javafx.scene.layout.GridPane\" xmlns:fx=\"http://javafx.com/fxml\"/>\n");
myFixture.testHighlighting(true, false, false, getTestName(true) + ".fxml");
}
public void testIncludedForm() throws Exception {
myFixture.addFileToProject("sample.fxml", "<?import javafx.scene.layout.GridPane?>\n" +
"<fx:root type=\"javafx.scene.layout.GridPane\" xmlns:fx=\"http://javafx.com/fxml\"/>\n");
@@ -41,7 +41,9 @@ public class FxmlConstants {
@NonNls public static final String FX_INCLUDE = "fx:include";
@NonNls public static final String FX_ROOT = "fx:root";
@NonNls public static final String TYPE = "type";
@NonNls public static final String RESOURCES = "resources";
@NonNls public static final String CHARSET = "charset";
@NonNls public static final String STYLE_CLASS = "styleClass";
@NonNls public static final String STYLESHEETS = "stylesheets";
@@ -52,7 +54,7 @@ public class FxmlConstants {
public static final Map<String, List<String>> FX_ELEMENT_ATTRIBUTES = new HashMap<String, List<String>>();
static {
FX_ELEMENT_ATTRIBUTES.put(FX_INCLUDE, Arrays.asList(FX_ELEMENT_SOURCE, FX_ID));
FX_ELEMENT_ATTRIBUTES.put(FX_INCLUDE, Arrays.asList(FX_ELEMENT_SOURCE, FX_ID, RESOURCES, CHARSET));
FX_ELEMENT_ATTRIBUTES.put(FX_REFERENCE, Arrays.asList(FX_ELEMENT_SOURCE));
FX_ELEMENT_ATTRIBUTES.put(FX_SCRIPT, Arrays.asList(FX_ELEMENT_SOURCE));
FX_ELEMENT_ATTRIBUTES.put(FX_ROOT, Arrays.asList(TYPE));
@@ -0,0 +1,3 @@
<fx:root type="javafx.scene.layout.GridPane" xmlns:fx="http://javafx.com/fxml">
<fx:include source="sample.fxml" charset="UTF-8"/>
</fx:root>