public Browser() { super(); Platform.runLater(() -> { browser = new WebView(); webEngine = browser.getEngine(); getChildren().add(browser); }); } }
public InlineHTML() { getStyleClass().add("inline-html"); view = new WebView(); getChildren().add(view); content.addListener((observable, oldValue, newValue) -> view.getEngine().loadContent(newValue)); }
} catch (ClassNotFoundException ignore) { v = new WebView(); BorderPane bp = new BorderPane(); Scene scene = new Scene(bp, Color.ALICEBLUE);
WebView view = new WebView(); view.setCache(false); StackPane root = new StackPane();
private void createScene(final String htmlContent) { Platform.setImplicitExit(false); Platform.runLater(() -> { WebView view = new WebView(); engine = view.getEngine(); engine.setOnStatusChanged(event -> SwingUtilities.invokeLater(() -> lblStatus.setText(event.getData()))); engine.getLoadWorker().workDoneProperty() .addListener((ChangeListener<Number>) (observableValue, oldValue, newValue) -> SwingUtilities .invokeLater(() -> progressBar.setValue(newValue.intValue()))); engine.getLoadWorker().exceptionProperty() .addListener((ObservableValue<? extends Throwable> o, Throwable old, final Throwable value) -> { if (engine.getLoadWorker().getState() == State.FAILED) { SwingUtilities.invokeLater(() -> JOptionPane .showMessageDialog( resultsScrollPane, (value != null) ? engine .getLocation() + "\n" + value.getMessage() : engine.getLocation() + "\nUnexpected error.", "Loading error...", JOptionPane.ERROR_MESSAGE)); } }); jfxPanel.setScene(new Scene(view)); }); }
public HTMLTab(TabManager tabManager, Locale locale) { super(tabManager); browser = new WebView();
@Override public WebEngine call(PopupFeatures param) { final Stage stage = new Stage(StageStyle.UTILITY); stage.initOwner(owner); final WebView popUpView = new WebView(); stage.setScene(new Scene(popUpView)); Title.observeView(popUpView, stage); stage.show(); return popUpView.getEngine(); } });
protected void buildCenterArea() { HBox firtsRow = new HBox(); firtsRow.getChildren().addAll(date, NodeHelper.horizontalSpacer()); centerContainer.getStyleClass().add("notification-view-center-container"); centerContainer.getChildren().addAll(firtsRow, title, actionsContainer); title.getStyleClass().add("notification-title"); date.getStyleClass().add("notification-date"); deleteAction.setVisible(true); if (notification.getContentType().equals("text/plain")) { message.getStyleClass().add("notification-message"); // centerContainer.getChildren().add(message); } else { Platform.runLater(() -> { WebView browser = new WebView(); WebEngine webEngine = browser.getEngine(); webEngine.loadContent( "<body style=\"background-color:#757575\">\r\n" + "\r\n" + "<p>\r\n" + " <span\r\n" + " style=\"color:white;font-family: 'Open sans', 'Arial', sans-serif; font-size: 10px\">\r\n" + " Le job a été executé avec succès</span>\r\n" + "</p>\r\n" + "</body>\r\n" + ""); // Add the WebView to the VBox // centerContainer.getChildren().add(browser); }); } }
/** * {@inheritDoc} */ @Override protected void process() { super.process(); try { String location = "www.google.com"; OperationData data = getStructureContent().formModelDataProperty().get(); javafx.application.Platform.runLater(()->{ WebView webView = new WebView(); webView.getEngine().load(location); layout.getChildren().add(webView); }); }catch (Exception e) { e.printStackTrace(); unsupported(); } processedView(layout); }
/** * {@inheritDoc} */ @Override protected void process() { super.process(); try { String location = null; OperationData data = getStructureContent().formModelDataProperty().get(); if(location != null) { javafx.application.Platform.runLater(()->{ WebView webView = new WebView(); webView.getEngine().load(location); layout.getChildren().add(webView); }); } }catch (Exception e) { e.printStackTrace(); unsupported(); } processedView(layout); }
@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); }
protected WebView createWebView() { try { final WebView webView = new WebView(); double browserScaleFactor = getBrowserScaleFactor(); if (browserScaleFactor != 1.0)
Runnable initWebView = () -> { try { WebView browser = new WebView(); webEngine = browser.getEngine();
private WebView newView(final URL url, final FXPresenter onLoad) { final WebView view = new WebView(); view.setContextMenuEnabled(false); view.getEngine().setOnAlert(new EventHandler<WebEvent<String>>() {
final Callback<ImageView, Void> callback, final WritableImage outputImage) { final WebView view = new WebView(); final WebEngine eng = view.getEngine();
/** * {@inheritDoc} */ @Override protected Node createContent() { 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)); return new VBox(appDescription, installers, scriptGrid, miniaturesPaneWrapper); }
private WebView newView(final URL url, final AbstractFXPresenter onLoad) { final WebView view = new WebView(); view.setContextMenuEnabled(false); Stage newStage;
final Stage stage = new Stage(StageStyle.UTILITY); stage.initOwner(owner); final WebView popUpView = new WebView(); stage.setScene(new Scene(popUpView)); Title.observeView(popUpView, stage);