You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2025/01/17 06:23:14 UTC

[PR] Persist tab order on per-project basis between close/open. [netbeans]

mbien opened a new pull request, #8164:
URL: https://github.com/apache/netbeans/pull/8164

    - changed to collections which retain entry order
    - refresh storage on close if order changes
   
   note:
   
    - opened files are stored per project, re-opening multiple projects will restore the right order within the project but they will be sorted by project as side effect.
    - opened projects might not have a deterministic order since they come right from the lookup (was not the focus of this PR)
   
   fixes #4416


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Persist tab order on per-project basis between close/open. [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8164:
URL: https://github.com/apache/netbeans/pull/8164#discussion_r1921609474


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java:
##########
@@ -598,12 +596,12 @@ public static Set<FileObject> openProjectFiles (Project p, Group grp) {
         return toRet;
     }
     
-    private static Set<String> getOpenFilesUrls(Project p, String groupName) {
+    private static List<String> getOpenFilesUrls(Project p, String groupName) {

Review Comment:
   btw how can I open the same file twice?



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Persist tab order on per-project basis between close/open. [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8164:
URL: https://github.com/apache/netbeans/pull/8164#discussion_r1921609474


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java:
##########
@@ -598,12 +596,12 @@ public static Set<FileObject> openProjectFiles (Project p, Group grp) {
         return toRet;
     }
     
-    private static Set<String> getOpenFilesUrls(Project p, String groupName) {
+    private static List<String> getOpenFilesUrls(Project p, String groupName) {

Review Comment:
   btw how can I open the same file twice



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Persist tab order on per-project basis between close/open. [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8164:
URL: https://github.com/apache/netbeans/pull/8164#discussion_r1921611075


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java:
##########
@@ -483,31 +481,31 @@ public static boolean closeAllDocuments(Project[] projects, boolean notifyUI, St
             // store project's documents
             // loop all project being closed
             for (Map.Entry<Project,Set<String>> entry : urls4project.entrySet()) {
-                storeProjectOpenFiles(entry.getKey(), entry.getValue(), groupName);
+                storeProjectOpenFiles(entry.getKey(), new ArrayList<>(entry.getValue()), groupName);
             }
         }
         
         return urls4project != null;
     }
     
-    public static void storeProjectOpenFiles(Project p, Set<String> urls, String groupName) {
+    public static void storeProjectOpenFiles(Project p, List<String> urls, String groupName) {
         AuxiliaryConfiguration aux = ProjectUtils.getAuxiliaryConfiguration(p);
         
-        Set<String> openFileUrls = getOpenFilesUrls(p, groupName);
-        if(urls.isEmpty() && openFileUrls.isEmpty()) {
+        List<String> openFileUrls = getOpenFilesUrls(p, groupName);
+        if (urls.isEmpty() && openFileUrls.isEmpty()) {
             // was empty, stays empty, leave
             return;                
-        }        
-        if(urls.size() == openFileUrls.size()) {
+        }
+        // check if file list changed, order matters

Review Comment:
   good point - simplified the section



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Persist tab order on per-project basis between close/open. [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #8164:
URL: https://github.com/apache/netbeans/pull/8164#issuecomment-2601043025

   thanks for review. going to merge since I found an ergonomics related NPE in the same area which can be fixed in a followup PR


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Persist tab order on per-project basis between close/open. [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8164:
URL: https://github.com/apache/netbeans/pull/8164#discussion_r1921611121


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java:
##########
@@ -598,12 +596,12 @@ public static Set<FileObject> openProjectFiles (Project p, Group grp) {
         return toRet;
     }
     
-    private static Set<String> getOpenFilesUrls(Project p, String groupName) {
+    private static List<String> getOpenFilesUrls(Project p, String groupName) {

Review Comment:
   Tab menu, "clone" IIRC.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Persist tab order on per-project basis between close/open. [netbeans]

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien merged PR #8164:
URL: https://github.com/apache/netbeans/pull/8164


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists