Skip to content

Commit ef5582b

Browse files
authored
Merge branch 'master' into goetz_backport_8322135
2 parents c3d7a19 + dc6fb99 commit ef5582b

File tree

25 files changed

+897
-130
lines changed

25 files changed

+897
-130
lines changed

src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,9 @@ public Component getTableCellRendererComponent(final JTable list,
11811181
setText(fc.getName(file));
11821182
setIcon(fc.getIcon(file));
11831183
setEnabled(isSelectableInList(file));
1184+
1185+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
1186+
11841187
return this;
11851188
}
11861189
}
@@ -1246,6 +1249,9 @@ public Component getListCellRendererComponent(final JList<? extends File> list,
12461249
final JFileChooser chooser = getFileChooser();
12471250
setText(chooser.getName(directory));
12481251
setIcon(chooser.getIcon(directory));
1252+
1253+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
1254+
12491255
return this;
12501256
}
12511257
};

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,9 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
10821082
if (showFileIcons) {
10831083
setIcon(getFileChooser().getIcon((File)value));
10841084
}
1085+
1086+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
1087+
10851088
return this;
10861089
}
10871090
}
@@ -1099,6 +1102,9 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
10991102
} else {
11001103
setText(getFileChooser().getName((File)value) + "/");
11011104
}
1105+
1106+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
1107+
11021108
return this;
11031109
}
11041110
}

src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
664664
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
665665
setText(getFileChooser().getName((File) value));
666666
setInheritsPopupMenu(true);
667+
668+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
669+
667670
return this;
668671
}
669672
}
@@ -676,6 +679,9 @@ public Component getListCellRendererComponent(JList<?> list, Object value, int i
676679
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
677680
setText(getFileChooser().getName((File) value));
678681
setInheritsPopupMenu(true);
682+
683+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
684+
679685
return this;
680686
}
681687
}

src/java.desktop/share/classes/javax/swing/JFileChooser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ protected void setup(FileSystemView view) {
398398
setFileFilter(getAcceptAllFileFilter());
399399
}
400400
enableEvents(AWTEvent.MOUSE_EVENT_MASK);
401+
putClientProperty("html.disable", true);
401402
}
402403

403404
private void installHierarchyListener() {

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicPasswordFieldUI.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -91,23 +91,4 @@ protected void installDefaults() {
9191
public View create(Element elem) {
9292
return new PasswordView(elem);
9393
}
94-
95-
/**
96-
* Create the action map for Password Field. This map provides
97-
* same actions for double mouse click and
98-
* and for triple mouse click (see bug 4231444).
99-
*/
100-
101-
ActionMap createActionMap() {
102-
ActionMap map = super.createActionMap();
103-
if (map.get(DefaultEditorKit.selectWordAction) != null) {
104-
Action a = map.get(DefaultEditorKit.selectLineAction);
105-
if (a != null) {
106-
map.remove(DefaultEditorKit.selectWordAction);
107-
map.put(DefaultEditorKit.selectWordAction, a);
108-
}
109-
}
110-
return map;
111-
}
112-
11394
}

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -650,6 +650,22 @@ ActionMap createActionMap() {
650650
TransferHandler.getCopyAction());
651651
map.put(TransferHandler.getPasteAction().getValue(Action.NAME),
652652
TransferHandler.getPasteAction());
653+
654+
if (getComponent() instanceof JPasswordField) {
655+
// Edit the action map for Password Field. This map provides
656+
// same actions for double mouse click and
657+
// and for triple mouse click (see bugs 4231444, 8354646).
658+
659+
if (map.get(DefaultEditorKit.selectWordAction) != null) {
660+
map.remove(DefaultEditorKit.selectWordAction);
661+
662+
Action a = map.get(DefaultEditorKit.selectLineAction);
663+
if (a != null) {
664+
map.put(DefaultEditorKit.selectWordAction, a);
665+
}
666+
}
667+
}
668+
653669
return map;
654670
}
655671

src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,8 @@ public Component getListCellRendererComponent(JList<?> list, Object value,
953953
ii.depth = directoryComboBoxModel.getDepth(index);
954954
setIcon(ii);
955955

956+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
957+
956958
return this;
957959
}
958960
}

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthPasswordFieldUI.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -95,19 +95,4 @@ public void paintBorder(SynthContext context, Graphics g, int x,
9595
int y, int w, int h) {
9696
context.getPainter().paintPasswordFieldBorder(context, g, x, y, w, h);
9797
}
98-
99-
/**
100-
* {@inheritDoc}
101-
*/
102-
@Override
103-
protected void installKeyboardActions() {
104-
super.installKeyboardActions();
105-
ActionMap map = SwingUtilities.getUIActionMap(getComponent());
106-
if (map != null && map.get(DefaultEditorKit.selectWordAction) != null) {
107-
Action a = map.get(DefaultEditorKit.selectLineAction);
108-
if (a != null) {
109-
map.put(DefaultEditorKit.selectWordAction, a);
110-
}
111-
}
112-
}
11398
}

src/java.desktop/share/classes/sun/swing/FilePane.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,8 @@ public Component getTableCellRendererComponent(JTable table, Object value,
12141214

12151215
setText(text);
12161216

1217+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
1218+
12171219
return this;
12181220
}
12191221
}
@@ -1602,6 +1604,8 @@ public Component getListCellRendererComponent(JList<?> list, Object value,
16021604
}
16031605
}
16041606

1607+
putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
1608+
16051609
return this;
16061610
}
16071611
}

src/java.desktop/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,8 @@ public Component getListCellRendererComponent(JList<? extends File> list, File v
692692
ii.depth = directoryComboBoxModel.getDepth(index);
693693
label.setIcon(ii);
694694

695+
label.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable"));
696+
695697
return label;
696698
}
697699
}

0 commit comments

Comments
 (0)