Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #654 from Jugen/patch-1
Add support for FXML (again)
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/FxmlTester.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.fxmisc.richtext.api; | ||
|
||
import java.io.IOException; | ||
import javafx.stage.Stage; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.fxml.LoadException; | ||
import org.fxmisc.richtext.RichTextFXTestBase; | ||
import org.junit.Test; | ||
|
||
public class FxmlTester extends RichTextFXTestBase { | ||
|
||
@Override | ||
public void start(Stage stage) throws Exception { | ||
// Nothing needed here | ||
} | ||
|
||
@Test | ||
public void test_fxml_construction_of_area() throws IOException, LoadException | ||
{ | ||
// FxmlTest.fxml is located in resources folder: | ||
// src/integrationTest/resources/org/fxmisc/richtext/api/ | ||
Object obj = FXMLLoader.load( getClass().getResource( "FxmlTest.fxml" ) ); | ||
// FXMLLoader will throw a LoadException if any properties failed to be set, | ||
// so if obj is not null then all properties are guaranteed to have been set. | ||
org.junit.Assert.assertNotNull( obj ); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
richtextfx/src/integrationTest/resources/org/fxmisc/richtext/api/FxmlTest.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.VBox?> | ||
<?import org.fxmisc.richtext.StyleClassedTextArea?> | ||
<?import javafx.scene.control.ContextMenu?> | ||
<?import javafx.scene.control.MenuItem?> | ||
|
||
<VBox xmlns:fx="http://javafx.com/fxml/1"> | ||
<StyleClassedTextArea editable="true" wrapText="true" autoScrollOnDragDesired="true" | ||
contextMenuXOffset="12.0" contextMenuYOffset="34.0" > | ||
<contextMenu> | ||
<ContextMenu> | ||
<items><MenuItem text="Test Item" /></items> | ||
</ContextMenu> | ||
</contextMenu> | ||
</StyleClassedTextArea> | ||
</VBox> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters