Class DesignerUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil
-
public final class DesignerUtil extends java.lang.Object
- Since:
- 6.0.0
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static net.sourceforge.pmd.lang.LanguageVersion
defaultLanguageVersion()
static java.lang.String
defaultXPathVersion()
static java.net.URL
getFxml(java.lang.String simpleName)
Gets the URL to an fxml file from its simple name.static net.sourceforge.pmd.lang.LanguageVersion
getLanguageVersionFromExtension(java.lang.String filename)
static java.io.File
getSettingsFile()
Name of the designer's settings file.static java.util.List<net.sourceforge.pmd.lang.LanguageVersion>
getSupportedLanguageVersions()
static javafx.util.StringConverter<net.sourceforge.pmd.lang.LanguageVersion>
languageVersionStringConverter()
static <T> void
rewire(javafx.beans.property.Property<T> underlying, javafx.beans.value.ObservableValue<? extends T> source)
Like rewire, with no initialisation.static <T> void
rewire(javafx.beans.property.Property<T> underlying, javafx.beans.value.ObservableValue<? extends T> ui, java.util.function.Consumer<? super T> setter)
Binds the underlying property to a source of values.static <T> javafx.util.Callback<javafx.scene.control.ListView<T>,javafx.scene.control.ListCell<T>>
simpleListCellFactory(java.util.function.Function<T,java.lang.String> converter, java.util.function.Function<T,java.lang.String> toolTipMaker)
static java.util.Optional<java.lang.String>
stackTraceToXPath(java.lang.String stackTrace)
Works out an xpath query that matches the node which was being visited during the failure.static java.util.Optional<java.lang.String>
stackTraceToXPath(java.lang.Throwable e)
Works out an xpath query that matches the node which was being visited during the failure.static <T> javafx.util.StringConverter<T>
stringConverter(java.util.function.Function<T,java.lang.String> toString, java.util.function.Function<java.lang.String,T> fromString)
-
-
-
Method Detail
-
defaultXPathVersion
public static java.lang.String defaultXPathVersion()
-
defaultLanguageVersion
public static net.sourceforge.pmd.lang.LanguageVersion defaultLanguageVersion()
-
getFxml
public static java.net.URL getFxml(java.lang.String simpleName)
Gets the URL to an fxml file from its simple name.- Parameters:
simpleName
- Simple name of the file, i.e. with no directory prefixes- Returns:
- A URL to an fxml file
-
getSettingsFile
public static java.io.File getSettingsFile()
Name of the designer's settings file.- Returns:
- The name
-
simpleListCellFactory
public static <T> javafx.util.Callback<javafx.scene.control.ListView<T>,javafx.scene.control.ListCell<T>> simpleListCellFactory(java.util.function.Function<T,java.lang.String> converter, java.util.function.Function<T,java.lang.String> toolTipMaker)
-
stringConverter
public static <T> javafx.util.StringConverter<T> stringConverter(java.util.function.Function<T,java.lang.String> toString, java.util.function.Function<java.lang.String,T> fromString)
-
languageVersionStringConverter
public static javafx.util.StringConverter<net.sourceforge.pmd.lang.LanguageVersion> languageVersionStringConverter()
-
getLanguageVersionFromExtension
public static net.sourceforge.pmd.lang.LanguageVersion getLanguageVersionFromExtension(java.lang.String filename)
-
getSupportedLanguageVersions
public static java.util.List<net.sourceforge.pmd.lang.LanguageVersion> getSupportedLanguageVersions()
-
rewire
public static <T> void rewire(javafx.beans.property.Property<T> underlying, javafx.beans.value.ObservableValue<? extends T> ui, java.util.function.Consumer<? super T> setter)
Binds the underlying property to a source of values. The source property is also initialised using the setter.- Type Parameters:
T
- Type of values- Parameters:
underlying
- The underlying propertyui
- The property exposed to the user (the one in this wizard)setter
- Setter to initialise the UI value
-
rewire
public static <T> void rewire(javafx.beans.property.Property<T> underlying, javafx.beans.value.ObservableValue<? extends T> source)
Like rewire, with no initialisation.
-
stackTraceToXPath
public static java.util.Optional<java.lang.String> stackTraceToXPath(java.lang.String stackTrace)
Works out an xpath query that matches the node which was being visited during the failure.The query selects nodes that have exactly the same ancestors than the node in which the last call from the stack trace.
- Parameters:
stackTrace
- full stack trace- Returns:
- An xpath expression if possible
-
stackTraceToXPath
public static java.util.Optional<java.lang.String> stackTraceToXPath(java.lang.Throwable e)
Works out an xpath query that matches the node which was being visited during the failure.- Parameters:
e
- Exception- Returns:
- A query, if possible.
- See Also:
stackTraceToXPath(String)
-
-