Search in sources :

Example 46 with WebView

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();
}
Also used : Alert(javafx.scene.control.Alert) WebView(javafx.scene.web.WebView)

Example 47 with WebView

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);
}
Also used : Label(javafx.scene.control.Label) WebView(javafx.scene.web.WebView) VBox(javafx.scene.layout.VBox) URL(java.net.URL)

Example 48 with WebView

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();
}
Also used : Button(javafx.scene.control.Button) OperatingSystem(org.phoenicis.entities.OperatingSystem) javafx.scene.layout(javafx.scene.layout) MappedList(org.phoenicis.javafx.collections.MappedList) FXCollections(javafx.collections.FXCollections) DoubleProperty(javafx.beans.property.DoubleProperty) Bindings(javafx.beans.binding.Bindings) InvalidationListener(javafx.beans.InvalidationListener) ErrorDialog(org.phoenicis.javafx.dialogs.ErrorDialog) ScrollPane(javafx.scene.control.ScrollPane) URI(java.net.URI) Tooltip(javafx.scene.control.Tooltip) SkinBase(org.phoenicis.javafx.components.common.skin.SkinBase) WebView(javafx.scene.web.WebView) Label(javafx.scene.control.Label) Value(org.graalvm.polyglot.Value) FilteredList(javafx.collections.transformation.FilteredList) Localisation.tr(org.phoenicis.configuration.localisation.Localisation.tr) Observable(javafx.beans.Observable) ApplicationInformationPanel(org.phoenicis.javafx.components.application.control.ApplicationInformationPanel) ApplicationDTO(org.phoenicis.repository.dto.ApplicationDTO) Platform(javafx.application.Platform) Installer(org.phoenicis.scripts.Installer) ImageView(javafx.scene.image.ImageView) SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) OperatingSystemFetcher(org.phoenicis.tools.system.OperatingSystemFetcher) ObservableList(javafx.collections.ObservableList) Image(javafx.scene.image.Image) ScriptDTO(org.phoenicis.repository.dto.ScriptDTO) ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) WebView(javafx.scene.web.WebView) Observable(javafx.beans.Observable)

Example 49 with WebView

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);
}
Also used : WebView(javafx.scene.web.WebView) Scene(javafx.scene.Scene)

Example 50 with WebView

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;
}
Also used : DialogPane(javafx.scene.control.DialogPane) Alert(javafx.scene.control.Alert) WebView(javafx.scene.web.WebView)

Aggregations

WebView (javafx.scene.web.WebView)50 Scene (javafx.scene.Scene)31 WebEngine (javafx.scene.web.WebEngine)15 BorderPane (javafx.scene.layout.BorderPane)10 Button (javafx.scene.control.Button)9 URL (java.net.URL)8 ObservableValue (javafx.beans.value.ObservableValue)7 Label (javafx.scene.control.Label)7 Tooltip (javafx.scene.control.Tooltip)7 StackPane (javafx.scene.layout.StackPane)6 VBox (javafx.scene.layout.VBox)6 Stage (javafx.stage.Stage)6 State (javafx.concurrent.Worker.State)5 JFXPanel (javafx.embed.swing.JFXPanel)5 ScrollPane (javafx.scene.control.ScrollPane)5 JFrame (javax.swing.JFrame)5 URI (java.net.URI)4 InvalidationListener (javafx.beans.InvalidationListener)4 FXCollections (javafx.collections.FXCollections)4 javafx.scene.layout (javafx.scene.layout)4