You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "jtulach (via GitHub)" <gi...@apache.org> on 2026/09/04 14:41:37 UTC

[PR] Show nested projects co-located and indented [netbeans]

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

   - this PR is implementation of @mbien's [idea](https://github.com/apache/netbeans/pull/9592#issuecomment-5522178702)
      - sorting of project is changed so _nested projects_ are **co-located** next to each other
    - however just co-locating isn't enough to express which project is nested to each
       - as such we also _indent nested projects_ 
       - that gives the user a clue of the _project relations_
    - while it keeps the overall presentation unchanged
       - except indentation and different sorting the project view _behavior remains the same_
    - no API changes in the Project API are needed
       - that's very encouraging
    - one small API change was needed to reuse `NodeRenderer` and control its (already existing and used in `ChoiceView`) indentation support
    - [ ] write some unit tests
    - [ ] verify indentation is update when project list is changed
   
   <img width="539" height="1013" alt="Maven 4 Projects with Indentation" src="https://github.com/user-attachments/assets/fbceb509-0b75-4029-bfb8-e47f01da4f0a" />
   


-- 
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] Show nested projects co-located and indented [netbeans]

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

   > * done exactly that and also
   > 
   > > ... the correct approach is to decorate the node model underneath the tree view, so the tree continues to work as expected without any adaptation.
   > 
   > * done as well.
   > * thanks for the reviews.
   > * merging.
   
   No, they were two distinct approaches. And the second one involves still making the subprojects child nodes of the parent projects. That aspect of your other PR was correct in my opinion, just not the API.
   
   Is the behaviour as merged optional?


-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   - yes, I wanted to use `instanceof` pattern too
   - I've noticed the NetBeans IDE support of `var` is pretty poor 
      - for example move refactoring replaces `var` with FQN types!?
         -  I hope I fix it one day.
      - probably a result of this kind of attitude towards `var`
   - I don't share such attitude 
      - For last for years I was coding in languages where it is enough to write `x = 3.14`
      - even `var` is too verbose for my taste
   - I prefer use of `var` in my code over needless verbosity of specifying the type at each assignment



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -1965,6 +1969,21 @@ public int compare(Project p1, Project p2) {
         }
         
     }
+    private static class ProjectByPathComparator implements Comparator<Project> {
+        @Override
+        public int compare(Project p1, Project p2) {
+            if (p1 == null && p2 == null) {
+                return 0;
+            }
+            if (p1 == null) {
+                return -1;
+            }
+            if (p2 == null) {
+                return 1;
+            }
+            return p1.getProjectDirectory().getPath().compareTo(p2.getProjectDirectory().getPath());

Review Comment:
   > and we decided we rather keep it simple
   
   Decided??  I think both approaches have pros and cons right now.  This simpler approach might be the better one, and the least intrusive, but having the view not end up reflecting the underlying model might end up causing issues down the line.



-- 
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] Show nested projects co-located and indented [netbeans]

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

   - the state of the whole PR makes me happy
   - I'd like integrate by end of this week
   - I'll squash and then push the green button


-- 
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] Show nested projects co-located and indented [netbeans]

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

   Awesome!


-- 
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] Show nested projects co-located and indented [netbeans]

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

   > ... still making the subprojects child nodes of the parent projects....
   
   If you want to implement some alternative, more radical changes than the small gentle tweaks merged by this PR, feel free to create your own PR. I can review your code changes there.


-- 
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] Show nested projects co-located and indented [netbeans]

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

   @svenreimers, @mbien and @neilcsmith-net wrote:
   
   > Awesome!
   > I think this has potential.
   > +1
   
   - thanks guys
   - your support shows this area desparatelly needs an improvement
   - I'll do my best to deliver.
   
   @mbien wrote:
   
   > solved via UI, it avoids many issues
   
   - exactly, I believe this approach is much more doable than #9592
   - as it has far less _unknowns_ than #9592
   
   @mbien and @neilcsmith-net wrote:
   > Visually it will likely need some tweaks since it moves the expand/collapse control away
   > it affects also where you can click to control expansion
   
   - alas, that's true
   - I have never been a hard core "pixel perfect" person...
      - mostly due to my sight handicaps which are only getting worse
   - ... but yeah, from UX perspective the space is _far from ideal_
   - I'll do something with it!
      - but I try to keep the change simple (e.g. avoid breadcrumbs and other bigger changes in this 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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   - Sorry for bringing the `var` discussion up in this PR
   - I'll certainly update the source level and use instanceof pattern and other language features of modern Java



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -1965,6 +1969,21 @@ public int compare(Project p1, Project p2) {
         }
         
     }
