Made MWebView return Object, not String.
authorMarco Zanon <info@marcozanon.com>
Sun, 11 Mar 2012 11:59:30 +0000 (11:59 +0000)
committerMarco Zanon <info@marcozanon.com>
Sun, 11 Mar 2012 11:59:30 +0000 (11:59 +0000)
src/java/com/marcozanon/macaco/web/ui/MWebBrowserPage.java
src/java/com/marcozanon/macaco/web/ui/MWebView.java

index 64690dd182c02ede98f3ac2153b81890e600b3b8..14b35c58b7f74308614d33b3734d807a1c17f173 100644 (file)
@@ -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).");
         }
index 1432e108d010b75eda98f7a47c1a04392adc6e4f..9453b78b91c144a02f94384d2b919edb5fa008d2 100644 (file)
@@ -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...");
     }