use of javafx.scene.web.WebView in project BlocklyArduinoIDEPlugin by technologiescollege.
the class Launcher method showWhatsNewDialog.
private void showWhatsNewDialog(String whatsNewPage) {
WebView view = new WebView();
view.getEngine().load(Launcher.class.getResource(whatsNewPage).toExternalForm());
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("What's new");
alert.setHeaderText("New in this update");
alert.getDialogPane().setContent(view);
alert.showAndWait();
}
use of javafx.scene.web.WebView in project POL-POM-5 by PhoenicisOrg.
the class StepRepresentationHtmlPresentation method drawStepContent.
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
WebView webView = new WebView();
VBox.setVgrow(webView, Priority.ALWAYS);
webView.getEngine().loadContent(htmlToShow);
final URL style = getClass().getResource(String.format("/org/phoenicis/javafx/themes/%s/description.css", getParent().getThemeManager().getCurrentTheme().getShortName()));
webView.getEngine().setUserStyleSheetLocation(style.toString());
contentPane.getChildren().addAll(webView);
getParent().getRoot().setCenter(contentPane);
}
use of javafx.scene.web.WebView in project POL-POM-5 by PhoenicisOrg.
the class ApplicationInformationPanelSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final WebView appDescription = new WebView();
appDescription.getEngine().userStyleSheetLocationProperty().bind(getControl().webEngineStylesheetProperty());
VBox.setVgrow(appDescription, Priority.ALWAYS);
getControl().applicationProperty().addListener((Observable invalidation) -> updateDescription(appDescription));
updateDescription(appDescription);
final Label installers = new Label(tr("Installers"));
installers.getStyleClass().add("descriptionTitle");
final GridPane scriptGrid = new GridPane();
filteredScripts.addListener((InvalidationListener) change -> updateScripts(scriptGrid));
getControl().showScriptSourceProperty().addListener((Observable invalidation) -> updateScripts(scriptGrid));
updateScripts(scriptGrid);
final HBox miniaturesPane = new HBox();
miniaturesPane.getStyleClass().add("appPanelMiniaturesPane");
Bindings.bindContent(miniaturesPane.getChildren(), miniatures);
final ScrollPane miniaturesPaneWrapper = new ScrollPane(miniaturesPane);
miniaturesPaneWrapper.getStyleClass().add("appPanelMiniaturesPaneWrapper");
miniatureHeight.bind(miniaturesPaneWrapper.heightProperty().multiply(0.8));
final VBox container = new VBox(appDescription, installers, scriptGrid, miniaturesPaneWrapper);
getChildren().add(container);
// ensure that the content of the details panel changes when the to be shown application changes
getControl().applicationProperty().addListener((Observable invalidation) -> updateApplication());
// initialise the content of the details panel correct
updateApplication();
}
use of javafx.scene.web.WebView in project tray by qzind.
the class WebApp method start.
@Override
public void start(Stage st) throws Exception {
startupLatch.countDown();
log.debug("Started JavaFX");
webView = new WebView();
// See also https://github.com/qzind/tray/issues/778
if (getWebkitVersion() == null || getWebkitVersion().greaterThan(Version.forIntegers(609, 1, 0))) {
// 30 pulses needed for vector graphics
VECTOR_FRAMES = 30;
}
st.setScene(new Scene(webView));
stage = st;
stage.setWidth(1);
stage.setHeight(1);
Worker<Void> worker = webView.getEngine().getLoadWorker();
worker.stateProperty().addListener(stateListener);
worker.workDoneProperty().addListener(workDoneListener);
worker.exceptionProperty().addListener(exceptListener);
// prevents JavaFX from shutting down when hiding window
Platform.setImplicitExit(false);
}
use of javafx.scene.web.WebView in project sis by apache.
the class OptionalDataDownloader method askUserAgreement.
/**
* Asks to the user if (s)he agree to download and install the resource for the given authority.
* This method may be invoked twice for the same {@code authority} argument:
* first with a null {@code license} argument for asking if the user agrees to download the data,
* then with a non-null {@code license} argument for asking if the user agrees with the license terms.
*/
@Override
protected boolean askUserAgreement(final String authority, final String license) {
if (!Platform.isFxApplicationThread()) {
return BackgroundThreads.runAndWait(() -> {
return askUserAgreement(authority, license);
});
}
final Resources resources = Resources.forLocale(getLocale());
final Alert dialog;
dialog = new Alert(Alert.AlertType.CONFIRMATION, null, ButtonType.NO, ButtonType.YES);
dialog.initOwner(DataViewer.getCurrentStage());
dialog.setTitle(resources.getString(Resources.Keys.GeodeticDataset_1, authority));
dialog.setResizable(true);
if (license == null) {
dialog.getDialogPane().setPrefWidth(600);
dialog.setHeaderText(resources.getString(Resources.Keys.DownloadAndInstall_1, authority));
dialog.setContentText(resources.getString(Resources.Keys.DownloadDetails_3, authority, getSpaceRequirement(authority), destinationDirectory));
} else {
final WebView content = new WebView();
content.getEngine().loadContent(license);
final DialogPane pane = dialog.getDialogPane();
pane.setContent(content);
pane.setPrefWidth(800);
pane.setPrefHeight(600);
dialog.setHeaderText(resources.getString(Resources.Keys.LicenseAgreement));
}
return accepted = dialog.showAndWait().orElse(ButtonType.NO) == ButtonType.YES;
}
Aggregations