Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e00c8b91
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e00c8b91
编写于
9月 27, 2010
作者:
A
ant
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
Reviewed-by: dcherepanov, art
上级
efdd622b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
110 addition
and
3 deletion
+110
-3
src/share/classes/java/awt/KeyboardFocusManager.java
src/share/classes/java/awt/KeyboardFocusManager.java
+3
-0
src/share/classes/sun/awt/AWTAccessor.java
src/share/classes/sun/awt/AWTAccessor.java
+5
-0
src/share/classes/sun/awt/EmbeddedFrame.java
src/share/classes/sun/awt/EmbeddedFrame.java
+39
-1
src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java
src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java
+32
-0
src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
+18
-0
src/windows/classes/sun/awt/windows/WEmbeddedFrame.java
src/windows/classes/sun/awt/windows/WEmbeddedFrame.java
+13
-2
未找到文件。
src/share/classes/java/awt/KeyboardFocusManager.java
浏览文件 @
e00c8b91
...
...
@@ -142,6 +142,9 @@ public abstract class KeyboardFocusManager
public
void
removeLastFocusRequest
(
Component
heavyweight
)
{
KeyboardFocusManager
.
removeLastFocusRequest
(
heavyweight
);
}
public
void
setMostRecentFocusOwner
(
Window
window
,
Component
component
)
{
KeyboardFocusManager
.
setMostRecentFocusOwner
(
window
,
component
);
}
}
);
}
...
...
src/share/classes/sun/awt/AWTAccessor.java
浏览文件 @
e00c8b91
...
...
@@ -344,6 +344,11 @@ public final class AWTAccessor {
* Removes the last focus request for the heavyweight from the queue.
*/
void
removeLastFocusRequest
(
Component
heavyweight
);
/*
* Sets the most recent focus owner in the window.
*/
void
setMostRecentFocusOwner
(
Window
window
,
Component
component
);
}
/*
...
...
src/share/classes/sun/awt/EmbeddedFrame.java
浏览文件 @
e00c8b91
...
...
@@ -70,7 +70,10 @@ public abstract class EmbeddedFrame extends Frame
// JDK 1.1 compatibility
private
static
final
long
serialVersionUID
=
2967042741780317130L
;
// Use these in traverseOut method to determine directions
/*
* The constants define focus traversal directions.
* Use them in {@code traverseIn}, {@code traverseOut} methods.
*/
protected
static
final
boolean
FORWARD
=
true
;
protected
static
final
boolean
BACKWARD
=
false
;
...
...
@@ -283,6 +286,41 @@ public abstract class EmbeddedFrame extends Frame
return
false
;
}
/**
* This method is called by the embedder when we should receive focus as element
* of the traversal chain. The method requests focus on:
* 1. the first Component of this EmbeddedFrame if user moves focus forward
* in the focus traversal cycle.
* 2. the last Component of this EmbeddedFrame if user moves focus backward
* in the focus traversal cycle.
*
* The direction parameter specifies which of the two mentioned cases is
* happening. Use FORWARD and BACKWARD constants defined in the EmbeddedFrame class
* to avoid confusing boolean values.
*
* A concrete implementation of this method is defined in the platform-dependent
* subclasses.
*
* @param direction FORWARD or BACKWARD
* @return true, if the EmbeddedFrame wants to get focus, false otherwise.
*/
public
boolean
traverseIn
(
boolean
direction
)
{
Component
comp
=
null
;
if
(
direction
==
FORWARD
)
{
comp
=
getFocusTraversalPolicy
().
getFirstComponent
(
this
);
}
else
{
comp
=
getFocusTraversalPolicy
().
getLastComponent
(
this
);
}
if
(
comp
!=
null
)
{
// comp.requestFocus(); - Leads to a hung.
AWTAccessor
.
getKeyboardFocusManagerAccessor
().
setMostRecentFocusOwner
(
this
,
comp
);
synthesizeWindowActivation
(
true
);
}
return
(
null
!=
comp
);
}
/**
* This method is called from dispatchKeyEvent in the following two cases:
* 1. The focus is on the first Component of this EmbeddedFrame and we are
...
...
src/solaris/classes/sun/awt/X11/XEmbeddedFrame.java
浏览文件 @
e00c8b91
...
...
@@ -28,9 +28,12 @@ package sun.awt.X11;
import
sun.awt.EmbeddedFrame
;
import
java.awt.*
;
import
java.awt.AWTKeyStroke
;
import
java.util.logging.Logger
;
public
class
XEmbeddedFrame
extends
EmbeddedFrame
{
private
static
final
Logger
log
=
Logger
.
getLogger
(
XEmbeddedFrame
.
class
.
getName
());
long
handle
;
public
XEmbeddedFrame
()
{
}
...
...
@@ -70,6 +73,21 @@ public class XEmbeddedFrame extends EmbeddedFrame {
this
(
handle
,
supportsXEmbed
,
false
);
}
/*
* The method shouldn't be called in case of active XEmbed.
*/
public
boolean
traverseIn
(
boolean
direction
)
{
XEmbeddedFramePeer
peer
=
(
XEmbeddedFramePeer
)
getPeer
();
if
(
peer
!=
null
)
{
if
(
peer
.
supportsXEmbed
()
&&
peer
.
isXEmbedActive
())
{
log
.
fine
(
"The method shouldn't be called when XEmbed is active!"
);
}
else
{
return
super
.
traverseIn
(
direction
);
}
}
return
false
;
}
protected
boolean
traverseOut
(
boolean
direction
)
{
XEmbeddedFramePeer
xefp
=
(
XEmbeddedFramePeer
)
getPeer
();
if
(
direction
==
FORWARD
)
{
...
...
@@ -81,6 +99,20 @@ public class XEmbeddedFrame extends EmbeddedFrame {
return
true
;
}
/*
* The method shouldn't be called in case of active XEmbed.
*/
public
void
synthesizeWindowActivation
(
boolean
doActivate
)
{
XEmbeddedFramePeer
peer
=
(
XEmbeddedFramePeer
)
getPeer
();
if
(
peer
!=
null
)
{
if
(
peer
.
supportsXEmbed
()
&&
peer
.
isXEmbedActive
())
{
log
.
fine
(
"The method shouldn't be called when XEmbed is active!"
);
}
else
{
peer
.
synthesizeFocusInOut
(
doActivate
);
}
}
}
public
void
registerAccelerator
(
AWTKeyStroke
stroke
)
{
XEmbeddedFramePeer
xefp
=
(
XEmbeddedFramePeer
)
getPeer
();
if
(
xefp
!=
null
)
{
...
...
src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java
浏览文件 @
e00c8b91
...
...
@@ -35,6 +35,8 @@ import sun.util.logging.PlatformLogger;
import
sun.awt.EmbeddedFrame
;
import
sun.awt.SunToolkit
;
import
static
sun
.
awt
.
X11
.
XConstants
.*;
public
class
XEmbeddedFramePeer
extends
XFramePeer
{
private
static
final
PlatformLogger
xembedLog
=
PlatformLogger
.
getLogger
(
"sun.awt.X11.xembed.XEmbeddedFramePeer"
);
...
...
@@ -305,4 +307,20 @@ public class XEmbeddedFramePeer extends XFramePeer {
EmbeddedFrame
frame
=
(
EmbeddedFrame
)
target
;
frame
.
notifyModalBlocked
(
blocker
,
blocked
);
}
public
void
synthesizeFocusInOut
(
boolean
doFocus
)
{
XFocusChangeEvent
xev
=
new
XFocusChangeEvent
();
XToolkit
.
awtLock
();
try
{
xev
.
set_type
(
doFocus
?
FocusIn
:
FocusOut
);
xev
.
set_window
(
getFocusProxy
().
getWindow
());
xev
.
set_mode
(
NotifyNormal
);
XlibWrapper
.
XSendEvent
(
XToolkit
.
getDisplay
(),
getFocusProxy
().
getWindow
(),
false
,
NoEventMask
,
xev
.
pData
);
}
finally
{
XToolkit
.
awtUnlock
();
xev
.
dispose
();
}
}
}
src/windows/classes/sun/awt/windows/WEmbeddedFrame.java
浏览文件 @
e00c8b91
...
...
@@ -191,9 +191,20 @@ public class WEmbeddedFrame extends EmbeddedFrame {
public
void
activateEmbeddingTopLevel
()
{
}
public
void
synthesizeWindowActivation
(
boolean
doActivate
)
{
((
WEmbeddedFramePeer
)
getPeer
()).
synthesizeWmActivate
(
doActivate
);
public
void
synthesizeWindowActivation
(
final
boolean
doActivate
)
{
if
(!
doActivate
||
EventQueue
.
isDispatchThread
())
{
((
WEmbeddedFramePeer
)
getPeer
()).
synthesizeWmActivate
(
doActivate
);
}
else
{
// To avoid focus concurrence b/w IE and EmbeddedFrame
// activation is postponed by means of posting it to EDT.
EventQueue
.
invokeLater
(
new
Runnable
()
{
public
void
run
()
{
((
WEmbeddedFramePeer
)
getPeer
()).
synthesizeWmActivate
(
true
);
}
});
}
}
public
void
registerAccelerator
(
AWTKeyStroke
stroke
)
{}
public
void
unregisterAccelerator
(
AWTKeyStroke
stroke
)
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录