Added new method :
public Object PlugletTagInfo.getDOMElement(); (It is possible to use JavaDOM from pluglets now.) a=idk@eng.sun.com r=sdv@sparc.spb.su git-svn-id: svn://10.0.0.236/trunk@60968 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "PlugletLog.h"
|
||||
|
||||
static jfieldID peerFID = NULL;
|
||||
static jclass DOMAccessorImpl = NULL;
|
||||
static jmethodID getElementByHandle = NULL;
|
||||
|
||||
/*
|
||||
* Class: org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl
|
||||
* Method: getAttributesArray
|
||||
@@ -95,6 +98,41 @@ JNIEXPORT jstring JNICALL Java_org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl_g
|
||||
return env->NewStringUTF(result);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl
|
||||
* Method: getDOMElement
|
||||
* Signature: ()Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl_getDOMElement
|
||||
(JNIEnv *env, jobject jthis) {
|
||||
PR_LOG(PlugletLog::log, PR_LOG_DEBUG,
|
||||
("PlugletTagInfo2Impl.getDOMElement\n"));
|
||||
if ( !DOMAccessorImpl ) {
|
||||
DOMAccessorImpl = env->FindClass("org/mozilla/dom/DOMAccessorImpl");
|
||||
if (!DOMAccessorImpl) {
|
||||
return NULL;
|
||||
}
|
||||
DOMAccessorImpl = (jclass) env->NewGlobalRef(DOMAccessorImpl); // nb who is going to Delete this ref
|
||||
if (!DOMAccessorImpl) {
|
||||
return NULL;
|
||||
}
|
||||
getElementByHandle = env->GetStaticMethodID(DOMAccessorImpl,"getElementByHandle","(J)Lorg/w3c/dom/Element;");
|
||||
if (!getElementByHandle) {
|
||||
DOMAccessorImpl = NULL;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
nsIPluginTagInfo2 * info = (nsIPluginTagInfo2*)env->GetLongField(jthis, peerFID);
|
||||
nsIDOMElement * elem = NULL;
|
||||
if (!info
|
||||
|| NS_FAILED(info->GetDOMElement(&elem))) {
|
||||
return NULL;
|
||||
}
|
||||
return env->CallStaticObjectMethod(DOMAccessorImpl,getElementByHandle,(jlong) elem);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl
|
||||
* Method: getParametersArray
|
||||
|
||||
@@ -1,23 +1,3 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (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.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems,
|
||||
* Inc. Portions created by Sun are
|
||||
* Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*/
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl */
|
||||
@@ -47,10 +27,18 @@ JNIEXPORT jstring JNICALL Java_org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl_g
|
||||
* Class: org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl
|
||||
* Method: getParametersArray
|
||||
* Signature: ()[[Ljava/lang/String;
|
||||
*/
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl_getParametersArray
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl
|
||||
* Method: getDOMElement
|
||||
* Signature: ()Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl_getDOMElement
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_mozilla_pluglet_mozilla_PlugletTagInfo2Impl
|
||||
* Method: getParameter
|
||||
|
||||
Reference in New Issue
Block a user