neilcsmith-net commented on code in PR #8908:
URL: https://github.com/apache/netbeans/pull/8908#discussion_r2426302802


##########
platform/favorites/src/org/netbeans/modules/favorites/Module.java:
##########
@@ -53,10 +68,38 @@ public void run() {
                         shortcuts.add(file);
                     }
                 }
-                return shortcuts.toArray(new File[0]);
+                return shortcuts.toArray(File[]::new);
             };
             UIManager.put(LFCustoms.FILECHOOSER_SHORTCUTS_FILESFUNCTION, 
favAppender);
         }
+
+        // very first open editor tab event will also open the Favorites tab 
+        private void attachFirstEditorOpenListener() {
+            Preferences prefs = NbPreferences.forModule(Module.class);
+            if (!prefs.getBoolean(INITIAL_OPEN_DONE_KEY, false)) {
+                WindowManager.getDefault().addPropertyChangeListener(new 
PropertyChangeListener() {
+                    @Override
+                    public void propertyChange(PropertyChangeEvent evt) {
+                        if ("activeMode".equals(evt.getPropertyName())   
//NOI18N
+                                && evt.getNewValue() instanceof Mode mode
+                                && "editor".equals(mode.getName())) {   
//NOI18N

Review Comment:
   Or `WindowManager::isEditorMode`?



-- 
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

Reply via email to