+    private static class ProjectByPathComparator implements Comparator<Project> {
+        @Override
+        public int compare(Project p1, Project p2) {
+            if (p1 == null && p2 == null) {
+                return 0;
+            }
+            if (p1 == null) {
+                return -1;
+            }
+            if (p2 == null) {
+                return 1;
+            }
+            return p1.getProjectDirectory().getPath().compareTo(p2.getProjectDirectory().getPath());

Review Comment:
   > I think both approaches have pros and cons right now. This simpler approach might be the better one, and the least intrusive
   
   - Right. The approach in this PR is less intrusive than the one proposed in #9592
      - there are _known unknowns_ of the `WithNestedProjects` solution
      - and certainly there are some _unknown unknowns_ awaiting behind the corrner
   - The amount of (both) _unknowns_ is way smaller in this PR approach
   - hence when [Michael suggested](https://github.com/apache/netbeans/pull/9592#issuecomment-5522178702) and I implemented his idea and spiced it with indentation ...
   
   > Decided??
   
   - ... we (me and Michael) decided it is the better approach
   - I plan to close #9592 as not needed for now
   - and deliver the long awaited solution for project nesting in this 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] Show nested projects co-located and indented [netbeans]

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

   As said above, I still think this is the wrong approach.  But I don't have an objection to merging in the current state as long as it's optional.  Is it?  Partly for platform users of the project API, as well as for IDE users who might not want it.


-- 
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] Show nested projects co-located and indented [netbeans]

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

   Thanks @jtulach 
   
   > > concern regarding the unicode arrow
   > 
   > The character will be configurable via the `UIManager`.
   
   I would expect this one to be a fairly safe bet.  It's in ISO-8859-1 and CP-1252, so hopefully good for most fonts since Windows 1 or HTML 2. :smile:  And, if configurable we have a get out anyway.


-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -1965,6 +1969,21 @@ public int compare(Project p1, Project p2) {
         }
         
     }
+    private static class ProjectByPathComparator implements Comparator<Project> {
+        @Override
+        public int compare(Project p1, Project p2) {
+            if (p1 == null && p2 == null) {
+                return 0;
+            }
+            if (p1 == null) {
+                return -1;
+            }
+            if (p2 == null) {
+                return 1;
+            }
+            return p1.getProjectDirectory().getPath().compareTo(p2.getProjectDirectory().getPath());

Review Comment:
   >  projects do actually have to be a tree structure on disk
   
   - I don't think there is much to improve without enhancing Project API.
   - #9592 tried the _enhance the API route_
   - and we decided we rather keep it simple
   - hence I'd rather still with _tree structure on disk_ for purposes of this 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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -1965,6 +1969,21 @@ public int compare(Project p1, Project p2) {
         }
         
     }
