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.

Bug 42589 - Patch - use truncated package names
Summary: Patch - use truncated package names
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 35564 (view as bug list)
Depends on: 44321
Blocks: 41535
  Show dependency tree
 
Reported: 2004-04-29 01:06 UTC by Jesse Glick
Modified: 2007-09-26 09:14 UTC (History)
3 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Suggested patch (5.04 KB, patch)
2004-04-29 01:07 UTC, Jesse Glick
Details | Diff
Screenshot of Logical View with shortened package names. (57.85 KB, image/jpeg)
2004-04-29 15:21 UTC, Petr Hrebejk
Details
Screenshot of new truncation algorithm (15.98 KB, image/png)
2004-05-11 01:50 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-04-29 01:06:28 UTC
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.
Comment 1 Jesse Glick 2004-04-29 01:07:54 UTC
Created attachment 14609 [details]
Suggested patch
Comment 2 _ tboudreau 2004-04-29 09:57:33 UTC
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.
Comment 3 Petr Hrebejk 2004-04-29 15:19:52 UTC
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.
Comment 4 Petr Hrebejk 2004-04-29 15:21:03 UTC
Created attachment 14620 [details]
Screenshot of Logical View with shortened package names.
Comment 5 Jesse Glick 2004-04-29 15:49:33 UTC
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.
Comment 6 Jesse Glick 2004-05-11 01:04:30 UTC
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.
Comment 7 _ tboudreau 2004-05-11 01:36:45 UTC
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? 
Comment 8 Jesse Glick 2004-05-11 01:43:44 UTC
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.
Comment 9 Jesse Glick 2004-05-11 01:48:34 UTC
Looks better IMHO. Will attach new screenshot.
Comment 10 Jesse Glick 2004-05-11 01:50:39 UTC
Created attachment 14802 [details]
Screenshot of new truncation algorithm
Comment 11 Jesse Glick 2004-05-11 23:44:28 UTC
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
Comment 12 Jesse Glick 2004-05-12 01:17:50 UTC
Also java/project/arch.xml 1.3.
Comment 13 jrojcek 2004-05-12 10:24:31 UTC
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)
Comment 14 Jesse Glick 2004-09-02 16:11:14 UTC
*** Issue 35564 has been marked as a duplicate of this issue. ***
Comment 15 Petr Nejedly 2005-08-18 15:33:28 UTC
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)
Comment 16 Jesse Glick 2005-08-18 15:53:32 UTC
#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.
Comment 17 Quality Engineering 2007-09-20 09:48:24 UTC
Reorganization of java component