private void goBack() { fxView.getNavigationContext().back(); }
private void goForward() { fxView.getNavigationContext().forward(); }
@Override public ReadOnlyStringProperty titleProperty() { return webfx.getCurrentViewTitleProperty(); }
public void openPage(String location) { final URL url; try { url = URLVerifier.verifyURL(location); } catch (MalformedURLException ex) { Logger.getLogger(BrowserFXController.class.getName()).log(Level.SEVERE, null, ex); return; } URLHandler urlHandler = URLHandlersRegistry.getHandler(url); if (urlHandler == null) { return; } Platform.runLater(() -> { URLHandler.Result handleResult = urlHandler.handle(url); if (handleResult.contentDescriptor != ContentDescriptor.NoContent.instance()) { BrowserTab browserTab = TabFactory.newTab(this, locale, handleResult.contentDescriptor); browserTab.getNavigationContext().goTo(url); selectionTab.getSelectedItem().contentProperty().bind(browserTab.contentProperty()); browserMap.put(selectionTab.getSelectedIndex(), browserTab); // if(!urlField.isFocused()){ urlField.textProperty().bind(browserTab.locationProperty()); // } stopButton.disableProperty().set(!browserTab.isStoppable()); selectionTab.getSelectedItem().textProperty().bind(browserTab.titleProperty()); } }); }
String url = System.getProperty("webfx.url"); if (url == null) { fxView = new WebFXRegion(); LOGGER.warning("No URL specified in CLI with -Dwebfx.url. You must connect through the MBean and invoke a URL."); } else { fxView = new WebFXRegion(new URL(url)); int screenHeight = Integer.parseInt(System.getProperty("webfx.height", String.valueOf(DEFAULT_HEIGHT))); startMBeanServer(fxView); fxView.setOnKeyPressed(e -> { KeyCode keyCode = e.getCode(); if (keyCode.equals(KeyCode.F5) || (keyCode.equals(KeyCode.R) && e.isControlDown())) { reload(); goBack(); goForward(); fxView.getCurrentViewTitleProperty().addListener((a, b, c) -> { primaryStage.setTitle(c); });
JSObjectFX.enableAppletSupport(browser); try { final URL href = new URL(hrefObj.getHref()); if (new URLVerifier(href).getContentDescriptor() != ContentDescriptor.HTML.instance()) { getTabManager().openInNewTab(href); event.preventDefault();
public void forward() { selectedBrowserTab().getNavigationContext().forward(); }
public void back() { selectedBrowserTab().getNavigationContext().back(); }
@Override public void load(String url) { Platform.runLater(() -> { try { webfx.getNavigationContext().goTo(new URL(url)); } catch (MalformedURLException ex) { Logger.getLogger(DeckServer.class.getName()).log(Level.SEVERE, null, ex); } }); }
public void reload() { selectedBrowserTab().getNavigationContext().reload(); }
public FXTab(TabManager tabManager, Locale locale) { super(tabManager); webfx = new WebFXRegion(); contentProperty.set(webfx); webfx.setLocale(locale); }
@Override public NavigationContext getNavigationContext() { return webfx.getNavigationContext(); }
@Override public void goTo(String url) { super.goTo(url); //To change body of generated methods, choose Tools | Templates. }
private void reload() { fxView.load(); }
@Override public ReadOnlyStringProperty locationProperty() { return webfx.urlProperty(); }
@Override public void goTo(URL url) { super.goTo(url); //To change body of generated methods, choose Tools | Templates. }