Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,15 @@ private String getConventionalName() {
* @return the bundle name
*/
private String getBundleName() {
if (!StringUtils.isEmpty(annotation)) {
final String lbundle = annotation.bundle();
LOGGER.debug("Annotated bundle: {}", lbundle);
return lbundle;
} else {
if (StringUtils.isEmpty(annotation.bundle())) {
final String lbundle = getClass().getPackage().getName() + "." + getConventionalName();
LOGGER.debug("Bundle: {} based on conventional name.", lbundle);
return lbundle;
}

final String lbundle = annotation.bundle();
LOGGER.debug("Annotated bundle: {}", lbundle);
return lbundle;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import javafx.scene.control.Button;
@RunWith(SpringRunner.class)
@SpringBootTest
public class AnnotatedUnconventionalName extends GuiTest {
public class AnnotatedUnconventionalNameTest extends GuiTest {

@Autowired
private Annotated buttonsView;
Expand All @@ -25,12 +25,13 @@ public void constructView() throws Exception {
init(buttonsView);
}

@Test
/*
/*
* Asserts that we can find a view if the class name doesn't end with 'view'
* see https://github.com/roskenet/springboot-javafx-support/issues/38
*/
@Test
public void showsI18nText() throws Exception {
Button theButton = (Button) find("#theButton");
assertThat(theButton.getText(), is("The Button Text"));
assertThat(theButton.getText(), is("The default Button Text"));
}
}
2 changes: 1 addition & 1 deletion src/test/resources/jfxtest/annotated/annotated.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button fx:id="theButton" layoutX="262.0" layoutY="187.0" mnemonicParsing="false" text="The Button Text" />
<Button fx:id="theButton" layoutX="262.0" layoutY="187.0" mnemonicParsing="false" text="%thebuttontext" />
</children>
</Pane>
1 change: 1 addition & 0 deletions src/test/resources/jfxtest/annotated/annotated.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
thebuttontext=The default Button Text