harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r628053 - in /harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet: PluginAppletFactory.java PluginCallback.java
Date Fri, 15 Feb 2008 13:14:02 GMT
Author: apetrenko
Date: Fri Feb 15 05:14:01 2008
New Revision: 628053

URL: http://svn.apache.org/viewvc?rev=628053&view=rev
Log:
PluginAppletFactory and PluginCallback classes are added

Added:
    harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginAppletFactory.java
  (with props)
    harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginCallback.java
  (with props)

Added: harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginAppletFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginAppletFactory.java?rev=628053&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginAppletFactory.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginAppletFactory.java
Fri Feb 15 05:14:01 2008
@@ -0,0 +1,43 @@
+/*
+ *  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;
+
+import java.net.URL;
+
+public class PluginAppletFactory {
+
+    private static HashMap<Long, Factory> factories = new HashMap<Long, Factory>();
+    
+    private static Factory getFactory(long pluginInstance) {
+        Long inst = Long.valueOf(pluginInstance);
+        Factory f = factories.get(inst);
+        if (f == null) {
+            f = new Factory(new PluginCallback(pluginInstance));
+            factories.put(inst, f);
+        }
+        
+        return f;
+    }
+    
+    public static void createAndRun(long pluginInstance, int id, long parentWindowId, URL
documentBase,
+                int documentId, URL codeBase, String className,
+                String []paramStrings, String name, Object container) {
+        Factory f = getFactory(pluginInstance);
+        f.createAndRun(id, parentWindowId, documentBase, documentId, codeBase, className,
paramStrings, name, container);
+    }    
+}

Propchange: harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginAppletFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginCallback.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginCallback.java?rev=628053&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginCallback.java
(added)
+++ harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginCallback.java
Fri Feb 15 05:14:01 2008
@@ -0,0 +1,46 @@
+/*
+ *  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;
+
+import java.net.URL;
+
+public class PluginCallback implements Callback {
+    private final long pluginInstance;
+    
+    public PluginCallback(long pluginInstance) {
+        this.pluginInstance = pluginInstance;
+    }
+    
+    public void showDocument(int documentId, URL url, String target) {
+        showDocument(pluginInstance, documentId, url, target);
+    }
+
+    public void showStatus(int documentId, String status) {
+        showStatus(pluginInstance, documentId, status);
+    }
+
+    public void appletResize(int appletId, int width, int height) {
+        appletResize(pluginInstance, appletId, width, height);
+    }
+
+    private native void showDocument(int documentId, URL url, String target);
+
+    private native void showStatus(int documentId, String status);
+
+    private native void appletResize(int appletId, int width, int height);
+}
\ No newline at end of file

Propchange: harmony/enhanced/classlib/trunk/modules/applet/src/main/java/org/apache/harmony/applet/PluginCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message