提交 986c06cc 编写于 作者: L lana

Merge

#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -64,7 +64,10 @@ ifndef OPENJDK
# This gets built on unix platforms implicitly in the old build even though
# it's excluded in the closed build.
EXCLUDES += sun/java2d/pisces
endif
endif
ifeq ($(OPENJDK_TARGET_OS), windows)
# AccessBridge is compiled separately below.
EXFILES += AccessBridge.java \
AccessBridgeLoader.java \
......@@ -73,8 +76,6 @@ ifndef OPENJDK
EXCLUDES += com/sun/java/accessibility/extensions
endif
endif
ifneq ($(OPENJDK_TARGET_OS), solaris)
# Exclude Solaris nio and two security related files in src/share/classes
EXFILES += SolarisAclFileAttributeView.java \
......@@ -272,7 +273,7 @@ include CopyIntoClasses.gmk
ifndef OPENJDK
CLOSED_SRC_DIRS := $(JDK_TOPDIR)/src/closed/share/classes \
$(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
$(wildcard $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes)
endif
MACOSX_SRC_DIRS :=
......@@ -379,7 +380,6 @@ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32, \
......@@ -413,7 +413,6 @@ ifndef OPENJDK
endif
endif
endif
##########################################################################################
......
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -659,11 +659,10 @@ endif
##########################################################################################
# jabswitch
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupNativeCompilation,BUILD_JABSWITCH, \
SRC := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge, \
SRC := $(JDK_TOPDIR)/src/windows/native/sun/bridge, \
INCLUDE_FILES := jabswitch.cpp, \
LANG := C++, \
CFLAGS := $(filter-out -Zc:wchar_t-, $(CFLAGS_JDKEXE)) -Zc:wchar_t \
......@@ -675,17 +674,16 @@ ifndef OPENJDK
OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
PROGRAM := jabswitch, \
DEBUG_SYMBOLS := true, \
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/bridge/AccessBridgeStatusWindow.rc, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=jabswitch.exe" \
-D "JDK_INTERNAL_NAME=jabswitch" \
-D "JDK_FTYPE=0x01L", \
MANIFEST := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
MANIFEST := $(JDK_TOPDIR)/src/windows/native/sun/bridge/jabswitch.manifest))
BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
endif
endif
##########################################################################################
......
......@@ -55,7 +55,6 @@ COPY_FILES = $(H_TARGET_FILES)
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
......@@ -64,14 +63,12 @@ ifndef OPENJDK
$(JDK_OUTPUTDIR)/lib/accessibility.properties
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
$(JDK_TOPDIR)/src/windows/native/sun/bridge/%
$(install-file)
$(JDK_OUTPUTDIR)/lib/accessibility.properties: \
$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
$(JDK_TOPDIR)/src/windows/native/sun/bridge/accessibility.properties
$(install-file)
endif
endif
##########################################################################################
......
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -650,7 +650,6 @@ $(eval $(call SetupZipArchive,BUILD_SRC_ZIP, \
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupArchive,BUILD_JACCESS_JAR, , \
......@@ -686,7 +685,6 @@ ifndef OPENJDK
JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
endif
endif
endif
##########################################################################################
......
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -174,11 +174,10 @@ endif
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
AB_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/com/sun/java/accessibility
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridgeLoader.java: \
......@@ -216,6 +215,5 @@ ifndef OPENJDK
endif
endif
endif
##########################################################################################
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -127,10 +127,9 @@ endif
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/windows/native/sun/bridge
define SetupAccessBridge
# Parameter 1 Suffix
......@@ -149,8 +148,7 @@ ifndef OPENJDK
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
-subsystem:windows -machine:$2, \
VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=JAWTAccessBridge$1.dll" \
......@@ -159,7 +157,8 @@ ifndef OPENJDK
OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
DEBUG_SYMBOLS := true)
$$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
$$(BUILD_JAWTACCESSBRIDGE$1): \
$(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
$(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
LIBRARY = JavaAccessBridge$1, \
......@@ -175,8 +174,7 @@ ifndef OPENJDK
LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
-subsystem:windows -machine:$2, \
VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=JavaAccessBridge$1.dll" \
......@@ -221,5 +219,5 @@ ifndef OPENJDK
else
$(eval $(call SetupAccessBridge,-64,X64,64))
endif
endif
endif
......@@ -29,6 +29,7 @@ import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicScrollPaneUI;
public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
public static ComponentUI createUI(final JComponent x) {
......@@ -39,28 +40,9 @@ public class AquaScrollPaneUI extends javax.swing.plaf.basic.BasicScrollPaneUI {
return new XYMouseWheelHandler();
}
// This is a grody hack to trick BasicScrollPaneUI into scrolling horizontally
// when we notice that the shift key is down. This should be removed when AWT/Swing
// becomes aware of of multi-axis scroll wheels.
protected class XYMouseWheelHandler extends javax.swing.plaf.basic.BasicScrollPaneUI.MouseWheelHandler {
protected class XYMouseWheelHandler extends BasicScrollPaneUI.MouseWheelHandler {
public void mouseWheelMoved(final MouseWheelEvent e) {
JScrollBar vScrollBar = null;
boolean wasVisible = false;
if (e.isShiftDown()) {
vScrollBar = scrollpane.getVerticalScrollBar();
if (vScrollBar != null) {
wasVisible = vScrollBar.isVisible();
vScrollBar.setVisible(false);
}
}
super.mouseWheelMoved(e);
if (wasVisible) {
vScrollBar.setVisible(true);
}
// Consume the event even when the scrollBar is invisible
// see #7124320
e.consume();
......
......@@ -1295,6 +1295,12 @@ public class LWWindowPeer
}
KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
if (!becomesFocused && kfmPeer.getCurrentFocusedWindow() != getTarget()) {
// late window focus lost event - ingoring
return;
}
kfmPeer.setCurrentFocusedWindow(becomesFocused ? getTarget() : null);
int eventID = becomesFocused ? WindowEvent.WINDOW_GAINED_FOCUS : WindowEvent.WINDOW_LOST_FOCUS;
......
......@@ -56,6 +56,18 @@ final class CClipboard extends SunClipboard {
// Leaving Empty, as WClipboard.clearNativeContext is empty as well.
}
@Override
public synchronized Transferable getContents(Object requestor) {
checkPasteboardAndNotify();
return super.getContents(requestor);
}
@Override
protected synchronized Transferable getContextContents() {
checkPasteboardAndNotify();
return super.getContextContents();
}
@Override
protected void setContentsNative(Transferable contents) {
FlavorTable flavorMap = getDefaultFlavorTable();
......@@ -116,13 +128,20 @@ final class CClipboard extends SunClipboard {
private native void declareTypes(long[] formats, SunClipboard newOwner);
private native void setData(byte[] data, long format);
void checkPasteboardAndNotify() {
if (checkPasteboardWithoutNotification()) {
notifyChanged();
lostOwnershipNow(null);
}
}
/**
* Invokes native check whether a change count on the general pasteboard is different
* than when we set it. The different count value means the current owner lost
* pasteboard ownership and someone else put data on the clipboard.
* @since 1.7
*/
native void checkPasteboard();
native boolean checkPasteboardWithoutNotification();
/*** Native Callbacks ***/
private void notifyLostOwnership() {
......
......@@ -120,7 +120,7 @@ public class CEmbeddedFrame extends EmbeddedFrame {
// it won't be invoced if focuse is moved to a html element
// on the same page.
CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.checkPasteboard();
clipboard.checkPasteboardAndNotify();
}
if (parentWindowActive) {
responder.handleWindowFocusEvent(focused, null);
......@@ -161,7 +161,7 @@ public class CEmbeddedFrame extends EmbeddedFrame {
}
// ignore focus "lost" native request as it may mistakenly
// deactivate active window (see 8001161)
if (globalFocusedWindow == this && parentWindowActive) {
if (globalFocusedWindow == this) {
responder.handleWindowFocusEvent(parentWindowActive, null);
}
}
......
......@@ -171,6 +171,8 @@ static CClipboard *sClipboard = nil;
else [args removeLastObject];
}
- (void) checkPasteboard:(id)application {
AWT_ASSERT_APPKIT_THREAD;
......@@ -202,6 +204,19 @@ static CClipboard *sClipboard = nil;
}
}
- (BOOL) checkPasteboardWithoutNotification:(id)application {
AWT_ASSERT_APPKIT_THREAD;
NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];
if (fChangeCount != newChangeCount) {
fChangeCount = newChangeCount;
return YES;
} else {
return NO;
}
}
@end
/*
......@@ -348,16 +363,17 @@ JNF_COCOA_EXIT(env);
* Method: checkPasteboard
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard
(JNIEnv *env, jobject inObject )
JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboardWithoutNotification
(JNIEnv *env, jobject inObject)
{
__block BOOL ret = NO;
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
[[CClipboard sharedClipboard] checkPasteboard:nil];
ret = [[CClipboard sharedClipboard] checkPasteboardWithoutNotification:nil];
}];
JNF_COCOA_EXIT(env);
return ret;
}
......@@ -126,12 +126,30 @@ done:
return buf;
}
BOOL isSWTRunning() {
char envVar[80];
// If this property is present we are running SWT
snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
return getenv(envVar) != NULL;
}
char* SplashGetScaledImageName(const char* jar, const char* file,
float *scaleFactor) {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
*scaleFactor = 1;
if(isSWTRunning()){
return nil;
}
NSAutoreleasePool *pool = [NSAutoreleasePool new];
char* scaledFile = nil;
float screenScaleFactor = 1;
__block float screenScaleFactor = 1;
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
// initialize NSApplication and AWT stuff
[NSApplicationAWT sharedApplication];
screenScaleFactor = [SplashNSScreen() backingScaleFactor];
}];
if (screenScaleFactor > 1) {
NSString *fileName = [NSString stringWithUTF8String: file];
......@@ -176,9 +194,12 @@ SplashInitPlatform(Splash * splash) {
splash->screenFormat.byteOrder = 1 ? BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST;
splash->screenFormat.depthBytes = 4;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
[NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
}];
// If we are running SWT we should not start a runLoop
if (!isSWTRunning()) {
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() {
[NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]];
}];
}
}
void
......
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1669,15 +1669,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
/* do nothing */
}
/*
* Delete references from LightweithDispatcher of a heavyweight parent
*/
void clearLightweightDispatcherOnRemove(Component removedComponent) {
if (parent != null) {
parent.clearLightweightDispatcherOnRemove(removedComponent);
}
}
/**
* @deprecated As of JDK version 1.1,
* replaced by <code>setVisible(boolean)</code>.
......@@ -6180,7 +6171,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Indicates whether a class or its superclasses override coalesceEvents.
* Must be called with lock on coalesceMap and privileged.
* @see checkCoalsecing
* @see checkCoalescing
*/
private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
assert Thread.holdsLock(coalesceMap);
......@@ -6986,8 +6977,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
synchronized (getTreeLock()) {
clearLightweightDispatcherOnRemove(this);
if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
transferFocus(true);
}
......
/*
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -41,6 +41,7 @@ import java.io.ObjectStreamField;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.security.AccessController;
import java.util.EventListener;
......@@ -3310,16 +3311,6 @@ public class Container extends Component {
}
}
@Override
void clearLightweightDispatcherOnRemove(Component removedComponent) {
if (dispatcher != null) {
dispatcher.removeReferences(removedComponent);
} else {
//It is a Lightweight Container, should clear parent`s Dispatcher
super.clearLightweightDispatcherOnRemove(removedComponent);
}
}
final Container getTraversalRoot() {
if (isFocusCycleRoot()) {
return findTraversalRoot();
......@@ -4413,7 +4404,9 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
LightweightDispatcher(Container nativeContainer) {
this.nativeContainer = nativeContainer;
mouseEventTarget = null;
mouseEventTarget = new WeakReference<>(null);
targetLastEntered = new WeakReference<>(null);
targetLastEnteredDT = new WeakReference<>(null);
eventMask = 0;
}
......@@ -4424,9 +4417,9 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
void dispose() {
//System.out.println("Disposing lw dispatcher");
stopListeningForOtherDrags();
mouseEventTarget = null;
targetLastEntered = null;
targetLastEnteredDT = null;
mouseEventTarget.clear();
targetLastEntered.clear();
targetLastEnteredDT.clear();
}
/**
......@@ -4513,65 +4506,62 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
trackMouseEnterExit(mouseOver, e);
// 4508327 : MOUSE_CLICKED should only go to the recipient of
// the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
// MOUSE_CLICKED.
if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
mouseEventTarget = (mouseOver != nativeContainer) ? mouseOver: null;
isCleaned = false;
Component met = mouseEventTarget.get();
// 4508327 : MOUSE_CLICKED should only go to the recipient of
// the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
// MOUSE_CLICKED.
if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
met = (mouseOver != nativeContainer) ? mouseOver : null;
mouseEventTarget = new WeakReference<>(met);
}
if (mouseEventTarget != null) {
if (met != null) {
switch (id) {
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
break;
case MouseEvent.MOUSE_PRESSED:
retargetMouseEvent(mouseEventTarget, id, e);
break;
case MouseEvent.MOUSE_RELEASED:
retargetMouseEvent(mouseEventTarget, id, e);
break;
case MouseEvent.MOUSE_CLICKED:
// 4508327: MOUSE_CLICKED should never be dispatched to a Component
// other than that which received the MOUSE_PRESSED event. If the
// mouse is now over a different Component, don't dispatch the event.
// The previous fix for a similar problem was associated with bug
// 4155217.
if (mouseOver == mouseEventTarget) {
retargetMouseEvent(mouseOver, id, e);
}
break;
case MouseEvent.MOUSE_MOVED:
retargetMouseEvent(mouseEventTarget, id, e);
break;
case MouseEvent.MOUSE_DRAGGED:
if (isMouseGrab(e)) {
retargetMouseEvent(mouseEventTarget, id, e);
}
break;
case MouseEvent.MOUSE_WHEEL:
// This may send it somewhere that doesn't have MouseWheelEvents
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " +
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
break;
case MouseEvent.MOUSE_PRESSED:
retargetMouseEvent(met, id, e);
break;
case MouseEvent.MOUSE_RELEASED:
retargetMouseEvent(met, id, e);
break;
case MouseEvent.MOUSE_CLICKED:
// 4508327: MOUSE_CLICKED should never be dispatched to a Component
// other than that which received the MOUSE_PRESSED event. If the
// mouse is now over a different Component, don't dispatch the event.
// The previous fix for a similar problem was associated with bug
// 4155217.
if (mouseOver == met) {
retargetMouseEvent(mouseOver, id, e);
}
break;
case MouseEvent.MOUSE_MOVED:
retargetMouseEvent(met, id, e);
break;
case MouseEvent.MOUSE_DRAGGED:
if (isMouseGrab(e)) {
retargetMouseEvent(met, id, e);
}
break;
case MouseEvent.MOUSE_WHEEL:
// This may send it somewhere that doesn't have MouseWheelEvents
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
}
retargetMouseEvent(mouseOver, id, e);
break;
}
retargetMouseEvent(mouseOver, id, e);
break;
//Consuming of wheel events is implemented in "retargetMouseEvent".
if (id != MouseEvent.MOUSE_WHEEL) {
e.consume();
}
//Consuming of wheel events is implemented in "retargetMouseEvent".
if (id != MouseEvent.MOUSE_WHEEL) {
e.consume();
}
} else if (isCleaned && id != MouseEvent.MOUSE_WHEEL) {
//After mouseEventTarget was removed and cleaned should consume all events
//until new mouseEventTarget is found
e.consume();
}
return e.isConsumed();
return e.isConsumed();
}
private boolean processDropTargetEvent(SunDropTargetEvent e) {
......@@ -4628,15 +4618,16 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
// drag has an associated drop target. MOUSE_ENTERED comes when the
// mouse is in the native container already. To propagate this event
// properly we should null out targetLastEntered.
targetLastEnteredDT = null;
targetLastEnteredDT.clear();
} else if (id == MouseEvent.MOUSE_ENTERED) {
isMouseDTInNativeContainer = true;
} else if (id == MouseEvent.MOUSE_EXITED) {
isMouseDTInNativeContainer = false;
}
targetLastEnteredDT = retargetMouseEnterExit(targetOver, e,
targetLastEnteredDT,
Component tle = retargetMouseEnterExit(targetOver, e,
targetLastEnteredDT.get(),
isMouseDTInNativeContainer);
targetLastEnteredDT = new WeakReference<>(tle);
}
/*
......@@ -4662,9 +4653,10 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
isMouseInNativeContainer = false;
stopListeningForOtherDrags();
}
targetLastEntered = retargetMouseEnterExit(targetOver, e,
targetLastEntered,
Component tle = retargetMouseEnterExit(targetOver, e,
targetLastEntered.get(),
isMouseInNativeContainer);
targetLastEntered = new WeakReference<>(tle);
}
private Component retargetMouseEnterExit(Component targetOver, MouseEvent e,
......@@ -4926,22 +4918,17 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
* is null, there are currently no events being forwarded to
* a subcomponent.
*/
private transient Component mouseEventTarget;
private transient WeakReference<Component> mouseEventTarget;
/**
* The last component entered by the {@code MouseEvent}.
*/
private transient Component targetLastEntered;
private transient WeakReference<Component> targetLastEntered;
/**
* The last component entered by the {@code SunDropTargetEvent}.
*/
private transient Component targetLastEnteredDT;
/**
* Indicates whether {@code mouseEventTarget} was removed and nulled
*/
private transient boolean isCleaned;
private transient WeakReference<Component> targetLastEnteredDT;
/**
* Is the mouse over the native container.
......@@ -4982,17 +4969,4 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.MOUSE_MOTION_EVENT_MASK |
AWTEvent.MOUSE_WHEEL_EVENT_MASK;
void removeReferences(Component removedComponent) {
if (mouseEventTarget == removedComponent) {
isCleaned = true;
mouseEventTarget = null;
}
if (targetLastEntered == removedComponent) {
targetLastEntered = null;
}
if (targetLastEnteredDT == removedComponent) {
targetLastEnteredDT = null;
}
}
}
......@@ -181,7 +181,8 @@ public abstract class GraphicsEnvironment {
"SunOS".equals(osName) ||
"FreeBSD".equals(osName) ||
"NetBSD".equals(osName) ||
"OpenBSD".equals(osName)) &&
"OpenBSD".equals(osName) ||
"AIX".equals(osName)) &&
(System.getenv("DISPLAY") == null));
}
}
......
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -25,6 +25,7 @@
package java.security;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
......@@ -456,24 +457,37 @@ public class ProtectionDomain {
/**
* Used for storing ProtectionDomains as keys in a Map.
*/
final class Key {}
final static class Key {}
// A cache of ProtectionDomains and their Permissions
private static class PDCache implements ProtectionDomainCache {
// We must wrap the PermissionCollection in a WeakReference as there
// are some PermissionCollections which contain strong references
// back to a ProtectionDomain and otherwise would never be removed
// from the WeakHashMap
private final Map<Key, WeakReference<PermissionCollection>>
map = new WeakHashMap<>();
@Override
public synchronized void put(ProtectionDomain pd,
PermissionCollection pc) {
map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
}
@Override
public synchronized PermissionCollection get(ProtectionDomain pd) {
WeakReference<PermissionCollection> ref =
map.get(pd == null ? null : pd.key);
return ref == null ? null : ref.get();
}
}
static {
SharedSecrets.setJavaSecurityProtectionDomainAccess(
new JavaSecurityProtectionDomainAccess() {
@Override
public ProtectionDomainCache getProtectionDomainCache() {
return new ProtectionDomainCache() {
private final Map<Key, PermissionCollection> map =
Collections.synchronizedMap
(new WeakHashMap<Key, PermissionCollection>());
public void put(ProtectionDomain pd,
PermissionCollection pc) {
map.put((pd == null ? null : pd.key), pc);
}
public PermissionCollection get(ProtectionDomain pd) {
return pd == null ? map.get(null) : map.get(pd.key);
}
};
return new PDCache();
}
});
}
......
......@@ -2574,8 +2574,10 @@ public class X509CertSelector implements CertSelector {
} else {
if (maxPathLen < basicConstraints) {
if (debug != null) {
debug.println("X509CertSelector.match: maxPathLen too small ("
+ maxPathLen + " < " + basicConstraints + ")");
debug.println("X509CertSelector.match: cert's maxPathLen " +
"is less than the min maxPathLen set by " +
"basicConstraints. " +
"(" + maxPathLen + " < " + basicConstraints + ")");
}
return false;
}
......
......@@ -2083,17 +2083,33 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
return null;
}
String calendarType = getCalendarType();
int fieldValue = get(field);
// the standalone and narrow styles are supported only through CalendarDataProviders.
if (isStandaloneStyle(style) || isNarrowStyle(style)) {
return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
field, get(field),
style, locale);
if (isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
String val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue,
style, locale);
// Perform fallback here to follow the CLDR rules
if (val == null) {
if (isNarrowFormatStyle(style)) {
val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue,
toStandaloneStyle(style),
locale);
} else if (isStandaloneStyle(style)) {
val = CalendarDataUtility.retrieveFieldValueName(calendarType,
field, fieldValue,
getBaseStyle(style),
locale);
}
}
return val;
}
DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
String[] strings = getFieldStrings(field, style, symbols);
if (strings != null) {
int fieldValue = get(field);
if (fieldValue < strings.length) {
return strings[fieldValue];
}
......@@ -2155,10 +2171,26 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
return null;
}
if (style == ALL_STYLES || isStandaloneStyle(style)) {
return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
String calendarType = getCalendarType();
if (style == ALL_STYLES || isStandaloneStyle(style) || isNarrowFormatStyle(style)) {
Map<String, Integer> map;
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field, style, locale);
// Perform fallback here to follow the CLDR rules
if (map == null) {
if (isNarrowFormatStyle(style)) {
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
toStandaloneStyle(style), locale);
} else if (style != ALL_STYLES) {
map = CalendarDataUtility.retrieveFieldValueNames(calendarType, field,
getBaseStyle(style), locale);
}
}
return map;
}
// SHORT, LONG, or NARROW
// SHORT or LONG
return getDisplayNamesImpl(field, style, locale);
}
......@@ -2544,14 +2576,22 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
return style & ~STANDALONE_MASK;
}
boolean isStandaloneStyle(int style) {
private int toStandaloneStyle(int style) {
return style | STANDALONE_MASK;
}
private boolean isStandaloneStyle(int style) {
return (style & STANDALONE_MASK) != 0;
}
boolean isNarrowStyle(int style) {
private boolean isNarrowStyle(int style) {
return style == NARROW_FORMAT || style == NARROW_STANDALONE;
}
private boolean isNarrowFormatStyle(int style) {
return style == NARROW_FORMAT;
}
/**
* Returns the pseudo-time-stamp for two fields, given their
* individual pseudo-time-stamps. If either of the fields
......
......@@ -225,7 +225,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream {
}
public short readShort() throws IOException {
if (read(byteBuf, 0, 2) < 0) {
if (read(byteBuf, 0, 2) != 2) {
throw new EOFException();
}
......@@ -247,7 +247,7 @@ public abstract class ImageInputStreamImpl implements ImageInputStream {
}
public int readInt() throws IOException {
if (read(byteBuf, 0, 4) < 0) {
if (read(byteBuf, 0, 4) != 4) {
throw new EOFException();
}
......
......@@ -876,6 +876,12 @@ public class BasicScrollPaneUI
return;
}
orientation = SwingConstants.HORIZONTAL;
} else if(e.isShiftDown()){
JScrollBar hScroll = scrollpane.getHorizontalScrollBar();
if (hScroll != null && hScroll.isVisible()) {
toScroll = hScroll;
orientation = SwingConstants.HORIZONTAL;
}
}
e.consume();
......
......@@ -150,7 +150,7 @@ public abstract class SunClipboard extends Clipboard
* AppContext as it is currently retrieved or null otherwise
* @since 1.5
*/
private synchronized Transferable getContextContents() {
protected synchronized Transferable getContextContents() {
AppContext context = AppContext.getAppContext();
return (context == contentsContext) ? contents : null;
}
......@@ -281,42 +281,41 @@ public abstract class SunClipboard extends Clipboard
return;
}
final Runnable runnable = new Runnable() {
public void run() {
final SunClipboard sunClipboard = SunClipboard.this;
ClipboardOwner owner = null;
Transferable contents = null;
synchronized (sunClipboard) {
final AppContext context = sunClipboard.contentsContext;
if (context == null) {
return;
}
if (disposedContext == null || context == disposedContext) {
owner = sunClipboard.owner;
contents = sunClipboard.contents;
sunClipboard.contentsContext = null;
sunClipboard.owner = null;
sunClipboard.contents = null;
sunClipboard.clearNativeContext();
context.removePropertyChangeListener
(AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
} else {
return;
}
}
if (owner != null) {
owner.lostOwnership(sunClipboard, contents);
}
}
};
SunToolkit.postEvent(context, new PeerEvent(this, runnable,
SunToolkit.postEvent(context, new PeerEvent(this, () -> lostOwnershipNow(disposedContext),
PeerEvent.PRIORITY_EVENT));
}
protected void lostOwnershipNow(final AppContext disposedContext) {
final SunClipboard sunClipboard = SunClipboard.this;
ClipboardOwner owner = null;
Transferable contents = null;
synchronized (sunClipboard) {
final AppContext context = sunClipboard.contentsContext;
if (context == null) {
return;
}
if (disposedContext == null || context == disposedContext) {
owner = sunClipboard.owner;
contents = sunClipboard.contents;
sunClipboard.contentsContext = null;
sunClipboard.owner = null;
sunClipboard.contents = null;
sunClipboard.clearNativeContext();
context.removePropertyChangeListener
(AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
} else {
return;
}
}
if (owner != null) {
owner.lostOwnership(sunClipboard, contents);
}
}
protected abstract void clearNativeContext();
protected abstract void setContentsNative(Transferable contents);
......
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -224,7 +224,8 @@ class AdaptableX509CertSelector extends X509CertSelector {
if (extVal == null) {
if (debug != null) {
debug.println("AdaptableX509CertSelector.match: "
+ "no subject key ID extension");
+ "no subject key ID extension. Subject: "
+ xcert.getSubjectX500Principal());
}
return true;
}
......@@ -234,7 +235,9 @@ class AdaptableX509CertSelector extends X509CertSelector {
!Arrays.equals(ski, certSubjectKeyID)) {
if (debug != null) {
debug.println("AdaptableX509CertSelector.match: "
+ "subject key IDs don't match");
+ "subject key IDs don't match. "
+ "Expected: " + Arrays.toString(ski) + " "
+ "Cert's: " + Arrays.toString(certSubjectKeyID));
}
return false;
}
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -435,7 +435,12 @@ public abstract class Builder {
if (selector.match(targetCert) && !X509CertImpl.isSelfSigned
(targetCert, buildParams.sigProvider())) {
if (debug != null) {
debug.println("Builder.addMatchingCerts: adding target cert");
debug.println("Builder.addMatchingCerts: " +
"adding target cert" +
"\n SN: " + Debug.toHexString(
targetCert.getSerialNumber()) +
"\n Subject: " + targetCert.getSubjectX500Principal() +
"\n Issuer: " + targetCert.getIssuerX500Principal());
}
return resultCerts.add(targetCert);
}
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -145,8 +145,8 @@ class ConstraintsChecker extends PKIXCertPathChecker {
if (prevNC != null && ((i == certPathLength) ||
!X509CertImpl.isSelfIssued(currCert))) {
if (debug != null) {
debug.println("prevNC = " + prevNC);
debug.println("currDN = " + currCert.getSubjectX500Principal());
debug.println("prevNC = " + prevNC +
", currDN = " + currCert.getSubjectX500Principal());
}
try {
......@@ -184,8 +184,8 @@ class ConstraintsChecker extends PKIXCertPathChecker {
currCertImpl.getNameConstraintsExtension();
if (debug != null) {
debug.println("prevNC = " + prevNC);
debug.println("newNC = " + String.valueOf(newConstraints));
debug.println("prevNC = " + prevNC +
", newNC = " + String.valueOf(newConstraints));
}
// if there are no previous name constraints, we just return the
......@@ -225,8 +225,8 @@ class ConstraintsChecker extends PKIXCertPathChecker {
String msg = "basic constraints";
if (debug != null) {
debug.println("---checking " + msg + "...");
debug.println("i = " + i);
debug.println("maxPathLength = " + maxPathLength);
debug.println("i = " + i +
", maxPathLength = " + maxPathLength);
}
/* check if intermediate cert */
......
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -320,6 +320,14 @@ public class DistributionPointFetcher {
Set<TrustAnchor> trustAnchors, List<CertStore> certStores,
Date validity) throws CRLException, IOException {
if (debug != null) {
debug.println("DistributionPointFetcher.verifyCRL: " +
"checking revocation status for" +
"\n SN: " + Debug.toHexString(certImpl.getSerialNumber()) +
"\n Subject: " + certImpl.getSubjectX500Principal() +
"\n Issuer: " + certImpl.getIssuerX500Principal());
}
boolean indirectCRL = false;
X509CRLImpl crlImpl = X509CRLImpl.toImpl(crl);
IssuingDistributionPointExtension idpExt =
......@@ -363,7 +371,9 @@ public class DistributionPointFetcher {
}
} else if (crlIssuer.equals(certIssuer) == false) {
if (debug != null) {
debug.println("crl issuer does not equal cert issuer");
debug.println("crl issuer does not equal cert issuer.\n" +
"crl issuer: " + crlIssuer + "\n" +
"cert issuer: " + certIssuer);
}
return false;
} else {
......
/*
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -209,7 +209,8 @@ class ForwardBuilder extends Builder {
* getMatchingEECerts
*/
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts(): ca is target");
debug.println("ForwardBuilder.getMatchingCACerts(): " +
"the target is a CA");
}
if (caTargetSelector == null) {
......@@ -291,8 +292,14 @@ class ForwardBuilder extends Builder {
for (X509Certificate trustedCert : trustedCerts) {
if (sel.match(trustedCert)) {
if (debug != null) {
debug.println("ForwardBuilder.getMatchingCACerts: "
+ "found matching trust anchor");
debug.println("ForwardBuilder.getMatchingCACerts: " +
"found matching trust anchor." +
"\n SN: " +
Debug.toHexString(trustedCert.getSerialNumber()) +
"\n Subject: " +
trustedCert.getSubjectX500Principal() +
"\n Issuer: " +
trustedCert.getIssuerX500Principal());
}
if (caCerts.add(trustedCert) && !searchAllCertStores) {
return;
......
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -30,6 +30,7 @@ import sun.security.util.Debug;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.StringJoiner;
import java.security.cert.CertPath;
import java.security.cert.CertPathValidatorException;
import java.security.cert.PKIXCertPathChecker;
......@@ -88,20 +89,25 @@ class PKIXMasterCertPathValidator {
* current certificate of this loop to be the previous certificate
* of the next loop. The state is initialized during first loop.
*/
if (debug != null)
debug.println("Checking cert" + (i+1) + " ...");
X509Certificate currCert = reversedCertList.get(i);
if (debug != null) {
debug.println("Checking cert" + (i+1) + " - Subject: " +
currCert.getSubjectX500Principal());
}
Set<String> unresCritExts = currCert.getCriticalExtensionOIDs();
if (unresCritExts == null) {
unresCritExts = Collections.<String>emptySet();
}
if (debug != null && !unresCritExts.isEmpty()) {
debug.println("Set of critical extensions:");
StringJoiner joiner = new StringJoiner(", ", "{", "}");
for (String oid : unresCritExts) {
debug.println(oid);
joiner.add(oid);
}
debug.println("Set of critical extensions: " +
joiner.toString());
}
for (int j = 0; j < certPathCheckers.size(); j++) {
......
/*
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -343,11 +343,17 @@ class RevocationChecker extends PKIXRevocationChecker {
PublicKey pubKey, boolean crlSignFlag)
throws CertPathValidatorException
{
if (debug != null) {
debug.println("RevocationChecker.check: checking cert" +
"\n SN: " + Debug.toHexString(xcert.getSerialNumber()) +
"\n Subject: " + xcert.getSubjectX500Principal() +
"\n Issuer: " + xcert.getIssuerX500Principal());
}
try {
if (onlyEE && xcert.getBasicConstraints() != -1) {
if (debug != null) {
debug.println("Skipping revocation check, not end " +
"entity cert");
debug.println("Skipping revocation check; cert is not " +
"an end entity cert");
}
return;
}
......
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -136,7 +136,8 @@ public final class SunCertPathBuilder extends CertPathBuilderSpi {
PKIXCertPathBuilderResult result = buildCertPath(false, adjList);
if (result == null) {
if (debug != null) {
debug.println("SunCertPathBuilder.engineBuild: 2nd pass");
debug.println("SunCertPathBuilder.engineBuild: 2nd pass; " +
"try building again searching all certstores");
}
// try again
adjList.clear();
......
/*
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -59,6 +59,10 @@ import static sun.security.ssl.CipherSuite.KeyExchange.*;
*/
final class ClientHandshaker extends Handshaker {
// constants for subject alt names of type DNS and IP
private final static int ALTNAME_DNS = 2;
private final static int ALTNAME_IP = 7;
// the server's public key from its certificate.
private PublicKey serverKey;
......@@ -818,6 +822,11 @@ final class ClientHandshaker extends Handshaker {
} else {
warningSE(Alerts.alert_no_certificate);
}
if (debug != null && Debug.isOn("handshake")) {
System.out.println(
"Warning: no suitable certificate found - " +
"continuing without client authentication");
}
}
//
......@@ -1497,20 +1506,49 @@ final class ClientHandshaker extends Handshaker {
return true;
}
// check the iPAddress field in subjectAltName extension
Object thisIPAddress = getSubjectAltName(thisCert, 7); // 7: iPAddress
Object prevIPAddress = getSubjectAltName(prevCert, 7);
if (thisIPAddress != null && prevIPAddress!= null) {
// only allow the exactly match
return Objects.equals(thisIPAddress, prevIPAddress);
// check subject alternative names
Collection<List<?>> thisSubjectAltNames = null;
try {
thisSubjectAltNames = thisCert.getSubjectAlternativeNames();
} catch (CertificateParsingException cpe) {
if (debug != null && Debug.isOn("handshake")) {
System.out.println(
"Attempt to obtain subjectAltNames extension failed!");
}
}
// check the dNSName field in subjectAltName extension
Object thisDNSName = getSubjectAltName(thisCert, 2); // 2: dNSName
Object prevDNSName = getSubjectAltName(prevCert, 2);
if (thisDNSName != null && prevDNSName!= null) {
// only allow the exactly match
return Objects.equals(thisDNSName, prevDNSName);
Collection<List<?>> prevSubjectAltNames = null;
try {
prevSubjectAltNames = prevCert.getSubjectAlternativeNames();
} catch (CertificateParsingException cpe) {
if (debug != null && Debug.isOn("handshake")) {
System.out.println(
"Attempt to obtain subjectAltNames extension failed!");
}
}
if ((thisSubjectAltNames != null) && (prevSubjectAltNames != null)) {
// check the iPAddress field in subjectAltName extension
Collection<String> thisSubAltIPAddrs =
getSubjectAltNames(thisSubjectAltNames, ALTNAME_IP);
Collection<String> prevSubAltIPAddrs =
getSubjectAltNames(prevSubjectAltNames, ALTNAME_IP);
if ((thisSubAltIPAddrs != null) && (prevSubAltIPAddrs != null) &&
(isEquivalent(thisSubAltIPAddrs, prevSubAltIPAddrs))) {
return true;
}
// check the dNSName field in subjectAltName extension
Collection<String> thisSubAltDnsNames =
getSubjectAltNames(thisSubjectAltNames, ALTNAME_DNS);
Collection<String> prevSubAltDnsNames =
getSubjectAltNames(prevSubjectAltNames, ALTNAME_DNS);
if ((thisSubAltDnsNames != null) && (prevSubAltDnsNames != null) &&
(isEquivalent(thisSubAltDnsNames, prevSubAltDnsNames))) {
return true;
}
}
// check the certificate subject and issuer
......@@ -1531,29 +1569,43 @@ final class ClientHandshaker extends Handshaker {
/*
* Returns the subject alternative name of the specified type in the
* subjectAltNames extension of a certificate.
*
* Note that only those subjectAltName types that use String data
* should be passed into this function.
*/
private static Object getSubjectAltName(X509Certificate cert, int type) {
Collection<List<?>> subjectAltNames;
try {
subjectAltNames = cert.getSubjectAlternativeNames();
} catch (CertificateParsingException cpe) {
if (debug != null && Debug.isOn("handshake")) {
System.out.println(
"Attempt to obtain subjectAltNames extension failed!");
private static Collection<String> getSubjectAltNames(
Collection<List<?>> subjectAltNames, int type) {
HashSet<String> subAltDnsNames = null;
for (List<?> subjectAltName : subjectAltNames) {
int subjectAltNameType = (Integer)subjectAltName.get(0);
if (subjectAltNameType == type) {
String subAltDnsName = (String)subjectAltName.get(1);
if ((subAltDnsName != null) && !subAltDnsName.isEmpty()) {
if (subAltDnsNames == null) {
subAltDnsNames =
new HashSet<>(subjectAltNames.size());
}
subAltDnsNames.add(subAltDnsName);
}
}
return null;
}
if (subjectAltNames != null) {
for (List<?> subjectAltName : subjectAltNames) {
int subjectAltNameType = (Integer)subjectAltName.get(0);
if (subjectAltNameType == type) {
return subjectAltName.get(1);
return subAltDnsNames;
}
private static boolean isEquivalent(Collection<String> thisSubAltNames,
Collection<String> prevSubAltNames) {
for (String thisSubAltName : thisSubAltNames) {
for (String prevSubAltName : prevSubAltNames) {
// Only allow the exactly match. Check no wildcard character.
if (thisSubAltName.equalsIgnoreCase(prevSubAltName)) {
return true;
}
}
}
return null;
return false;
}
}
......@@ -492,11 +492,14 @@ class CertificateMsg extends HandshakeMessage
void print(PrintStream s) throws IOException {
s.println("*** Certificate chain");
if (debug != null && Debug.isOn("verbose")) {
for (int i = 0; i < chain.length; i++)
if (chain.length == 0) {
s.println("<Empty>");
} else if (debug != null && Debug.isOn("verbose")) {
for (int i = 0; i < chain.length; i++) {
s.println("chain [" + i + "] = " + chain[i]);
s.println("***");
}
}
s.println("***");
}
X509Certificate[] getCertificateChain() {
......
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -142,7 +142,7 @@ public class FormatData_de extends ParallelListResourceBundle {
new String[] {
"Jan", // abb january
"Feb", // abb february
"Mrz", // abb march
"M\u00e4r", // abb march
"Apr", // abb april
"Mai", // abb may
"Jun", // abb june
......
......@@ -29,11 +29,9 @@ import static java.awt.RenderingHints.*;
import java.awt.color.ColorSpace;
import java.awt.image.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.security.action.GetIntegerAction;
import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection;
import sun.java2d.opengl.OGLRenderQueue;
import java.lang.reflect.InvocationTargetException;
public abstract class UNIXToolkit extends SunToolkit
{
......@@ -73,16 +71,16 @@ public abstract class UNIXToolkit extends SunToolkit
if (nativeGTKLoaded != null) {
// We've already attempted to load GTK, so just return the
// status of that attempt.
return nativeGTKLoaded.booleanValue();
return nativeGTKLoaded;
} else if (nativeGTKAvailable != null) {
// We've already checked the availability of the native GTK
// libraries, so just return the status of that attempt.
return nativeGTKAvailable.booleanValue();
return nativeGTKAvailable;
} else {
boolean success = check_gtk();
nativeGTKAvailable = Boolean.valueOf(success);
nativeGTKAvailable = success;
return success;
}
}
......@@ -99,11 +97,10 @@ public abstract class UNIXToolkit extends SunToolkit
public boolean loadGTK() {
synchronized (GTK_LOCK) {
if (nativeGTKLoaded == null) {
boolean success = load_gtk();
nativeGTKLoaded = Boolean.valueOf(success);
nativeGTKLoaded = load_gtk();
}
}
return nativeGTKLoaded.booleanValue();
return nativeGTKLoaded;
}
/**
......@@ -252,6 +249,7 @@ public abstract class UNIXToolkit extends SunToolkit
private native void nativeSync();
@Override
public void sync() {
// flush the X11 buffer
nativeSync();
......@@ -266,6 +264,8 @@ public abstract class UNIXToolkit extends SunToolkit
* This requires that the Gnome properties have already been gathered.
*/
public static final String FONTCONFIGAAHINT = "fontconfig/Antialias";
@Override
protected RenderingHints getDesktopAAHints() {
Object aaValue = getDesktopProperty("gnome.Xft/Antialias");
......@@ -288,8 +288,8 @@ public abstract class UNIXToolkit extends SunToolkit
* us to default to "OFF". I don't think that's the best guess.
* So if its !=0 then lets assume AA.
*/
boolean aa = Boolean.valueOf(((aaValue instanceof Number) &&
((Number)aaValue).intValue() != 0));
boolean aa = ((aaValue instanceof Number)
&& ((Number) aaValue).intValue() != 0);
Object aaHint;
if (aa) {
String subpixOrder =
......
......@@ -33,6 +33,7 @@
#include "jvm_md.h"
#include "sizecalc.h"
#include <jni_util.h>
#include "awt.h"
#define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0")
#define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0")
......@@ -890,6 +891,7 @@ gboolean gtk2_load(JNIEnv *env)
* BadMatch errors which we would normally ignore. The IO error handler
* is preserved here, too, just for consistency.
*/
AWT_LOCK();
handler = XSetErrorHandler(NULL);
io_handler = XSetIOErrorHandler(NULL);
......@@ -926,6 +928,7 @@ gboolean gtk2_load(JNIEnv *env)
XSetErrorHandler(handler);
XSetIOErrorHandler(io_handler);
AWT_UNLOCK();
/* Initialize widget array. */
for (i = 0; i < _GTK_WIDGET_TYPE_SIZE; i++)
......
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility;
@jdk.Exported(false)
abstract class AccessBridgeLoader {
/**
* Load JavaAccessBridge.DLL (our native half)
*/
static {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
System.loadLibrary("JavaAccessBridge-32");
return null;
}
}, null, new java.lang.RuntimePermission("loadLibrary.JavaAccessBridge-32")
);
}
boolean useJAWT_DLL = false;
/**
* AccessBridgeLoader constructor
*/
AccessBridgeLoader() {
// load JAWTAccessBridge.DLL on JDK 1.4.1 or later
// determine which version of the JDK is running
String version = System.getProperty("java.version");
if (version != null)
useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
if (useJAWT_DLL) {
// Note that we have to explicitly load JAWT.DLL
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
System.loadLibrary("JAWT");
System.loadLibrary("JAWTAccessBridge-32");
return null;
}
}, null, new RuntimePermission("loadLibrary.JAWT"),
new RuntimePermission("loadLibrary.JAWTAccessBridge-32")
);
}
}
}
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility;
@jdk.Exported(false)
abstract class AccessBridgeLoader {
/**
* Load JavaAccessBridge.DLL (our native half)
*/
static {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
System.loadLibrary("JavaAccessBridge-64");
return null;
}
}, null, new RuntimePermission("loadLibrary.JavaAccessBridge-64")
);
}
boolean useJAWT_DLL = false;
/**
* AccessBridgLoader constructor
*/
AccessBridgeLoader() {
// load JAWTAccessBridge.DLL on JDK 1.4.1 or later
String version = System.getProperty("java.version");
if (version != null)
useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
if (useJAWT_DLL) {
// Note that we have to explicitly load JAWT.DLL
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
System.loadLibrary("JAWT");
System.loadLibrary("JAWTAccessBridge-64");
return null;
}
}, null, new RuntimePermission("loadLibrary.JAWT"),
new RuntimePermission("loadLibrary.JAWTAccessBridge-64")
);
}
}
}
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.extensions;
import javax.accessibility.*;
/**
* <P>Class AccessibleExtendedRelation contains extensions to the class
* AccessibleRelation that are currently not in a public API.
*
* <P>Class AccessibleRelation describes a relation between the
* object that implements the AccessibleRelation and one or more other
* objects. The actual relations that an object has with other
* objects are defined as an AccessibleRelationSet, which is a composed
* set of AccessibleRelations.
* <p>The toDisplayString method allows you to obtain the localized string
* for a locale independent key from a predefined ResourceBundle for the
* keys defined in this class.
* <p>The constants in this class present a strongly typed enumeration
* of common object roles. If the constants in this class are not sufficient
* to describe the role of an object, a subclass should be generated
* from this class and it should provide constants in a similar manner.
*
*/
public class AccessibleExtendedRelation
extends AccessibleExtendedRelationConstants {
public AccessibleExtendedRelation(String s) {
super(s);
}
public AccessibleExtendedRelation(String key, Object target) {
super(key, target);
}
}
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.extensions;
import javax.accessibility.*;
/**
* <P>Class AccessibleExtendedRelation contains extensions to the class
* AccessibleRelation that are currently not in a public API.
*
* <P>Class AccessibleRelation describes a relation between the
* object that implements the AccessibleRelation and one or more other
* objects. The actual relations that an object has with other
* objects are defined as an AccessibleRelationSet, which is a composed
* set of AccessibleRelations.
* <p>The toDisplayString method allows you to obtain the localized string
* for a locale independent key from a predefined ResourceBundle for the
* keys defined in this class.
* <p>The constants in this class present a strongly typed enumeration
* of common object roles. If the constants in this class are not sufficient
* to describe the role of an object, a subclass should be generated
* from this class and it should provide constants in a similar manner.
*
*/
public abstract class AccessibleExtendedRelationConstants
extends AccessibleRelation {
/**
* Indicates that one AccessibleText object is linked to the
* target AccessibleText object(s). <p> A good example is a StarOffice
* text window with the bottom of one page, a footer, a header,
* and the top of another page all visible in the window. There
* should be a FLOWS_TO relation from the last chunk of AccessibleText
* in the bottom of one page to the first AccessibleText object at the
* top of the next page, skipping over the AccessibleText object(s)
* that make up the header and footer. A corresponding FLOWS_FROM
* relation would link the AccessibleText object in the next page to
* the last one in the previous page.
* @see AccessibleExtendedRole.FLOWS_FROM
*/
public static final String FLOWS_TO = "flowsTo";
/**
* Indicates that one AccessibleText object is linked to the
* target AccessibleText object(s).
* @see AccessibleExtendedRole.FLOWS_TO
*/
public static final String FLOWS_FROM = "flowsFrom";
/**
* Indicates a component is a subwindow of a target component
*/
public static final String SUBWINDOW_OF = "subwindowOf";
/**
* Identifies that the linkage between one AccessibleText
* object and the target AccessibleText object(s) has changed.
* @see AccessibleExtendedRole.FLOWS_TO
* @see AccessibleExtendedRole.FLOWS_FROM
*/
public static final String FLOWS_TO_PROPERTY = "flowsToProperty";
/**
* Identifies that the linkage between one AccessibleText
* object and the target AccessibleText object(s) has changed.
* @see AccessibleExtendedRole.FLOWS_TO
* @see AccessibleExtendedRole.FLOWS_FROM
*/
public static final String FLOWS_FROM_PROPERTY = "flowsFromProperty";
/**
* Identifies the subwindow relationship between two components
* has changed
*/
public static final String SUBWINDOW_OF_PROPERTY = "subwindowOfProperty";
public AccessibleExtendedRelationConstants(String s) {
super(s);
}
public AccessibleExtendedRelationConstants(String key, Object target) {
super(key, target);
}
}
/*
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.extensions;
import javax.accessibility.*;
/**
* <P>Class AccessibleExtendedRole contains extensions to the class
* AccessibleRole that are currently not in a public API.
*
* <P>Class AccessibleRole determines the role of a component. The role
* of a component describes its generic function. (E.G.,
* "push button," "table," or "list.")
* <p>The constants in this class present a strongly typed enumeration
* of common object roles. A public constructor for this class has been
* purposely omitted and applications should use one of the constants
* from this class. If the constants in this class are not sufficient
* to describe the role of an object, a subclass should be generated
* from this class and it should provide constants in a similar manner.
*
*/
public class AccessibleExtendedRole extends AccessibleExtendedRoleConstants {
public AccessibleExtendedRole(String s) {
super(s);
}
}
/*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.extensions;
import javax.accessibility.*;
/**
* <P>Class AccessibleExtendedRole contains extensions to the class
* AccessibleRole that are currently not in a public API.
*
* <P>Class AccessibleRole determines the role of a component. The role
* of a component describes its generic function. (E.G.,
* "push button," "table," or "list.")
* <p>The constants in this class present a strongly typed enumeration
* of common object roles. A public constructor for this class has been
* purposely omitted and applications should use one of the constants
* from this class. If the constants in this class are not sufficient
* to describe the role of an object, a subclass should be generated
* from this class and it should provide constants in a similar manner.
*
*/
public abstract class AccessibleExtendedRoleConstants extends AccessibleRole {
/**
* Indicates this component is a text header.
*/
public static final AccessibleExtendedRole HEADER
= new AccessibleExtendedRole("Header");
/**
* Indicates this component is a text footer.
*/
public static final AccessibleExtendedRole FOOTER
= new AccessibleExtendedRole("Footer");
/**
* Indicates this component is a text paragraph.
*/
public static final AccessibleExtendedRole PARAGRAPH
= new AccessibleExtendedRole("Paragraph");
/**
* Indicates this component is a ruler.
*/
public static final AccessibleExtendedRole RULER
= new AccessibleExtendedRole("RULER");
public AccessibleExtendedRoleConstants(String s) {
super(s);
}
}
/*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.extensions;
import javax.accessibility.*;
/**
* <P>Class AccessibleState describes a component's particular state. The actual
* state of the component is defined as an AccessibleStateSet, which is a
* composed set of AccessibleStates.
* <p>The toDisplayString method allows you to obtain the localized string
* for a locale independent key from a predefined ResourceBundle for the
* keys defined in this class.
* <p>The constants in this class present a strongly typed enumeration
* of common object roles. A public constructor for this class has been
* purposely omitted and applications should use one of the constants
* from this class. If the constants in this class are not sufficient
* to describe the role of an object, a subclass should be generated
* from this class and it should provide constants in a similar manner.
*
*/
public abstract class AccessibleExtendedState
extends AccessibleExtendedStateConstants {
public AccessibleExtendedState(String s) {
super(s);
}
}
/*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.extensions;
import javax.accessibility.*;
/**
* <P>Class AccessibleState describes a component's particular state. The actual
* state of the component is defined as an AccessibleStateSet, which is a
* composed set of AccessibleStates.
* <p>The toDisplayString method allows you to obtain the localized string
* for a locale independent key from a predefined ResourceBundle for the
* keys defined in this class.
* <p>The constants in this class present a strongly typed enumeration
* of common object roles. A public constructor for this class has been
* purposely omitted and applications should use one of the constants
* from this class. If the constants in this class are not sufficient
* to describe the role of an object, a subclass should be generated
* from this class and it should provide constants in a similar manner.
*
*/
public abstract class AccessibleExtendedStateConstants extends AccessibleState {
/**
* Indicates a component is responsible for managing
* its subcomponents.
*/
public static final AccessibleExtendedState MANAGES_DESCENDENTS
= new AccessibleExtendedState("managesDescendents");
public AccessibleExtendedStateConstants(String s) {
super(s);
}
}
/*
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility;
@jdk.Exported(false)
abstract class AccessBridgeLoader {
/**
* Load JavaAccessBridge.DLL (our native half)
*/
static {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
System.loadLibrary("JavaAccessBridge");
return null;
}
}, null, new RuntimePermission("loadLibrary.JavaAccessBridge")
);
}
boolean useJAWT_DLL = false;
/**
* AccessBridgeLoader constructor
*/
AccessBridgeLoader() {
String version = System.getProperty("java.version");
if (version != null)
useJAWT_DLL = (version.compareTo("1.4.1") >= 0);
// load JAWTAccessBridge.DLL on JDK 1.4.1 or later
if (useJAWT_DLL) {
// Note that we have to explicitly load JAWT.DLL
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
System.loadLibrary("JAWT");
System.loadLibrary("JAWTAccessBridge");
return null;
}
}, null, new RuntimePermission("loadLibrary.JAWT"),
new RuntimePermission("loadLibrary.JAWTAccessBridge")
);
}
}
}
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.util;
import java.util.*;
import java.beans.*;
import java.awt.*;
import java.awt.event.*;
import javax.accessibility.*;
/**
* <P>{@code AccessibilityEventMonitor} implements a PropertyChange listener
* on every UI object that implements interface {@code Accessible} in the Java
* Virtual Machine. The events captured by these listeners are made available
* through listeners supported by {@code AccessibilityEventMonitor}.
* With this, all the individual events on each of the UI object
* instances are funneled into one set of PropertyChange listeners.
* <p>This class depends upon {@link EventQueueMonitor}, which provides the base
* level support for capturing the top-level containers as they are created.
*
*/
@jdk.Exported
public class AccessibilityEventMonitor {
// listeners
/**
* The current list of registered {@link java.beans.PropertyChangeListener
* PropertyChangeListener} classes.
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
*/
static protected final AccessibilityListenerList listenerList =
new AccessibilityListenerList();
/**
* The actual listener that is installed on the component instances.
* This listener calls the other registered listeners when an event
* occurs. By doing things this way, the actual number of listeners
* installed on a component instance is drastically reduced.
*/
static protected final AccessibilityEventListener accessibilityListener =
new AccessibilityEventListener();
/**
* Adds the specified listener to receive all PropertyChange events on
* each UI object instance in the Java Virtual Machine as they occur.
* <P>Note: This listener is automatically added to all component
* instances created after this method is called. In addition, it
* is only added to UI object instances that support this listener type.
*
* @param l the listener to add
*
* @see #removePropertyChangeListener
*/
static public void addPropertyChangeListener(PropertyChangeListener l) {
if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
accessibilityListener.installListeners();
}
listenerList.add(PropertyChangeListener.class, l);
}
/**
* Removes the specified listener so it no longer receives PropertyChange
* events when they occur.
* @see #addPropertyChangeListener
* @param l the listener to remove
*/
static public void removePropertyChangeListener(PropertyChangeListener l) {
listenerList.remove(PropertyChangeListener.class, l);
if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
accessibilityListener.removeListeners();
}
}
/**
* AccessibilityEventListener is the class that does all the work for
* AccessibilityEventMonitor. It is not intended for use by any other
* class except AccessibilityEventMonitor.
*
*/
static class AccessibilityEventListener implements TopLevelWindowListener,
PropertyChangeListener {
/**
* Create a new instance of this class and install it on each component
* instance in the virtual machine that supports any of the currently
* registered listeners in AccessibilityEventMonitor. Also registers
* itself as a TopLevelWindowListener with EventQueueMonitor so it can
* automatically add new listeners to new components.
* @see EventQueueMonitor
* @see AccessibilityEventMonitor
*/
public AccessibilityEventListener() {
EventQueueMonitor.addTopLevelWindowListener(this);
}
/**
* Installs PropertyChange listeners on all Accessible objects based
* upon the current topLevelWindows cached by EventQueueMonitor.
* @see EventQueueMonitor
* @see AWTEventMonitor
*/
protected void installListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
if (topLevelWindows[i] instanceof Accessible) {
installListeners((Accessible) topLevelWindows[i]);
}
}
}
}
/**
* Installs PropertyChange listeners to the Accessible object, and it's
* children (so long as the object isn't of TRANSIENT state).
* @param a the Accessible object to add listeners to
*/
protected void installListeners(Accessible a) {
installListeners(a.getAccessibleContext());
}
/**
* Installs PropertyChange listeners to the AccessibleContext object,
* and it's * children (so long as the object isn't of TRANSIENT state).
* @param a the Accessible object to add listeners to
*/
private void installListeners(AccessibleContext ac) {
if (ac != null) {
AccessibleStateSet states = ac.getAccessibleStateSet();
if (!states.contains(AccessibleState.TRANSIENT)) {
ac.addPropertyChangeListener(this);
/*
* Don't add listeners to transient children. Components
* with transient children should return an AccessibleStateSet
* containing AccessibleState.MANAGES_DESCENDANTS. Components
* may not explicitly return the MANAGES_DESCENDANTS state.
* In this case, don't add listeners to the children of
* lists, tables and trees.
*/
AccessibleStateSet set = ac.getAccessibleStateSet();
if (set.contains(_AccessibleState.MANAGES_DESCENDANTS)) {
return;
}
AccessibleRole role = ac.getAccessibleRole();
if (role == AccessibleRole.LIST ||
role == AccessibleRole.TREE) {
return;
}
if (role == AccessibleRole.TABLE) {
// handle Oracle tables containing tables
Accessible child = ac.getAccessibleChild(0);
if (child != null) {
AccessibleContext ac2 = child.getAccessibleContext();
if (ac2 != null) {
role = ac2.getAccessibleRole();
if (role != null && role != AccessibleRole.TABLE) {
return;
}
}
}
}
int count = ac.getAccessibleChildrenCount();
for (int i = 0; i < count; i++) {
Accessible child = ac.getAccessibleChild(i);
if (child != null) {
installListeners(child);
}
}
}
}
}
/**
* Removes PropertyChange listeners on all Accessible objects based
* upon the topLevelWindows cached by EventQueueMonitor.
* @param eventID the event ID
* @see EventID
*/
protected void removeListeners() {
Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
if (topLevelWindows != null) {
for (int i = 0; i < topLevelWindows.length; i++) {
if (topLevelWindows[i] instanceof Accessible) {
removeListeners((Accessible) topLevelWindows[i]);
}
}
}
}
/**
* Removes PropertyChange listeners for the given Accessible object,
* it's children (so long as the object isn't of TRANSIENT state).
* @param a the Accessible object to remove listeners from
*/
protected void removeListeners(Accessible a) {
removeListeners(a.getAccessibleContext());
}
/**
* Removes PropertyChange listeners for the given AccessibleContext
* object, it's children (so long as the object isn't of TRANSIENT
* state).
* @param a the Accessible object to remove listeners from
*/
private void removeListeners(AccessibleContext ac) {
if (ac != null) {
// Listeners are not added to transient components.
AccessibleStateSet states = ac.getAccessibleStateSet();
if (!states.contains(AccessibleState.TRANSIENT)) {
ac.removePropertyChangeListener(this);
/*
* Listeners are not added to transient children. Components
* with transient children should return an AccessibleStateSet
* containing AccessibleState.MANAGES_DESCENDANTS. Components
* may not explicitly return the MANAGES_DESCENDANTS state.
* In this case, don't remove listeners from the children of
* lists, tables and trees.
*/
if (states.contains(_AccessibleState.MANAGES_DESCENDANTS)) {
return;
}
AccessibleRole role = ac.getAccessibleRole();
if (role == AccessibleRole.LIST ||
role == AccessibleRole.TABLE ||
role == AccessibleRole.TREE) {
return;
}
int count = ac.getAccessibleChildrenCount();
for (int i = 0; i < count; i++) {
Accessible child = ac.getAccessibleChild(i);
if (child != null) {
removeListeners(child);
}
}
}
}
}
/********************************************************************/
/* */
/* Listener Interface Methods */
/* */
/********************************************************************/
/* TopLevelWindow Methods ***************************************/
/**
* Called when top level window is created.
* @see EventQueueMonitor
* @see EventQueueMonitor#addTopLevelWindowListener
*/
public void topLevelWindowCreated(Window w) {
if (w instanceof Accessible) {
installListeners((Accessible) w);
}
}
/**
* Called when top level window is destroyed.
* @see EventQueueMonitor
* @see EventQueueMonitor#addTopLevelWindowListener
*/
public void topLevelWindowDestroyed(Window w) {
if (w instanceof Accessible) {
removeListeners((Accessible) w);
}
}
/* PropertyChangeListener Methods **************************************/
public void propertyChange(PropertyChangeEvent e) {
// propogate the event
Object[] listeners =
AccessibilityEventMonitor.listenerList.getListenerList();
for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i]==PropertyChangeListener.class) {
((PropertyChangeListener)listeners[i+1]).propertyChange(e);
}
}
// handle childbirth/death
String name = e.getPropertyName();
if (name.compareTo(AccessibleContext.ACCESSIBLE_CHILD_PROPERTY) == 0) {
Object oldValue = e.getOldValue();
Object newValue = e.getNewValue();
if ((oldValue == null) ^ (newValue == null)) { // one null, not both
if (oldValue != null) {
// this Accessible is a child that's going away
if (oldValue instanceof Accessible) {
Accessible a = (Accessible) oldValue;
removeListeners(a.getAccessibleContext());
} else if (oldValue instanceof AccessibleContext) {
removeListeners((AccessibleContext) oldValue);
}
} else if (newValue != null) {
// this Accessible is a child was just born
if (newValue instanceof Accessible) {
Accessible a = (Accessible) newValue;
installListeners(a.getAccessibleContext());
} else if (newValue instanceof AccessibleContext) {
installListeners((AccessibleContext) newValue);
}
}
} else {
System.out.println("ERROR in usage of PropertyChangeEvents for: " + e.toString());
}
}
}
}
}
/*
* workaround for no public AccessibleState constructor
*/
class _AccessibleState extends AccessibleState {
/**
* Indicates this object is responsible for managing its
* subcomponents. This is typically used for trees and tables
* that have a large number of subcomponents and where the
* objects are created only when needed and otherwise remain virtual.
* The application should not manage the subcomponents directly.
*/
public static final _AccessibleState MANAGES_DESCENDANTS
= new _AccessibleState ("managesDescendants");
/**
* Creates a new AccessibleState using the given locale independent key.
* This should not be a public method. Instead, it is used to create
* the constants in this file to make it a strongly typed enumeration.
* Subclasses of this class should enforce similar policy.
* <p>
* The key String should be a locale independent key for the state.
* It is not intended to be used as the actual String to display
* to the user. To get the localized string, use toDisplayString.
*
* @param key the locale independent name of the state.
* @see AccessibleBundle#toDisplayString
*/
protected _AccessibleState(String key) {
super(key);
}
}
/*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.util;
import java.util.*;
import java.beans.*;
import java.awt.*;
import java.awt.event.*;
import javax.accessibility.*;
/**
* <P>The {@code AccessibilityListenerList} is a copy of the Swing
* {@link javax.swing.event.EventListenerList EventListerList} class.
*
*/
@jdk.Exported
public class AccessibilityListenerList {
/* A null array to be shared by all empty listener lists */
private final static Object[] NULL_ARRAY = new Object[0];
/**
* The list of listener type, listener pairs
*/
protected transient Object[] listenerList = NULL_ARRAY;
/**
* Passes back the event listener list as an array of listener type, listener pairs.
* Note that for performance reasons, this implementation passes back the actual
* data structure in which the listener data is stored internally. This method
* is guaranteed to pass back a non-null array, so that no null-checking
* is required in fire methods. A zero-length array of Object is returned if
* there are currently no listeners.
* <p>
* Absolutely no modification of the data contained in this array should be
* made. If any such manipulation is necessary, it should be done on a copy
* of the array returned rather than the array itself.
*
* @return an array of listener type, listener pairs.
*/
public Object[] getListenerList() {
return listenerList;
}
/**
* Returns the total number of listeners for this listener list.
*
* @return the total number of listeners for this listener list.
*/
public int getListenerCount() {
return listenerList.length/2;
}
/**
* Return the total number of listeners of the supplied type
* for this listener list.
*
* @param t the type of the listener to be counted
* @return the number of listeners found
*/
public int getListenerCount(Class t) {
int count = 0;
Object[] lList = listenerList;
for (int i = 0; i < lList.length; i+=2) {
if (t == (Class)lList[i])
count++;
}
return count;
}
/**
* Add the listener as a listener of the specified type.
*
* @param t the type of the listener to be added
* @param l the listener to be added
*/
public synchronized void add(Class t, EventListener l) {
if (!t.isInstance(l)) {
throw new IllegalArgumentException("Listener " + l +
" is not of type " + t);
}
if (l ==null) {
throw new IllegalArgumentException("Listener " + l +
" is null");
}
if (listenerList == NULL_ARRAY) {
// if this is the first listener added,
// initialize the lists
listenerList = new Object[] { t, l };
} else {
// Otherwise copy the array and add the new listener
int i = listenerList.length;
Object[] tmp = new Object[i+2];
System.arraycopy(listenerList, 0, tmp, 0, i);
tmp[i] = t;
tmp[i+1] = l;
listenerList = tmp;
}
}
/**
* Remove the listener as a listener of the specified type.
*
* @param t the type of the listener to be removed
* @param l the listener to be removed
*/
public synchronized void remove(Class t, EventListener l) {
if (!t.isInstance(l)) {
throw new IllegalArgumentException("Listener " + l +
" is not of type " + t);
}
if (l ==null) {
throw new IllegalArgumentException("Listener " + l +
" is null");
}
// Is l on the list?
int index = -1;
for (int i = listenerList.length-2; i>=0; i-=2) {
if ((listenerList[i]==t) && (listenerList[i+1] == l)) {
index = i;
break;
}
}
// If so, remove it
if (index != -1) {
Object[] tmp = new Object[listenerList.length-2];
// Copy the list up to index
System.arraycopy(listenerList, 0, tmp, 0, index);
// Copy from two past the index, up to
// the end of tmp (which is two elements
// shorter than the old list)
if (index < tmp.length)
System.arraycopy(listenerList, index+2, tmp, index,
tmp.length - index);
// set the listener array to the new array or null
listenerList = (tmp.length == 0) ? NULL_ARRAY : tmp;
}
}
/**
* Return a string representation of the {@code AccessibilityListenerList}.
*
* @return a string representation of the {@code AccessibilityListenerList}.
*/
public String toString() {
Object[] lList = listenerList;
String s = "EventListenerList: ";
s += lList.length/2 + " listeners: ";
for (int i = 0 ; i <= lList.length-2 ; i+=2) {
s += " type " + ((Class)lList[i]).getName();
s += " listener " + lList[i+1];
}
return s;
}
}
/*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.java.accessibility.util;
/**
* EventID contains integer constants that map to event support in
* AWT and Swing. They are used by primarily by AWTEventMonitor,
* AWTEventsListener, SwingEventMonitor, and SwingEventListener, but
* can be freely used by any other class.
*
* @see AWTEventMonitor
* @see SwingEventMonitor
*
*/
@jdk.Exported
public class EventID {
/**
* Maps to AWT Action support (i.e., ActionListener and ActionEvent)
*/
static public final int ACTION = 0;
/**
* Maps to AWT Adjustment support (i.e., AdjustmentListener
* and AdjustmentEvent)
*/
static public final int ADJUSTMENT = 1;
/**
* Maps to AWT Component support (i.e., ComponentListener
* and ComponentEvent)
*/
static public final int COMPONENT = 2;
/**
* Maps to AWT Container support (i.e., ContainerListener
* and ContainerEvent)
*/
static public final int CONTAINER = 3;
/**
* Maps to AWT Focus support (i.e., FocusListener and FocusEvent)
*/
static public final int FOCUS = 4;
/**
* Maps to AWT Item support (i.e., ItemListener and ItemEvent)
*/
static public final int ITEM = 5;
/**
* Maps to AWT Key support (i.e., KeyListener and KeyEvent)
*/
static public final int KEY = 6;
/**
* Maps to AWT Mouse support (i.e., MouseListener and MouseEvent)
*/
static public final int MOUSE = 7;
/**
* Maps to AWT MouseMotion support (i.e., MouseMotionListener
* and MouseMotionEvent)
*/
static public final int MOTION = 8;
/**
* Maps to AWT Text support (i.e., TextListener and TextEvent)
*/
static public final int TEXT = 10;
/**
* Maps to AWT Window support (i.e., WindowListener and WindowEvent)
*/
static public final int WINDOW = 11;
/**
* Maps to Swing Ancestor support (i.e., AncestorListener and
* AncestorEvent)
*/
static public final int ANCESTOR = 12;
/**
* Maps to Swing Text Caret support (i.e., CaretListener and
* CaretEvent)
*/
static public final int CARET = 13;
/**
* Maps to Swing CellEditor support (i.e., CellEditorListener and
* CellEditorEvent)
*/
static public final int CELLEDITOR = 14;
/**
* Maps to Swing Change support (i.e., ChangeListener and
* ChangeEvent)
*/
static public final int CHANGE = 15;
/**
* Maps to Swing TableColumnModel support (i.e.,
* TableColumnModelListener and TableColumnModelEvent)
*/
static public final int COLUMNMODEL = 16;
/**
* Maps to Swing Document support (i.e., DocumentListener and
* DocumentEvent)
*/
static public final int DOCUMENT = 17;
/**
* Maps to Swing ListData support (i.e., ListDataListener and
* ListDataEvent)
*/
static public final int LISTDATA = 18;
/**
* Maps to Swing ListSelection support (i.e., ListSelectionListener and
* ListSelectionEvent)
*/
static public final int LISTSELECTION = 19;
/**
* Maps to Swing Menu support (i.e., MenuListener and
* MenuEvent)
*/
static public final int MENU = 20;
/**
* Maps to Swing PopupMenu support (i.e., PopupMenuListener and
* PopupMenuEvent)
*/
static public final int POPUPMENU = 21;
/**
* Maps to Swing TableModel support (i.e., TableModelListener and
* TableModelEvent)
*/
static public final int TABLEMODEL = 22;
/**
* Maps to Swing TreeExpansion support (i.e., TreeExpansionListener and
* TreeExpansionEvent)
*/
static public final int TREEEXPANSION = 23;
/**
* Maps to Swing TreeModel support (i.e., TreeModelListener and
* TreeModelEvent)
*/
static public final int TREEMODEL = 24;
/**
* Maps to Swing TreeSelection support (i.e., TreeSelectionListener and
* TreeSelectionEvent)
*/
static public final int TREESELECTION = 25;
/**
* Maps to Swing UndoableEdit support (i.e., UndoableEditListener and
* UndoableEditEvent)
*/
static public final int UNDOABLEEDIT = 26;
/**
* Maps to Beans PropertyChange support (i.e., PropertyChangeListener
* and PropertyChangeEvent)
*/
static public final int PROPERTYCHANGE = 27;
/**
* Maps to Beans VetoableChange support (i.e., VetoableChangeListener
* and VetoableChangeEvent)
*/
static public final int VETOABLECHANGE = 28;
/**
* Maps to Swing InternalFrame support (i.e., InternalFrameListener)
*/
static public final int INTERNALFRAME = 29;
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Common AccessBridge IPC message definitions
*/
#include "AccessBridgeMessages.h"
// unique broadcast msg. IDs gotten dymanically
// wParam == sourceHwnc; lParam = *vmID
UINT theFromJavaHelloMsgID;
// wParam == sourceHwnc; lParam unused
UINT theFromWindowsHelloMsgID;
BOOL initBroadcastMessageIDs() {
theFromJavaHelloMsgID = RegisterWindowMessage("AccessBridge-FromJava-Hello");
theFromWindowsHelloMsgID = RegisterWindowMessage("AccessBridge-FromWindows-Hello");
if (theFromJavaHelloMsgID == 0 || theFromWindowsHelloMsgID) {
return FALSE;
}
return TRUE;
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
#
# Load the Java Access Bridge class into the JVM
#
#assistive_technologies=com.sun.java.accessibility.AccessBridge
#screen_magnifier_present=true
此差异已折叠。
此差异已折叠。
#define XSTR(x) STR(x)
#define STR(x) #x
1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ XSTR(JAB_MANIFEST_EMBED)
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册