+    private static class ProjectByPathComparator implements Comparator<Project> {
+        @Override
+        public int compare(Project p1, Project p2) {
+            if (p1 == null && p2 == null) {
+                return 0;
+            }
+            if (p1 == null) {
+                return -1;
+            }
+            if (p2 == null) {
+                return 1;
+            }
+            return p1.getProjectDirectory().getPath().compareTo(p2.getProjectDirectory().getPath());

Review Comment:
   >  projects do actually have to be a tree structure on disk
   
   - I don't think there is much to improve without enhancing Project API.
   - #9592 tried the _enhance the API route_
   - and we decided we rather keep it simple
   - hence I'd rather stick with _tree structure on disk_ for purposes of this 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] Show nested projects co-located and indented [netbeans]

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

   Firstly, thank you for looking at this.  It's a long-standing request, and an option to provide it is much needed.  I don't want it to come across as negative if I say that both approaches are flawed in my opinion - I think the actual solution lies between the two.  This PR is changing the behaviour in the right place, so it just works for all project types, but I still think it should affect the node model.
   
   If you do want to keep this entirely visual then I think using whitespace indenting is the wrong approach.  If it's tweaked to move the control, even worse.  A tree should behave like a tree!  We're going to get issue reports if we break user's expectations there.
   
   An alternative might be to offer the option of a prefix just to the title of the project nodes based on their depth, without indenting the children.  Mixed with topological sorting, it covers some of the visual differentiation.
   
   ```
   > Project One
   > - Child Project One
   > - Child Project Two
   > -- Grandchild Project
   > Project Two
   ```
   
   On the other hand, I think the correct approach is to decorate the node model underneath the tree view, so the tree continues to work as expected without any adaptation.  I mentioned PackageView on the other PR, because it has this ability to change a tree view to a flat or reduced view using filter nodes.  In some ways it seems a good parallel of this problem?
   
   Why not use FilterNodes here too, and allow options to display opened projects inside parent project (if open), both before or after the existing project node children?  We can keep the existing flat view, and keep it as default until we're happy this solves all cases.
   
   Doing this would keep the changes localized and allow the project UI to provide a solution for all project types automatically.  An API could still be added later if there was a pressing need for project types to be able to customize this in some way later.  After we know what type of context information the project type requires to do that well.


-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -1965,6 +1969,21 @@ public int compare(Project p1, Project p2) {
         }
         
     }
+    private static class ProjectByPathComparator implements Comparator<Project> {
+        @Override
+        public int compare(Project p1, Project p2) {
+            if (p1 == null && p2 == null) {
+                return 0;
+            }
+            if (p1 == null) {
+                return -1;
+            }
+            if (p2 == null) {
+                return 1;
+            }
+            return p1.getProjectDirectory().getPath().compareTo(p2.getProjectDirectory().getPath());

Review Comment:
   Sure, if you decide to concentrate on this PR and close the other one, that's fine.  I'm just saying that's rather different to saying it was decided.



-- 
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] Show nested projects co-located and indented [netbeans]

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

   I'll prepare a follow up PR as soon as possible to offer...
   
   > ... it should be possible for an IDE or platform user to return the display to its previous look. @mbien mentioned the possibility of indent being a UI property. .... 
   > it's probably better to use values from UIManager for the prefix and any font colours? That way, both can be configured using the options UI in the IDE too. 
   > An empty String would leave the display as before, and might be special-cased to bypass the additional processing. There's probably a suitable key for the font colour already? Same as versioning annotation?
   
   ... configuration via `UIManager`. That's indeed something that has to be done before next NetBeans release.
   
   


-- 
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] Show nested projects co-located and indented [netbeans]

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

   > I think this has potential. Since this is solved via UI, it avoids many issues e.g having to think about how to represent open/closed projects in trees etc - it builds on top of the existing logic, project groups etc.
   
   +1
   
   > **Visually** it will likely need some tweaks since it moves the expand/collapse control away from the icon (visible only deeper in the tree)
   
   This is my concern too, but it's more than just "visual" in the sense that it affects also where you can click to control expansion.  We'll end up with a tree UI that diverges more and more from the underlying model.  That might start to get "interesting".
   
   The other UI thought that comes to mind with this is the potential to change the root of the project tree to just one project / subproject, with a breadcrumb bar (similar to eg. the GNOME file browser in list mode when tree expansion is enabled).
   


-- 
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] Show nested projects co-located and indented [netbeans]

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

   - squashed to a single commit
   - all major suggestion implemented, especially:
   
   > An alternative might be to ... prefix just to the title of the project nodes based on their depth, without indenting the children. 
   > ```
   > > Project One
   > > - Child Project One
   > > - Child Project Two
   > > -- Grandchild Project
   > > Project Two
   > ```
   
   - done exactly that and also 
   
   > ... the correct approach is to decorate the node model underneath the tree view, so the tree continues to work as expected without any adaptation.
   
   - done as well.
   - thanks for the reviews.
   - merging.


