Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5e849a15
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看板
提交
5e849a15
编写于
5月 12, 2012
作者:
A
alexsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7024965: Stylepad demo: remove non-translatable resources from Stylepad.properties file
Reviewed-by: alexp
上级
c53980b6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
7 deletion
+17
-7
src/share/demo/jfc/Notepad/Notepad.java
src/share/demo/jfc/Notepad/Notepad.java
+17
-7
src/share/demo/jfc/Notepad/resources/NotepadSystem.properties
...share/demo/jfc/Notepad/resources/NotepadSystem.properties
+0
-0
未找到文件。
src/share/demo/jfc/Notepad/Notepad.java
浏览文件 @
5e849a15
...
...
@@ -62,7 +62,7 @@ import javax.swing.UIManager.LookAndFeelInfo;
@SuppressWarnings
(
"serial"
)
class
Notepad
extends
JPanel
{
pr
ivate
static
Properties
properties
;
pr
otected
static
Properties
properties
;
private
static
ResourceBundle
resources
;
private
final
static
String
EXIT_AFTER_PAINT
=
"-exit"
;
private
static
boolean
exitAfterFirstPaint
;
...
...
@@ -77,12 +77,12 @@ class Notepad extends JPanel {
try
{
properties
=
new
Properties
();
properties
.
load
(
Notepad
.
class
.
getResourceAsStream
(
"resources/
s
ystem.properties"
));
"resources/
NotepadS
ystem.properties"
));
resources
=
ResourceBundle
.
getBundle
(
"resources.Notepad"
,
Locale
.
getDefault
());
}
catch
(
MissingResourceException
|
IOException
e
)
{
System
.
err
.
println
(
"resources/Notepad.properties "
+
"or resources/
s
ystem.properties not found"
);
+
"or resources/
NotepadS
ystem.properties not found"
);
System
.
exit
(
1
);
}
}
...
...
@@ -298,7 +298,7 @@ class Notepad extends JPanel {
*/
private
Component
createToolbar
()
{
toolbar
=
new
JToolBar
();
for
(
String
toolKey:
TOOLBAR_KEYS
)
{
for
(
String
toolKey:
getToolBarKeys
()
)
{
if
(
toolKey
.
equals
(
"-"
))
{
toolbar
.
add
(
Box
.
createHorizontalStrut
(
5
));
}
else
{
...
...
@@ -363,7 +363,7 @@ class Notepad extends JPanel {
*/
protected
JMenuBar
createMenubar
()
{
JMenuBar
mb
=
new
JMenuBar
();
for
(
String
menuKey:
MENUBAR_KEYS
){
for
(
String
menuKey:
getMenuBarKeys
()
){
JMenu
m
=
createMenu
(
menuKey
);
if
(
m
!=
null
)
{
mb
.
add
(
m
);
...
...
@@ -389,8 +389,10 @@ class Notepad extends JPanel {
return
menu
;
}
// get keys for menus
private
String
[]
getItemKeys
(
String
key
)
{
/**
* Get keys for menus
*/
protected
String
[]
getItemKeys
(
String
key
)
{
switch
(
key
)
{
case
"file"
:
return
FILE_KEYS
;
...
...
@@ -403,6 +405,14 @@ class Notepad extends JPanel {
}
}
protected
String
[]
getMenuBarKeys
()
{
return
MENUBAR_KEYS
;
}
protected
String
[]
getToolBarKeys
()
{
return
TOOLBAR_KEYS
;
}
// Yarked from JMenu, ideally this would be public.
protected
PropertyChangeListener
createActionChangeListener
(
JMenuItem
b
)
{
return
new
ActionChangedListener
(
b
);
...
...
src/share/demo/jfc/Notepad/resources/
s
ystem.properties
→
src/share/demo/jfc/Notepad/resources/
NotepadS
ystem.properties
浏览文件 @
5e849a15
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录