neilcsmith-net commented on code in PR #7164:
URL: https://github.com/apache/netbeans/pull/7164#discussion_r1528295903
##########
ide/o.n.swing.dirchooser/src/org/netbeans/swing/dirchooser/Module.java:
##########
@@ -96,17 +94,27 @@ private static void install() {
uid.put(val, impl);
}
// #61147: prevent NB from switching to a different UI later (under
GTK):
- uid.addPropertyChangeListener(pcl = new PropertyChangeListener() {
- public @Override void propertyChange(PropertyChangeEvent evt) {
- String name = evt.getPropertyName();
- Object className = uid.get(KEY);
- if ((name.equals(KEY) || name.equals("UIDefaults")) &&
!val.equals(className)
- && !isQuickFileChooser(className)) {
- originalImpl = (Class<?>) uid.getUIClass(KEY);
- uid.put(KEY, val);
- }
+ uid.addPropertyChangeListener(pcl = (evt) -> {
+ String name = evt.getPropertyName();
+ Object className = uid.get(KEY);
+ if ((name.equals(KEY) || name.equals("UIDefaults")) &&
!val.equals(className) && !isQuickFileChooser(className)) {
+ originalImpl = (Class<?>) uid.getUIClass(KEY);
+ uid.put(KEY, val);
}
});
+
+ Function<File[], File[]> fun = (Function<File[], File[]>) (File[]
files) -> {
+ Favorites favs = Favorites.getDefault();
+ ArrayList<File> list = new ArrayList<>(Arrays.asList(files));
+ for (FileObject root : favs.getFavoriteRoots()) {
+ File file = FileUtil.toFile(root);
+ if (file.isDirectory()) {
+ list.add(file);
+ }
+ }
+ return list.toArray(File[]::new);
+ };
+ UIManager.put("FileChooser.shortcuts.filesFunction", fun);
Review Comment:
I just meant a UI key that's added and documented in
https://github.com/apache/netbeans/blob/master/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/LFCustoms.java
Although it would be kind of operating in reverse to most UI keys, in the
sense that it's set outside and read by the LAF.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists