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 199007 - Long labels handled poorly in popup switcher
Summary: Long labels handled poorly in popup switcher
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks: 47290
  Show dependency tree
 
Reported: 2011-05-30 16:27 UTC by andylaw
Modified: 2012-02-22 11:09 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Menu with "hidden" project names (82.48 KB, image/tiff)
2011-05-31 08:19 UTC, andylaw
Details
menu with hover - truncated project details (expected normal, no-hover behaviour) (72.12 KB, image/tiff)
2011-05-31 08:21 UTC, andylaw
Details
Image showing names truncated in the document switcher popup menu (8.86 KB, image/png)
2012-02-16 17:41 UTC, _ wadechandler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andylaw 2011-05-30 16:27:13 UTC
Product Version = NetBeans IDE 7.0 (Build 201104080000)
Operating System = Mac OS X version 10.6.7 running on x86_64
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.1-b02-334


Pom files now (as of version 7.0) get extra information displayed in the pop-up menu of currently-open files. This is very helpful to allow the user to distinguish one entry from another. However, if project names are too long, the project names are not displayed unless the user hovers over them, at which point they are displayed in truncated form. I would suggest that the truncated form should be the default (and visible) version with a longer (full length) version available with the hover action.
Comment 1 andylaw 2011-05-31 08:19:37 UTC
Created attachment 108613 [details]
Menu with "hidden" project names

This image shows the popup menu of open file names (all pom.xml files) with the project names displayed for those where the name is short enough. The others don't apparently have any project name assigned
Comment 2 andylaw 2011-05-31 08:21:16 UTC
Created attachment 108615 [details]
menu with hover - truncated project details (expected normal, no-hover behaviour)

When the user hovers over an item with no displayed name, the item *does* display a truncated project name. This truncated name should be visible at all times (and not require a hover).
Comment 3 Jesse Glick 2011-06-01 22:55:45 UTC
Reproduced on Ubuntu in Metal and GTK L&Fs on JDK 6 and 7 using glassfish/persistence/oracle-jdbc-driver-packages/pom.xml plus some other open files, using both Ctrl-TAB and the switcher dropdown button. As reported, there are two problems:

1. While long labels are shown truncated correctly (with an ellipsis) when selected, when not selected the words that do not fit are omitted altogether and there is no ellipsis.

2. There is no tool tip of any kind to display the full text of a truncated label.

The SwitcherTableItem's are correct, so it is a rendering problem. Reproducible also without involvement of Maven module, by adding

  items[0] = new SwitcherTableItem(new SwitcherTableItem.Activatable() {public @Override void activate() {}}, "short-name", "<html>some especially long-winded label stuffed here", null, false);

to the SwitcherTable constructor.

Note that when using Ctrl-TAB, the full file path is shown in the status bar, ameliorating the problem.

It is the HTML display which causes problem #1. -J-Dnb.tabnames.html=false changes the behavior somewhat in that it changes the circumstances under which HTML is stripped from the label, but #1 still occurs in this mode.

Adding

  lbl.setToolTipText(item.getHtmlName());

to prepareRenderer sorts of addresses problem #2 for mouse users (i.e. for the popup invoked via the dropdown button), though the tool tips interfere with mouse movement. The ideal behavior for #2 would be similar to what org.openide.explorer.view.ViewTooltips does - truncate unselected items, but for a long selected item, show a popup extension stretching outside the container bounds.
Comment 4 Jesse Glick 2011-06-01 23:28:23 UTC
I think I figured out how to fix #1: core-main #2f98295966a6

(In reply to comment #3)
> The ideal behavior for #2 would be similar to what
> org.openide.explorer.view.ViewTooltips does

Note that this utility does not currently support JTable's. If it did, and it were moved into openide.awt, that could perhaps provide a solution for #2.
Comment 5 _ tboudreau 2011-06-02 08:27:13 UTC
Perhaps nodes / TC's could benefit from having a "short name" for this sort of thing?
Comment 6 Quality Engineering 2011-06-02 21:06:14 UTC
Integrated into 'main-golden', will be available in build *201106021001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2f98295966a6
User: Jesse Glick <jglick@netbeans.org>
Log: #199007 (partial): use HtmlRenderer to better truncate long labels.
Comment 7 Stanislav Aubrecht 2011-09-12 13:08:13 UTC
jano, any hints how to improve the switcher table rendering?
Comment 8 _ wadechandler 2012-02-16 17:40:08 UTC
I think this is the same issue I was just now looking to file. In the editor, when I try to use the document switcher, I see truncated file names, and choosing one is a pita. I will attach a screen shot. Is this this same issue? If so, then I see this in 7.0.1 and in 7.1 using various look and feels.
Comment 9 _ wadechandler 2012-02-16 17:41:13 UTC
Created attachment 115837 [details]
Image showing names truncated in the document switcher popup menu
Comment 10 _ wadechandler 2012-02-16 17:42:20 UTC
If this is in a different popup and needs to be filed separately please let me know. Thank you.
Comment 11 Jesse Glick 2012-02-20 19:31:49 UTC
Wade - yes that is the same popup, after my fix for #1 but with no fix yet for #2.

Not sure why this was assigned to UI - seems pretty clear what the desirable behavior should be (or at least what kinds of behavior would be better than what we have), less clear how to implement.
Comment 12 Stanislav Aubrecht 2012-02-22 11:09:21 UTC
i've made some changes to document switcher popup in core-main 8b8fdf099b5d
long names are now properly truncated instead of being clipped, there's also tooltip for selected item. the tooltip shows tab description not the truncated name though.