1.1 --- a/boot-fx/src/main/java/org/netbeans/html/boot/fx/AbstractFXPresenter.java Wed Aug 26 08:32:24 2015 +0200
1.2 +++ b/boot-fx/src/main/java/org/netbeans/html/boot/fx/AbstractFXPresenter.java Sat Aug 29 01:43:59 2015 +0200
1.3 @@ -165,19 +165,19 @@
1.4 } catch (Throwable ex) {
1.5 ex.printStackTrace();
1.6 }
1.7 + final boolean isFirebugOn = Boolean.getBoolean("firebug.lite"); // NOI18N
1.8 final boolean isInspectOn = inspectOn;
1.9 -
1.10 class Run implements Runnable {
1.11
1.12 @Override
1.13 public void run() {
1.14 - if (isInspectOn) {
1.15 + if (isInspectOn || isFirebugOn) {
1.16 view.setContextMenuEnabled(true);
1.17 final Parent p = view.getParent();
1.18 if (p instanceof BorderPane) {
1.19 BorderPane bp = (BorderPane) p;
1.20 if (bp.getTop() == null) {
1.21 - bp.setTop(new FXToolbar(view, bp));
1.22 + bp.setTop(new FXToolbar(view, bp, isFirebugOn));
1.23 }
1.24 }
1.25 }
2.1 --- a/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXToolbar.java Wed Aug 26 08:32:24 2015 +0200
2.2 +++ b/boot-fx/src/main/java/org/netbeans/html/boot/fx/FXToolbar.java Sat Aug 29 01:43:59 2015 +0200
2.3 @@ -67,6 +67,7 @@
2.4 import javafx.scene.image.Image;
2.5 import javafx.scene.image.ImageView;
2.6 import javafx.scene.layout.BorderPane;
2.7 +import javafx.scene.web.WebEngine;
2.8 import javafx.scene.web.WebView;
2.9 import javafx.stage.Screen;
2.10 import javafx.stage.Stage;
2.11 @@ -80,7 +81,7 @@
2.12 private final ComboBox<String> comboZoom = new ComboBox<String>();
2.13 private WatchDir watcher;
2.14
2.15 - FXToolbar(WebView wv, BorderPane container) {
2.16 + FXToolbar(WebView wv, BorderPane container, boolean enableFirebug) {
2.17 this.webView = wv;
2.18 this.container = container;
2.19
2.20 @@ -151,6 +152,17 @@
2.21 listenOnChanges(automatic.isSelected());
2.22 }
2.23 });
2.24 + if (enableFirebug){
2.25 + final Button firebug = new Button("Firebug");
2.26 + getItems().add(firebug);
2.27 + firebug.setOnAction(new EventHandler<ActionEvent>() {
2.28 +
2.29 + @Override
2.30 + public void handle(ActionEvent event) {
2.31 + enableFirebug(webView.getEngine());
2.32 + firebug.setDisable(true);
2.33 + }
2.34 + });}
2.35 }
2.36
2.37 private String zoom( String zoomFactor ) {
2.38 @@ -418,4 +430,7 @@
2.39 FXInspect.LOG.log(Level.SEVERE, null, ex);
2.40 }
2.41 }
2.42 + private static void enableFirebug(final WebEngine engine) {
2.43 + engine.executeScript("if (!document.getElementById('FirebugLite')){E = document['createElement' + 'NS'] && document.documentElement.namespaceURI;E = E ? document['createElement' + 'NS'](E, 'script') : document['createElement']('script');E['setAttribute']('id', 'FirebugLite');E['setAttribute']('src', 'https://getfirebug.com/' + 'firebug-lite.js' + '#startOpened');E['setAttribute']('FirebugLite', '4');(document['getElementsByTagName']('head')[0] || document['getElementsByTagName']('body')[0]).appendChild(E);E = new Image;E['setAttribute']('src', 'https://getfirebug.com/' + '#startOpened');}");
2.44 + }
2.45 }
3.1 --- a/src/main/javadoc/overview.html Wed Aug 26 08:32:24 2015 +0200
3.2 +++ b/src/main/javadoc/overview.html Sat Aug 29 01:43:59 2015 +0200
3.3 @@ -81,6 +81,11 @@
3.4 when connecting to server using the {@link net.java.html.json.OnReceive}
3.5 annotation. It is possible to have
3.6 {@link net.java.html.json.ComputedProperty#write() writable computed properties}.
3.7 + There is an easy way to enable <a target="_blank" href="http://getfirebug.com/">Firebug</a> in
3.8 + the JavaFX based Web View -
3.9 + just run with <code>-Dfirebug.lite=true</code> as
3.10 + <a target="_blank" href="https://www.youtube.com/watch?v=2rxwY-QJiLo">this video</a>
3.11 + demonstrates.
3.12 Bugfix of issues <a target="_blank" href='https://netbeans.org/bugzilla/show_bug.cgi?id=250503'>250503</a>,
3.13 <a target="_blank" href='https://netbeans.org/bugzilla/show_bug.cgi?id=252987'>252987</a>.
3.14