提交 ef527fa1 编写于 作者: A anthony

7002856: Provide an accessor for Container.validateUnconditionally()

Summary: Introduce sun.awt.AWTAccessor.getContainerAccessor().validateUnconditionally()
Reviewed-by: art
上级 c4e2fc79
......@@ -51,6 +51,7 @@ import javax.accessibility.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
import sun.awt.CausedFocusEvent;
import sun.awt.PeerEvent;
import sun.awt.SunToolkit;
......@@ -247,6 +248,13 @@ public class Container extends Component {
if (!GraphicsEnvironment.isHeadless()) {
initIDs();
}
AWTAccessor.setContainerAccessor(new AWTAccessor.ContainerAccessor() {
@Override
public void validateUnconditionally(Container cont) {
cont.validateUnconditionally();
}
});
}
/**
......
......@@ -223,6 +223,16 @@ public final class AWTAccessor {
void processEvent(Component comp, AWTEvent e);
}
/*
* An interface of accessor for the java.awt.Container class.
*/
public interface ContainerAccessor {
/**
* Validates the container unconditionally.
*/
void validateUnconditionally(Container cont);
}
/*
* An interface of accessor for java.awt.Window class.
*/
......@@ -444,53 +454,19 @@ public final class AWTAccessor {
}
/*
* The java.awt.Component class accessor object.
* Accessor instances are initialized in the static initializers of
* corresponding AWT classes by using setters defined below.
*/
private static ComponentAccessor componentAccessor;
/*
* The java.awt.Window class accessor object.
*/
private static ContainerAccessor containerAccessor;
private static WindowAccessor windowAccessor;
/*
* The java.awt.AWTEvent class accessor object.
*/
private static AWTEventAccessor awtEventAccessor;
/*
* The java.awt.event.InputEvent class accessor object.
*/
private static InputEventAccessor inputEventAccessor;
/*
* The java.awt.Frame class accessor object.
*/
private static FrameAccessor frameAccessor;
/*
* The java.awt.KeyboardFocusManager class accessor object.
*/
private static KeyboardFocusManagerAccessor kfmAccessor;
/*
* The java.awt.MenuComponent class accessor object.
*/
private static MenuComponentAccessor menuComponentAccessor;
/*
* The java.awt.EventQueue class accessor object.
*/
private static EventQueueAccessor eventQueueAccessor;
/*
* The java.awt.PopupMenu class accessor object.
*/
private static PopupMenuAccessor popupMenuAccessor;
/*
* The java.awt.FileDialog class accessor object.
*/
private static FileDialogAccessor fileDialogAccessor;
/*
......@@ -501,7 +477,7 @@ public final class AWTAccessor {
}
/*
* Retrieve the accessor object for the java.awt.Window class.
* Retrieve the accessor object for the java.awt.Component class.
*/
public static ComponentAccessor getComponentAccessor() {
if (componentAccessor == null) {
......@@ -511,6 +487,24 @@ public final class AWTAccessor {
return componentAccessor;
}
/*
* Set an accessor object for the java.awt.Container class.
*/
public static void setContainerAccessor(ContainerAccessor ca) {
containerAccessor = ca;
}
/*
* Retrieve the accessor object for the java.awt.Container class.
*/
public static ContainerAccessor getContainerAccessor() {
if (containerAccessor == null) {
unsafe.ensureClassInitialized(Container.class);
}
return containerAccessor;
}
/*
* Set an accessor object for the java.awt.Window class.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册