mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-14 12:25:21 +00:00
8028050: Typo correction needed s/Classlaoder/Classloader/
Reviewed-by: pchelko, azvegint
This commit is contained in:
parent
a246384219
commit
e63f78cc99
@ -28,23 +28,16 @@ package sun.applet;
|
||||
import java.applet.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.MemoryImageSource;
|
||||
import java.io.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
import java.net.JarURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketPermission;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.security.*;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
import java.util.WeakHashMap;
|
||||
import sun.awt.AWTAccessor;
|
||||
import sun.awt.AppContext;
|
||||
import sun.awt.EmbeddedFrame;
|
||||
@ -149,7 +142,9 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
abstract protected String getJarFiles();
|
||||
abstract protected String getSerializedObject();
|
||||
|
||||
@Override
|
||||
abstract public int getWidth();
|
||||
@Override
|
||||
abstract public int getHeight();
|
||||
abstract public boolean hasInitialFocus();
|
||||
|
||||
@ -185,6 +180,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
handler = new Thread(appletGroup, this, "thread " + nm);
|
||||
// set the context class loader for this thread
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
handler.setContextClassLoader(loader);
|
||||
return null;
|
||||
@ -237,6 +233,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
/**
|
||||
* Minimum size
|
||||
*/
|
||||
@Override
|
||||
public Dimension minimumSize() {
|
||||
return new Dimension(defaultAppletSize.width,
|
||||
defaultAppletSize.height);
|
||||
@ -245,6 +242,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
/**
|
||||
* Preferred size
|
||||
*/
|
||||
@Override
|
||||
public Dimension preferredSize() {
|
||||
return new Dimension(currentAppletSize.width,
|
||||
currentAppletSize.height);
|
||||
@ -369,6 +367,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Thread curThread = Thread.currentThread();
|
||||
@ -451,6 +450,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
try {
|
||||
final AppletPanel p = this;
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
p.validate();
|
||||
}
|
||||
@ -481,6 +481,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
final AppletPanel p = this;
|
||||
final Applet a = applet;
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
p.validate();
|
||||
a.setVisible(true);
|
||||
@ -516,6 +517,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
try {
|
||||
final Applet a = applet;
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
a.setVisible(false);
|
||||
}
|
||||
@ -575,6 +577,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
try {
|
||||
final Applet a = applet;
|
||||
Runnable r = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
remove(a);
|
||||
}
|
||||
@ -629,10 +632,13 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
*/
|
||||
private Component getMostRecentFocusOwnerForWindow(Window w) {
|
||||
Method meth = (Method)AccessController.doPrivileged(new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
Method meth = null;
|
||||
try {
|
||||
meth = KeyboardFocusManager.class.getDeclaredMethod("getMostRecentFocusOwner", new Class[] {Window.class});
|
||||
meth = KeyboardFocusManager.class.getDeclaredMethod(
|
||||
"getMostRecentFocusOwner",
|
||||
new Class[]{Window.class});
|
||||
meth.setAccessible(true);
|
||||
} catch (Exception e) {
|
||||
// Must never happen
|
||||
@ -881,6 +887,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
/**
|
||||
* Return true when the applet has been started.
|
||||
*/
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return status == APPLET_START;
|
||||
}
|
||||
@ -890,6 +897,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
/**
|
||||
* Is called when the applet wants to be resized.
|
||||
*/
|
||||
@Override
|
||||
public void appletResize(int width, int height) {
|
||||
currentAppletSize.width = width;
|
||||
currentAppletSize.height = height;
|
||||
@ -905,17 +913,20 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
final AppletPanel ap = this;
|
||||
if (appEvtQ != null){
|
||||
appEvtQ.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(),
|
||||
new Runnable(){
|
||||
public void run(){
|
||||
if(ap != null)
|
||||
{
|
||||
ap.dispatchAppletEvent(APPLET_RESIZE, currentSize);
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (ap != null) {
|
||||
ap.dispatchAppletEvent(
|
||||
APPLET_RESIZE,
|
||||
currentSize);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBounds(int x, int y, int width, int height) {
|
||||
super.setBounds(x, y, width, height);
|
||||
currentAppletSize.width = width;
|
||||
@ -967,7 +978,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
public String getClassLoaderCacheKey()
|
||||
{
|
||||
/**
|
||||
* Fixed #4501142: Classlaoder sharing policy doesn't
|
||||
* Fixed #4501142: Classloader sharing policy doesn't
|
||||
* take "archive" into account. This will be overridden
|
||||
* by Java Plug-in. [stanleyh]
|
||||
*/
|
||||
@ -1013,6 +1024,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
getAccessControlContext(codebase);
|
||||
c = (AppletClassLoader)
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
AppletClassLoader ac = createClassLoader(codebase);
|
||||
/* Should the creation of the classloader be
|
||||
@ -1056,6 +1068,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
|
||||
|
||||
PermissionCollection perms = (PermissionCollection)
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
@Override
|
||||
public Object run() {
|
||||
Policy p = java.security.Policy.getPolicy();
|
||||
if (p != null) {
|
||||
|
||||
@ -33,21 +33,17 @@ import java.awt.print.*;
|
||||
import javax.print.attribute.*;
|
||||
import java.applet.*;
|
||||
import java.net.URL;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketPermission;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import sun.awt.SunToolkit;
|
||||
import sun.awt.AppContext;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* A frame to show the applet tag in.
|
||||
*/
|
||||
@SuppressWarnings("serial") // JDK-implementation class
|
||||
class TextFrame extends Frame {
|
||||
final class TextFrame extends Frame {
|
||||
|
||||
/**
|
||||
* Create the tag frame.
|
||||
@ -66,6 +62,7 @@ class TextFrame extends Frame {
|
||||
p.add(b);
|
||||
|
||||
class ActionEventListener implements ActionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
dispose();
|
||||
}
|
||||
@ -78,6 +75,7 @@ class TextFrame extends Frame {
|
||||
|
||||
WindowListener windowEventListener = new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent evt) {
|
||||
dispose();
|
||||
}
|
||||
@ -90,20 +88,22 @@ class TextFrame extends Frame {
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets us construct one using unix-style one shot behaviors
|
||||
* Lets us construct one using unix-style one shot behaviors.
|
||||
*/
|
||||
final class StdAppletViewerFactory implements AppletViewerFactory {
|
||||
|
||||
class StdAppletViewerFactory implements AppletViewerFactory
|
||||
{
|
||||
@Override
|
||||
public AppletViewer createAppletViewer(int x, int y,
|
||||
URL doc, Hashtable atts) {
|
||||
return new AppletViewer(x, y, doc, atts, System.out, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MenuBar getBaseMenuBar() {
|
||||
return new MenuBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStandalone() {
|
||||
return true;
|
||||
}
|
||||
@ -117,8 +117,7 @@ class StdAppletViewerFactory implements AppletViewerFactory
|
||||
* once the JDK docs have been installed.)
|
||||
*/
|
||||
@SuppressWarnings("serial") // JDK implementation class
|
||||
public class AppletViewer extends Frame implements AppletContext,
|
||||
Printable {
|
||||
public class AppletViewer extends Frame implements AppletContext, Printable {
|
||||
|
||||
/**
|
||||
* Some constants...
|
||||
@ -148,13 +147,14 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
|
||||
|
||||
private final class UserActionListener implements ActionListener {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
processUserAction(evt);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the applet viewer
|
||||
* Create the applet viewer.
|
||||
*/
|
||||
public AppletViewer(int x, int y, URL doc, Hashtable atts,
|
||||
PrintStream statusMsgStream, AppletViewerFactory factory) {
|
||||
@ -202,14 +202,17 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
|
||||
WindowListener windowEventListener = new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent evt) {
|
||||
appletClose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowIconified(WindowEvent evt) {
|
||||
appletStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent evt) {
|
||||
appletStart();
|
||||
}
|
||||
@ -224,6 +227,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
this.frame = frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appletStateChanged(AppletEvent evt)
|
||||
{
|
||||
AppletPanel src = (AppletPanel)evt.getSource();
|
||||
@ -371,6 +375,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
/**
|
||||
* Get an audio clip.
|
||||
*/
|
||||
@Override
|
||||
public AudioClip getAudioClip(URL url) {
|
||||
checkConnect(url);
|
||||
synchronized (audioClips) {
|
||||
@ -387,6 +392,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
/**
|
||||
* Get an image.
|
||||
*/
|
||||
@Override
|
||||
public Image getImage(URL url) {
|
||||
return getCachedImage(url);
|
||||
}
|
||||
@ -418,6 +424,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
/**
|
||||
* Get an applet by name.
|
||||
*/
|
||||
@Override
|
||||
public Applet getApplet(String name) {
|
||||
AppletSecurity security = (AppletSecurity)System.getSecurityManager();
|
||||
name = name.toLowerCase();
|
||||
@ -447,6 +454,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
* Return an enumeration of all the accessible
|
||||
* applets on this page.
|
||||
*/
|
||||
@Override
|
||||
public Enumeration getApplets() {
|
||||
AppletSecurity security = (AppletSecurity)System.getSecurityManager();
|
||||
Vector v = new Vector();
|
||||
@ -470,31 +478,37 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
/**
|
||||
* Ignore.
|
||||
*/
|
||||
@Override
|
||||
public void showDocument(URL url) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Ignore.
|
||||
*/
|
||||
@Override
|
||||
public void showDocument(URL url, String target) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Show status.
|
||||
*/
|
||||
@Override
|
||||
public void showStatus(String status) {
|
||||
label.setText(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStream(String key, InputStream stream)throws IOException{
|
||||
// We do nothing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getStream(String key){
|
||||
// We do nothing.
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator getStreamKeys(){
|
||||
// We do nothing.
|
||||
return null;
|
||||
@ -608,7 +622,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
panel.sendEvent(AppletPanel.APPLET_DISPOSE);
|
||||
|
||||
/**
|
||||
* Fixed #4501142: Classlaoder sharing policy doesn't
|
||||
* Fixed #4501142: Classloader sharing policy doesn't
|
||||
* take "archive" into account. This will be overridden
|
||||
* by Java Plug-in. [stanleyh]
|
||||
*/
|
||||
@ -637,6 +651,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
void appletSave() {
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
|
||||
@Override
|
||||
public Object run() {
|
||||
// XXX: this privileged block should be made smaller
|
||||
// by initializing a private static variable with "user.dir"
|
||||
@ -765,6 +780,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int print(Graphics graphics, PageFormat pf, int pageIndex) {
|
||||
if (pageIndex > 0) {
|
||||
return Printable.NO_SUCH_PAGE;
|
||||
@ -829,6 +845,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
|
||||
new Thread(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
appletShutdown(p);
|
||||
@ -864,6 +881,7 @@ public class AppletViewer extends Frame implements AppletContext,
|
||||
//
|
||||
new Thread(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user