From 8e7e147abfcdc5e3c177be377ff0ac53acf95674 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco MoƱino Date: Thu, 5 Dec 2013 18:19:43 +0100 Subject: Adding missing method in console --- .../src/main/java/com/google/gwt/query/client/Console.java | 5 +++++ .../java/com/google/gwt/query/client/impl/ConsoleBrowser.java | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/Console.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/Console.java index 66709908..52c71d35 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/Console.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/Console.java @@ -21,6 +21,11 @@ package com.google.gwt.query.client; */ public interface Console { + /** + * Clears the console. + */ + void clear(); + /** * Displays an interactive listing of the properties of a specified JavaScript object. This * listing lets you use disclosure triangles to examine the contents of child objects. diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java index 6f67fd95..ec63c852 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/ConsoleBrowser.java @@ -68,6 +68,10 @@ public class ConsoleBrowser implements Console { * Default implementation: webkit, opera, FF, ie10 */ private static class ConsoleImpl { + public native void clear() /*-{ + $wnd.console.clear(); + }-*/; + public native void dir(Object arg) /*-{ $wnd.console.dir(arg); }-*/; @@ -126,7 +130,12 @@ public class ConsoleBrowser implements Console { public ConsoleBrowser() { impl = GQuery.browser.ie8? new ConsoleIe8(): GQuery.browser.ie9? new ConsoleIe9(): new ConsoleImpl(); } - + + @Override + public void clear() { + impl.clear(); + } + @Override public void dir(Object arg) { impl.dir(toJs(arg)); -- cgit v1.2.3