-- 
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] Show nested projects co-located and indented [netbeans]

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


-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   Yes, we've had lots of fixes for `var`, and another one just one my radar to look at.  We did talk about blocking use of `var` at one point in style guidelines for the IDE code, but I think we ended up with a general feeling of making sure it's legible.  Personally I think that's a judgement call based on making sure type information is easily understandable from reading text in the vicinity without requiring IDE annotations - eg. assignments with `new` may be OK whereas assignments from method calls may not.



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
platform/openide.explorer/src/org/openide/explorer/view/NodeRenderer.java:
##########
@@ -135,7 +137,9 @@ public Component getTreeCellRendererComponent(
 
         //Do our additional configuration - set up the icon and possibly
         //do some hacks to make it look focused for TreeTableView
-        configureFrom(renderer, tree, expanded, sel, vis);
+        int iconWidth = configureFrom(renderer, tree, expanded, sel, vis);
+
+        renderer.setIndent(iconWidth * findIndent(tree.getModel(), vis));

Review Comment:
   - The current indentation via `findIndent` was done by following two commits:
   - 2130f7fac27e2d37b9e467f070f62d76c0cef80c
   - and 0a28da065342850d0d9e0db65883fdb8501122a8
   - I am going to strip these two commits off and start again...



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   - yes, I wanted to use `instanceof` pattern too
   - I've noticed the NetBeans IDE support of `var` is pretty poor 
      - for example move refactoring replaces `var` with FQN types!? I hope
         -  I fix it one day.
      - probably a result of this kind of attitude towards `var`
   - I don't share such attitude 
      - For last for years I was coding in languages where it is enough to write `x = 3.14`
      - even `var` is too verbose for my taste
   - I prefer use of `var` in my code over needless verbosity of specifying the type at each assignment



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   - yes, I wanted to use `instanceof` pattern too
   - I've noticed the NetBeans IDE support of `var` is pretty poor 
      - for example move refactoring replaces `var` with FQN types!? I hope I fix it one day.
      - probably a result of this kind of attitude towards `var`
   - I don't share such attitude and prefer use of `var` in my code



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectsRootNode.java:
##########
@@ -858,6 +790,9 @@ public void annotationChanged(FileStatusEvent event) {
                     LOG.log(Level.INFO, null, e);
                 }
             }
