From: Marco Zanon Date: Sun, 11 Mar 2012 11:59:30 +0000 (+0000) Subject: Made MWebView return Object, not String. X-Git-Tag: SVN-to-Git~151 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=12004512da68311da6e9f6c3da4ec4fb4c28da65;p=Macaco Made MWebView return Object, not String. --- diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebBrowserPage.java b/src/java/com/marcozanon/macaco/web/ui/MWebBrowserPage.java index 64690dd..14b35c5 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebBrowserPage.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebBrowserPage.java @@ -22,7 +22,7 @@ public abstract class MWebBrowserPage extends MObject { protected String author = ""; protected String cssSource = null; - protected String lastViewThreadReturnValue = null; + protected Object lastViewThreadReturnValue = null; protected Exception lastViewThreadException = null; protected MWebMessage processableMessage = null; protected Object stoppingViewThreadCountMutexObject = new Object(); @@ -97,11 +97,11 @@ public abstract class MWebBrowserPage extends MObject { /* Views threads */ - protected void setLastViewThreadReturnValue(String lastViewThreadReturnValue) { + protected void setLastViewThreadReturnValue(Object lastViewThreadReturnValue) { this.lastViewThreadReturnValue = lastViewThreadReturnValue; } - protected String getLastViewThreadReturnValue() { + protected Object getLastViewThreadReturnValueReference() { return this.lastViewThreadReturnValue; } @@ -196,7 +196,7 @@ public abstract class MWebBrowserPage extends MObject { } } - protected void unloadViewThreads(String lastViewThreadReturnValue, int viewThreadCount, MWebView replacingView) throws MViewNotUnloadableWebException { + protected void unloadViewThreads(Object lastViewThreadReturnValue, int viewThreadCount, MWebView replacingView) throws MViewNotUnloadableWebException { if ((null == lastViewThreadReturnValue) && (viewThreadCount < 1) && (null == replacingView)) { throw new IllegalArgumentException("Invalid call mode: (null, < 1, null)."); } diff --git a/src/java/com/marcozanon/macaco/web/ui/MWebView.java b/src/java/com/marcozanon/macaco/web/ui/MWebView.java index 1432e10..9453b78 100644 --- a/src/java/com/marcozanon/macaco/web/ui/MWebView.java +++ b/src/java/com/marcozanon/macaco/web/ui/MWebView.java @@ -68,7 +68,7 @@ public class MWebView extends MObject implements Runnable { } } - public String openView(MWebView view) throws MNoBrowserPageWebException { + public Object openView(MWebView view) throws MNoBrowserPageWebException { this.getBrowserPageReference().loadViewThread(view); try { synchronized (Thread.currentThread()) { @@ -93,10 +93,10 @@ public class MWebView extends MObject implements Runnable { catch (MResponseWebException exception) { } // - return this.getBrowserPageReference().getLastViewThreadReturnValue(); + return this.getBrowserPageReference().getLastViewThreadReturnValueReference(); } - public void close(String returnValue) throws MNoBrowserPageWebException, MViewNotUnloadableWebException { + public void close(Object returnValue) throws MNoBrowserPageWebException, MViewNotUnloadableWebException { this.getBrowserPageReference().unloadViewThreads(returnValue, 1, null); throw new MViewThreadStoppingWebRuntimeException("View thread stopping..."); }