This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Not ideal but IMHO far more usable than the current package view esp. for someone with limited screen space. Truncates e.g. org.openide.modules to o.o.modules. Try it out and let me know what you think.
Created attachment 14609 [details] Suggested patch
Wow, this sounds a lot like my "abbreviations" problem in Navigator :-) I did something about a better solution for this type of problem on "tims_pointless_looks_branch" of looks - an AttributedCharacterIterator w/ one attribute "Importance" and a convenience impl which allows you to just call addSegment (String seg, int importance). Then the view could figure out how much and what it needs to display. Not that it helps here, but it's probably the right way to permanently solve such problems. Unfortunately I accidentally deleted my working implementation of look based explorer views three days ago. Oh well, wouldn't help for promo d anyway.
Hmm I've tried it on netbeans sources and showed that to few people and the reactions were various. Some people liked it some people did not. I will attach a screen shoy which shows how it looks like. Please notice the JavSupportAPis node with the o.n.a.j.classpath, o.n.m.j.classpath, o.n.s.j.classpath. This was something what most of the people complained about.
Created attachment 14620 [details] Screenshot of Logical View with shortened package names.
You could probably make the regexp smarter, e.g. by not truncating anything which is already at most 3 letters, unless it is the first component ('org' etc.). Or set a target length for the final display name and truncate only enough components (starting at the beginning, and never truncating the last component) to reach that goal.
Hele you're not touching it and I'm suffering on my laptop. :-) Tell you what, I'll put in an improved version conditionally (based on a sysprop) and we can decide later if we want to make it the default.
What sysprop? A suggestion: How about to optimize for the common case and get rid of the "Source Packages" node, but keep the Test Packages, etc. nodes at the end of the list of packages?
Sysprop will be: -J-Dorg.netbeans.spi.java.project.support.ui.packageView.TRUNCATE_PACKAGE_NAMES=true Re. showing sources and tests differently: not sure I like that much either, but leave for Jano to comment. Won't help much w.r.t. horizontal space anyway.
Looks better IMHO. Will attach new screenshot.
Created attachment 14802 [details] Screenshot of new truncation algorithm
Applied, but off by default. committed * Up-To-Date 1.3 java/project/src/org/netbeans/spi/java/project/support/ui/Bundle.properties committed * Up-To-Date 1.9 java/project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java committed * Up-To-Date 1.4 java/project/test/unit/src/org/netbeans/spi/java/project/support/ui/PackageViewTest.java
Also java/project/arch.xml 1.3.
Don't put it on by default, it might look like a bug. (I understand there is a problem with flatten packages view and this is one of the solutions)
*** Issue 35564 has been marked as a duplicate of this issue. ***
It may be better if the regexp is configurable (per project in private). Anyway, I'd prefer two following algorithms (not regexp-able). 1. nbm-specific: strip (compress) the prefix that matches code-name-base of given module. 2. generic: if all the entries in the list have the same common prefix (modulo default package and META-INF), strip/compress that common prefix. I believe this would work for most projects. In both cases, the drawback is that the user will have weaker hint in which context he currently is (several projects with similar package names)
#2 was already proposed by Jano long ago as a supported replacement for the truncated view. It would be supplemented by tooltips always showing the full package name.
Reorganization of java component