org.minifx.fxmlloading.configuration.FxmlLoadingConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minifx-fxml Show documentation
Show all versions of minifx-fxml Show documentation
JavaFX FXML loading by conventions.
/**
* Copyright (c) 2018 European Organisation for Nuclear Research (CERN), All Rights Reserved.
*/
package org.minifx.fxmlloading.configuration;
import java.net.URL;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public interface FxmlLoadingConfiguration {
default boolean hasFxmlResource() {
return (fxmlResource() != null);
}
default ResourceBundle resourceBundle() {
String baseBundleName = conventionalName();
if (packageName() != null) {
baseBundleName = packageName() + "." + conventionalName();
}
try {
return ResourceBundle.getBundle(baseBundleName);
} catch (MissingResourceException mre) {
return null;
}
}
URL fxmlResource();
URL cssResource();
String conventionalName();
String packageName();
}