+            for (var i = 0; i < pair.depth(); i++) {
+                original = "\u00BB " + original;

Review Comment:
   With 0ac9a489d8 change the VSCode extension would look like this:
   
   <img width="452" height="867" alt="Maven in VSCode" src="https://github.com/user-attachments/assets/ac52106e-7818-4d2f-a629-aa4d5b1bde78" />
   
   CCing @MartinBalin 



-- 
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] Show nested projects co-located and indented [netbeans]

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

   > This was merged too soon, .... and no approvals. 
   
   - there is no formal approval. that's true.
   - on the other hand there is a huge informal support:
      - @svenreimers [Awesome](https://github.com/apache/netbeans/pull/9602#issuecomment-5546072487)
      - @mbien [invented the idea](https://github.com/apache/netbeans/pull/9592#issuecomment-5522178702) hence I count him as supporter
      -  @MartinBalin [wow, this looks nice](https://github.com/apache/netbeans/pull/9602#discussion_r3986880854)
      - @geertjanw [...happy, ... integrate this week ... push the green button](https://github.com/apache/netbeans/pull/9602#issuecomment-5616954062)
    - if necessary, I please all those guys to express their +1 via formal approval
   
   > there were still outstanding review question
   > ... still seem to be missing a switch to disable it
   
   - personally I don't think we are missing a way to disable [showing of nested projects co-located and indented](https://github.com/apache/netbeans/pull/9602)
      - it a gentle and natural evolution of `ProjectsRootNode` display representation
   - but if you tell me: _What exactly do you want to disable?_
      - I'll try to deliver some suitable switch to make you happy
      - while pleasing all the above listed supporters by having this feature finally in 
      - after all the years of waiting for it


-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
platform/openide.explorer/src/org/openide/explorer/view/NodeRenderer.java:
##########
@@ -135,7 +137,9 @@ public Component getTreeCellRendererComponent(
 
         //Do our additional configuration - set up the icon and possibly
         //do some hacks to make it look focused for TreeTableView
-        configureFrom(renderer, tree, expanded, sel, vis);
+        int iconWidth = configureFrom(renderer, tree, expanded, sel, vis);
+
+        renderer.setIndent(iconWidth * findIndent(tree.getModel(), vis));

Review Comment:
   
   @mbien wrote:
   > indentation amount could also become a UI property
   
   - there is `int findIndent` in the current solution
   - it computes the indentation in the multiplies of image size
      - that's not really a UI property
   - however I was thinking of turning it into `double findIndent`
      - that could be one solution of the wide empty space
      - the indentation could be 0.5 or even less per nested level
   - then it would get closer to L&F aspects and might deserve a UI property
   - anyway, I plan to go _"for something completely different"_ now
   
   
   
   



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
platform/openide.explorer/src/org/openide/explorer/view/NodeRenderer.java:
##########
@@ -135,7 +137,9 @@ public Component getTreeCellRendererComponent(
 
         //Do our additional configuration - set up the icon and possibly
         //do some hacks to make it look focused for TreeTableView
-        configureFrom(renderer, tree, expanded, sel, vis);
+        int iconWidth = configureFrom(renderer, tree, expanded, sel, vis);
+
+        renderer.setIndent(iconWidth * findIndent(tree.getModel(), vis));

Review Comment:
   - The current indentation via `findIndent` was done by following two commits:
   - 2130f7fac27e2d37b9e467f070f62d76c0cef80c
   - and 0a28da065342850d0d9e0db65883fdb8501122a8
   - it looks like this:
   
   <img width="539" height="1013" alt="Maven 4 Projects with Indentation" src="https://github.com/user-attachments/assets/fbceb509-0b75-4029-bfb8-e47f01da4f0a" />
   
   - I am going to strip these two commits off and start again...
   



-- 
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] Show nested projects co-located and indented [netbeans]

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

   - a [failure in CI](https://github.com/apache/netbeans/actions/runs/34229960503/job/102092230082?pr=9602#step:69:1035) in the `ide/projectui` module
      - the module tests were enabled by #9603
   - `testBehaviourOfProjectsLogicNode(ProjectsRootNodePhysicalViewModeSourcesTest)`
   - 


-- 
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] Show nested projects co-located and indented [netbeans]

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

   > on the other hand there is a huge informal support: 
   > * @mbien https://github.com/apache/netbeans/pull/9592#issuecomment-5522178702 hence I count him as supporter
   
   As I wrote in the linked comment, I still think adding sorting _options_ is defensively a good thing. Although I didn't look into the final implementation until now.
   
   Taking a quick look now it seems that it is on by default and can't be switched off using UI. This is probably not something we can ship that way given that it might cause regressions for platform users + some might not like it after looking ~25 years at a alphabetically sorted flat list and would like to switch back in some situations. Whether this should be the default would already be something to talk about - it might be a good default for the IDE at least.
   
   We had situations when all reviewers were happy about a UI change, and yet we got pushback about lacking options to turn it off. (back when we consolidated all search/refactoring/usages views into split views to behave similarly)
   
   (btw calling it path-topological sort in UI would be self documenting and communicate its inner workings via its name and even give more space for other options later + it would avoid bug reports in the sense of "but this is no real dependency")
   
   I have also a concern regarding the unicode arrow. I investigated unicode symbols while refreshing the git UI (https://github.com/apache/netbeans/pull/7128#discussion_r1531601866) and it showed that they were all very font specific. Some OS default fonts did not render them or rendered a placeholder so I decided to not use them. (how was this tested?)
   
   I do also think that making it optional would still be required even if the implementation would be "perfect" (showing true topological project relationships, instead of folder hierarchies) - you might still want to turn it sometimes off in IDE or Platform.
   
   Since this was merged without approval (which we discussed before and I still discourage doing) and unknown amount of testing, this is something which would need to be looked at.


-- 
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] Show nested projects co-located and indented [netbeans]

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

   > ... I still think adding sorting _options_ is definitely a good thing....on by default and can't be switched off using UI.... This is probably not something we can ship that way given that it might cause regressions for platform users + some might not like it after looking ~25 years at a alphabetically sorted flat list and would like to switch back in some situations. Whether this should be the default would already be something to talk about - it might be a good default for the IDE at least.
   
   - @mbien you are right, this is another topic that shall be resolved
   - I've created #9629 - let's consider the options there
   - and then I'll update the PR code to reflect the result of the discussion


-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   nitpick: we could bump the language level to 21 to use the instanceof pattern.
   ```java
                   if (node instanceof ProjectsRootNode.BadgingNode badge) {
                       return badge.pair.depth;
                   }
   ```
   pet peeve: I am personally not a fan of using var everywhere since it obfuscates code and is in many cases not necessary when the type is already concise. But I am not going to argue against it, its more about code style and mostly non technical.
   
   Its just a bit unfortunate that the trend of overusing var made IDEs render the type next to it which entirely defeated the purpose of it in the first place since it now uses more space than before and breaks formatting:
   
   <img width="484" height="55" alt="Image" src="https://github.com/user-attachments/assets/ff2cafba-bdec-4f3e-a109-bfbcf5cb9f77" />
   
   but that is just my "pet peeve" - feel free to ignore it ;)



##########
ide/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java:
##########
@@ -1965,6 +1969,21 @@ public int compare(Project p1, Project p2) {
         }
         
     }
+    private static class ProjectByPathComparator implements Comparator<Project> {
+        @Override
+        public int compare(Project p1, Project p2) {
+            if (p1 == null && p2 == null) {
+                return 0;
+            }
+            if (p1 == null) {
+                return -1;
+            }
+            if (p2 == null) {
+                return 1;
+            }
+            return p1.getProjectDirectory().getPath().compareTo(p2.getProjectDirectory().getPath());

Review Comment:
   Alphabetical String comparison with paths seems to be indeed working well for this. My instinct told me that this will probably break with edge cases but it is always making sure that parent dir ends up before child dir. This is good for this purpose (I think) and also fast.
   
   Path comparison has the limitation that the projects do actually have to be a tree structure on disk since it shows the filesystem hierarchy, not the actual project parent which could be anywhere. It correlates location with relationship between projects. This might be fine still - curious what others think.



##########
platform/openide.explorer/src/org/openide/explorer/view/NodeRenderer.java:
##########
@@ -196,6 +200,23 @@ public Component getListCellRendererComponent(
         return result;
     }
 
+    /** Finds the indentation level of a node.
+     *
+     * @param model the model (either {@link ListModel} or {@link TreeModel}) that's currently being rendered
+     * @param visualizer the visualizer to find indentation for
+     * @return the indentation level for the renderer of the given {@code visualizer};
+     *   return {@code 0} for no indentation or positive number to indent the rendering to right
+     * @see Visualizer#findNode(java.lang.Object)
+     * @sincet 6.97
+     */
+    protected int findIndent(Object model, TreeNode visualizer) {
+        if (model instanceof ListModel) {
+            return NodeListModel.findVisualizerDepth((ListModel) model, visualizer);

Review Comment:
   nit: instanceof pattern



##########
platform/openide.explorer/src/org/openide/explorer/view/NodeRenderer.java:
##########
@@ -187,7 +191,7 @@ public Component getListCellRendererComponent(
             //in the node tree.  Only does anything if you've subclassed and
             //overridden createModel().  Does anybody do that?
             if (list.getModel() instanceof NodeListModel && (((NodeListModel) list.getModel()).getDepth() > 1)) {
-                int indent = iconWidth * NodeListModel.findVisualizerDepth(list.getModel(), vis);
+                int indent = iconWidth * findIndent(list.getModel(), vis);

Review Comment:
   nit: instanceof pattern would clean this up too



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   - yes, I wanted to use `instanceof` pattern too
   - I've noticed the NetBeans IDE support of `var` is pretty poor 
      - for example move refactoring replaces `var` with FQN types!? I hope I fix it one day.
      - probably a result of this kind of attitude towards `var`
   - I don't share such attitude 
      - For last for years I was coding in languages where it is enough to write `x = 3.14`
      - even `var` is too verbose for my taste
   - however I prefer use of `var` in my code over needless verbosity of specifying the type at each assignment



##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   - yes, I wanted to use `instanceof` pattern too
   - I've noticed the NetBeans IDE support of `var` is pretty poor 
      - for example move refactoring replaces `var` with FQN types!? I hope I fix it one day.
      - probably a result of this kind of attitude towards `var`
   - I don't share such attitude 
      - For last for years I was coding in languages where it is enough to write `x = 3.14`
      - even `var` is too verbose for my taste
   - I prefer use of `var` in my code over needless verbosity of specifying the type at each assignment



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectTab.java:
##########
@@ -417,6 +421,34 @@ public void writeExternal (ObjectOutput out) throws IOException {
         }
     }
 
+    private static class DepthRespectingRenderer extends NodeRenderer {
+        DepthRespectingRenderer() {
+        }
+
+        @Override
+        protected int findIndent(Object model, TreeNode vis) {
+            var node = Visualizer.findNode(vis);
+            while (node != null) {
+                if (node instanceof ProjectsRootNode.BadgingNode) {
+                    var badge = (ProjectsRootNode.BadgingNode) node;
+                    return badge.pair.depth;

Review Comment:
   > I've noticed the NetBeans IDE support of var is pretty poor (...) or example move refactoring (...) **probably a result of this kind of attitude towards var**
   
   *facepalm*. Not sure what to say to statements like this.
   
   > For last for years I was coding in languages where it is enough to write x = 3.14
   
   DSLs are great for their domains. That is why there are so many languages.
   
   But it is OK to disagree. As I said I am not going to block anything based on style.



-- 
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] Show nested projects co-located and indented [netbeans]

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


##########
ide/projectui/src/org/netbeans/modules/project/ui/ProjectsRootNode.java:
##########
@@ -858,6 +790,9 @@ public void annotationChanged(FileStatusEvent event) {
                     LOG.log(Level.INFO, null, e);
                 }
             }
+            for (var i = 0; i < pair.depth(); i++) {
+                original = "\u00BB " + original;

Review Comment:
   Wow, this looks nice. thank you



-- 
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] Show nested projects co-located and indented [netbeans]

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

   I don't know why you think the alternative I asked you to consider was somehow more radical than this?  It does however take into account the various end user requests we've had in this area over recent years.
   
   This was merged too soon, while there were still outstanding review questions, and no approvals.  Something we generally try not to do.
   
   However, assuming that process leads to the consensus that this is the best approach, we still seem to be missing a switch to disable it?  Please confirm how to do that, or look to implement that, so we don't end up with a revert.


-- 
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] Show nested projects co-located and indented [netbeans]

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

   People saying things look good should not be taken the same as a detailed review and approval.  I'm not anti the change, nor do I have a pressing need for it.  But I'm interested in feedback from the various issue reporters we've had over recent years, because I'm not sure it does address what people have been "waiting for".
   
   To the key point, leaving aside sorting changes, it should be possible for an IDE or platform user to return the display to its previous look.  @mbien mentioned the possibility of indent being a UI property.  I just disagree that that is a follow up discussion.  Likewise, we have generally steered clear of hardcoded Strings and colour uses (eg. font colour in HTML display name) and have tried to remove them.
   
   While we could use NbBundle (less easy for IDE user) or NbPreferences for the String, it's probably better to use values from UIManager for the prefix and any font colours?  That way, both can be configured using the options UI in the IDE too.  An empty String would leave the display as before, and might be special-cased to bypass the additional processing.  There's probably a suitable key for the font colour already?  Same as versioning annotation?
   
   Thoughts?


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