INTEGRATION: CWS fwkpostbeta02 (1.6.128); FILE MERGED

2005/02/15 11:36:05 jl 1.6.128.1: #i41965# AppletExcecutionContext receives the 'document base' and not the document url
This commit is contained in:
Vladimir Glazounov 2005-02-21 15:54:05 +00:00
parent b90486b688
commit 82ad834efb

View File

@ -2,9 +2,9 @@
* *
* $RCSfile: AppletExecutionContext.java,v $ * $RCSfile: AppletExecutionContext.java,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: jl $ $Date: 2001-11-22 13:47:40 $ * last change: $Author: vg $ $Date: 2005-02-21 16:54:05 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -109,7 +109,7 @@ public final class AppletExecutionContext extends ExecutionContext
private String _className; private String _className;
private Vector _jarResourceProxys = new Vector(); private Vector _jarResourceProxys = new Vector();
private URL _documentURL = null; private URL _documentBase = null;
private URL _baseURL = null; private URL _baseURL = null;
private Toolkit _toolkit; private Toolkit _toolkit;
@ -127,21 +127,21 @@ public final class AppletExecutionContext extends ExecutionContext
} }
//************** C++ WRAPPER ****************** //************** C++ WRAPPER ******************
public AppletExecutionContext( URL documentURL, public AppletExecutionContext( URL documentBase,
Hashtable parameters, Hashtable parameters,
Container container, Container container,
long pCppJSbxObject) long pCppJSbxObject)
{ {
this(pCppJSbxObject); this(pCppJSbxObject);
if(DEBUG) System.err.println("#### AppletExecutionContext.<init>:" + documentURL + " " + parameters + " " + container + " " + pCppJSbxObject); if(DEBUG) System.err.println("#### AppletExecutionContext.<init>:" + documentBase + " " + parameters + " " + container + " " + pCppJSbxObject);
_documentURL = documentURL; _documentBase = documentBase;
_parameters = parameters; _parameters = parameters;
_container = container; _container = container;
_toolkit = container.getToolkit(); _toolkit = container.getToolkit();
_documentProxy = DocumentProxy.getDocumentProxy(documentURL, _toolkit); _documentProxy = DocumentProxy.getDocumentProxy(documentBase, _toolkit);
addObserver(_documentProxy); addObserver(_documentProxy);
} }
@ -154,24 +154,14 @@ public final class AppletExecutionContext extends ExecutionContext
if (!codeBase.endsWith("/")) { if (!codeBase.endsWith("/")) {
codeBase += "/"; codeBase += "/";
} }
_baseURL = new URL(_documentURL, codeBase); _baseURL = new URL(_documentBase, codeBase);
} }
catch (MalformedURLException e) { catch (MalformedURLException e) {
try { if(DEBUG) System.err.println("#### AppletExecutionContext: Could not create base Url");
String file = _documentURL.getFile();
int i = file.lastIndexOf('/');
if (i > 0 && i < file.length() - 1) {
_baseURL = new URL(_documentURL, file.substring(0, i + 1));
}
}
catch (MalformedURLException e2) {
_baseURL = _documentURL;
}
} }
if(_baseURL == null) if(_baseURL == null)
_baseURL = _documentURL; _baseURL = _documentBase;
if(DEBUG) System.err.println("##### " + getClass().getName() + ".init - baseUrl:" + _baseURL); if(DEBUG) System.err.println("##### " + getClass().getName() + ".init - baseUrl:" + _baseURL);