You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ap...@apache.org on 2008/02/21 16:07:23 UTC

svn commit: r629820 - in /harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet: Proxy.java callbacks/HarmonyCallback.java callbacks/JRECallback.java

Author: apetrenko
Date: Thu Feb 21 07:07:22 2008
New Revision: 629820

URL: http://svn.apache.org/viewvc?rev=629820&view=rev
Log:
JRE specific code has been moved to JRECallback interface

Added:
    harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/HarmonyCallback.java   (with props)
    harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/JRECallback.java   (with props)
Modified:
    harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/Proxy.java

Modified: harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/Proxy.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/Proxy.java?rev=629820&r1=629819&r2=629820&view=diff
==============================================================================
--- harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/Proxy.java (original)
+++ harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/Proxy.java Thu Feb 21 07:07:22 2008
@@ -28,13 +28,16 @@
 import java.awt.Window;
 import java.net.URL;
 
-import org.apache.harmony.awt.ComponentInternals;
+import org.apache.harmony.applet.callbacks.HarmonyCallback;
+import org.apache.harmony.applet.callbacks.JRECallback;
 
 
 /**
  * Applet's state and parameters, implementation <b>AppletStub</b> interface
  */
 class Proxy implements AppletStub {
+	
+	private static final JRECallback jreCallback = getJRECallback();
 
     final DocumentSlice docSlice;
     final Parameters params;
@@ -52,7 +55,12 @@
         ds.add(this);
     }
     
-    Applet getApplet() {
+    private static JRECallback getJRECallback() {
+    	// SPI like loading of JRECallback instance should be implemented
+		return new HarmonyCallback();
+	}
+
+	Applet getApplet() {
         return applet;
     }
     
@@ -80,10 +88,8 @@
         if ((params.container != null) && (params.container instanceof Container)) { 
 
             parent = (Container)params.container;
-        } else {
-            
-            ComponentInternals ci = ComponentInternals.getComponentInternals();
-            parent = ci.attachNativeWindow(params.parentWindowId);
+        } else {            
+            parent = jreCallback.attachNativeWindow(params.parentWindowId);
         }
 
         applet = createApplet();

Added: harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/HarmonyCallback.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/HarmonyCallback.java?rev=629820&view=auto
==============================================================================
--- harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/HarmonyCallback.java (added)
+++ harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/HarmonyCallback.java Thu Feb 21 07:07:22 2008
@@ -0,0 +1,28 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.applet.callbacks;
+
+import java.awt.Container;
+
+import org.apache.harmony.awt.ComponentInternals;
+
+public class HarmonyCallback implements JRECallback {
+	public Container attachNativeWindow(long parentWindowId) {
+        ComponentInternals ci = ComponentInternals.getComponentInternals();
+        return ci.attachNativeWindow(parentWindowId);
+	}
+}

Propchange: harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/HarmonyCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/JRECallback.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/JRECallback.java?rev=629820&view=auto
==============================================================================
--- harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/JRECallback.java (added)
+++ harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/JRECallback.java Thu Feb 21 07:07:22 2008
@@ -0,0 +1,23 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.harmony.applet.callbacks;
+
+import java.awt.Container;
+
+public interface JRECallback {
+	Container attachNativeWindow(long parentWindowId);
+}

Propchange: harmony/enhanced/sandbox/mozillaplugin/src/main/java/org/apache/harmony/applet/callbacks/JRECallback.java
------------------------------------------------------------------------------
    svn:eol-style = native