Fixed bugs 20202, 17437.

Methods of PlugletTagInfo and PlugletTagInfo2 doesn't allow access to pluglet parameters,
PlugletTagInfo2 getAttribute doesn't work properly.

Reviewed by idk@eng.sun.com


git-svn-id: svn://10.0.0.236/trunk@59086 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
laa%sparc.spb.su
2000-01-28 18:11:27 +00:00
parent f27d75e16f
commit c160c8968e
4 changed files with 158 additions and 11 deletions

View File

@@ -28,6 +28,8 @@ import java.util.*;
public interface PlugletTagInfo2 extends PlugletTagInfo {
public Properties getAttributes();
public String getAttribute(String name);
public Properties getParameters();
public String getParameter(String name);
/** Gets the HTML tag type associated with creation of the
* <code>Pluglet</code> instance. Possible types are <code>EMBED</code>,
* <code>APPLET</code>, and <code>OBJECT</code>.<p>

View File

@@ -27,8 +27,32 @@ public class PlugletTagInfo2Impl implements PlugletTagInfo2 {
peer = _peer;
nativeInitialize();
}
public native Properties getAttributes();
private native String[][] getAttributesArray();
public Properties getAttributes() {
Properties result = new Properties();
String[][] attrs = getAttributesArray();
if (attrs == null) {
return null;
}
for(int i=0; i < attrs[0].length; i++) {
result.setProperty(attrs[0][i], attrs[1][i]);
}
return result;
}
public native String getAttribute(String name);
private native String[][] getParametersArray();
public Properties getParameters() {
Properties result = new Properties();
String[][] params = getParametersArray();
if (params == null) {
return null;
}
for(int i=0; i < params[1].length; i++) {
result.setProperty(params[0][i], params[1][i]);
}
return result;
}
public native String getParameter(String name);
/* Get the type of the HTML tag that was used ot instantiate this
* pluglet. Currently supported tags are EMBED, APPLET and OBJECT.
*/