com.github.fge.grappa.debugger.javafx.JavafxView Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grappa-debugger Show documentation
Show all versions of grappa-debugger Show documentation
GUI application to debug grappa parsers
The newest version!
package com.github.fge.grappa.debugger.javafx;
import com.github.fge.grappa.internal.NonFinalForTesting;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javax.annotation.ParametersAreNonnullByDefault;
import java.io.IOException;
import java.net.URL;
@ParametersAreNonnullByDefault
public abstract class JavafxView>
{
protected final Node node;
protected final D display;
protected JavafxView(final String fxmlLocation)
throws IOException
{
final URL url = JavafxView.class.getResource(fxmlLocation);
if (url == null)
throw new IOException(fxmlLocation + ": resource not found");
final FXMLLoader loader = new FXMLLoader(url);
node = loader.load();
display = loader.getController();
}
@SuppressWarnings("unchecked")
@NonFinalForTesting
public T getNode()
{
return (T) node;
}
@NonFinalForTesting
public D getDisplay()
{
return display;
}
}