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 112340 - [69cat] Code completion popup window has fixed width
Summary: [69cat] Code completion popup window has fixed width
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords: A11Y
: 118574 126498 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-08 16:46 UTC by matthies
Modified: 2010-09-27 22:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
completion window NB6.1beta for SwingBindings.* (26.69 KB, image/png)
2008-03-10 14:07 UTC, mbien
Details
Example screenshot. (26.96 KB, image/png)
2008-03-10 20:13 UTC, matthies
Details
CC for JOptionsPane.show... in NB 6.8 (30.05 KB, image/png)
2010-05-12 15:42 UTC, matthies
Details
CC for JOptionsPane.show... in NB 6.9 Beta (19.24 KB, image/png)
2010-05-12 15:43 UTC, matthies
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2007-08-08 16:46:25 UTC
There is no way to change the width of the code completion popup.
With long identifiers and/or long types (in particular parameterized types), the width can be too small.
For example, here's one CC popup I'm getting:

    ge... ObjectRefProperty<ParticipeAuRegime, Employeur>
    getR...  ObjectRefProperty<ParticipeAuRegime, Regime>
    etc.

The method names are abbreviated so much as to be unusable.
(Abbreviating the types rather than the method names would be an improvement in this case (I'm going to file this as a 
separate issue), but it doesn't really solve the more general problem that the code completion popup has a fixed width.)

Suggested fix:
1) Provide a "preferred size" setting, similar to what already exists for the Javadoc popup window.
2) Grow the width of the CC popup window as necessary, up to the edge of the editor viewport.
Comment 1 Vitezslav Stejskal 2007-08-20 16:47:54 UTC
Reproducible in a dev build.
Comment 2 mbien 2007-11-15 17:48:21 UTC
rc1 and still there.

the quickest fix (for 6.0) would probably be a ingreased hardcoded maximum window width (eg. 600 what would also fit to
the doc window's default width).
Comment 3 Vitezslav Stejskal 2007-11-15 18:23:06 UTC
I'm sorry, but don't expect this to get fixed in Nb6. We are in high resistance now and this can hardly justify as a
showstopper.
Comment 4 matthies 2007-11-16 06:11:44 UTC
With increased use of generics, it becomes more or less a showstopper, as far as utility of the code completion popup 
is concerned. See the example in the description above, the popup becomes pretty much useless there.
I would be very much in favor of at least increasing the hardcoded width.
Comment 5 Vitezslav Stejskal 2007-11-26 09:17:43 UTC
I know this bug can render the CC dialog useless in some situations and I'm sorry that we won't be able to fix it in
6.0. Dusane, do you think we could address this in 6.1M1? Thanks
Comment 6 Vitezslav Stejskal 2008-02-06 10:38:10 UTC
*** Issue 126498 has been marked as a duplicate of this issue. ***
Comment 7 Vitezslav Stejskal 2008-02-06 10:42:26 UTC
Please also see issue #112463, which is an RFE to make the completion popup box resizable.

This is just an idea, but maybe we should let people choose whether they prefer names over the return types or vice
versa. IMO the name is the thing people search for and then in case there are several items with the same name they look
for return types or javadoc, etc.
Comment 8 Marian Petras 2008-02-06 12:05:23 UTC
In my opinion, your idea would be only a supplementary enhancement. These are the fixes in the order of importance:

1) When name and parameters cannot be displayed, prefer name over parameters.
2a) Make the width of the pop-up proportional to the font size.
2b) Introduce an option that would allow the user to set the width of the pop-up, at least.
3) Introduce an option that would allow the user to choose whether name or type should be preferred.

Fix 1) is a quick fix until fix 2) is implemented.
Fix 2a) is the preferred one over 2b).
Fix 2b) is a poor replacement for 2a).
Fix 3) may help to some people but I am not sure at all it is actually necessary.
Comment 9 matthies 2008-02-06 14:16:06 UTC
I'd like to (re-)call attention to my second suggestion from the description of this issue:

    2) Grow the width of the CC popup window as necessary, up to the edge of the editor viewport.

In my opinion, this is superior to either 2a)/2b) above, as proportional to font size effectively still means fixed 
width (in average number of characters), and 2) also doesn't require the user to set an option.
Comment 10 Max Sauer 2008-03-03 10:04:39 UTC
CC width is now automatically resizable, up to right screen border or 40% of screen width if there is not enough space. Any enhancements or ideas are 
welcome.

---
http://hg.netbeans.org/main/rev/6f80f120fdd1

Comment 11 Max Sauer 2008-03-03 15:13:38 UTC
Setting proper TM.
Comment 12 Marian Petras 2008-03-03 15:16:48 UTC
Verified in custom development build 080303.
Comment 13 Max Sauer 2008-03-03 16:00:01 UTC
*** Issue 118574 has been marked as a duplicate of this issue. ***
Comment 14 mbien 2008-03-09 23:33:56 UTC
can't verify the fix with NetBeans IDE 6.1 Beta (Build 200803050202)
I still get identical results as with 6.0.1
Comment 15 Max Sauer 2008-03-10 10:23:08 UTC
Mbien, could you please provide your usecase and a screenshot? Thanks.
Comment 16 mbien 2008-03-10 14:07:00 UTC
Created attachment 58060 [details]
completion window NB6.1beta for SwingBindings.*
Comment 17 mbien 2008-03-10 14:12:54 UTC
I forgot to say SwingBindings is a utility class of the BeansBinding Framework and I use the ziped distribution of NB
6.1beta for easier testing.
Comment 18 matthies 2008-03-10 20:07:55 UTC
I don't see any improvment as well (NetBeans 6.1 Beta).
Comment 19 matthies 2008-03-10 20:13:33 UTC
Created attachment 58089 [details]
Example screenshot.
Comment 20 Max Sauer 2008-03-11 10:45:18 UTC
This fix has not made it to beta branch. Please use trunk builds.
Comment 21 matthies 2008-05-02 08:03:20 UTC
Verified in 6.1 final.
Comment 22 matthies 2010-05-12 15:40:53 UTC
The automatic resize doesn't work anymore in 6.9 Beta.
Attaching screenshots...
Comment 23 matthies 2010-05-12 15:42:16 UTC
Created attachment 98876 [details]
CC for JOptionsPane.show... in NB 6.8
Comment 24 matthies 2010-05-12 15:43:02 UTC
Created attachment 98877 [details]
CC for JOptionsPane.show... in NB 6.9 Beta
Comment 25 matthies 2010-05-12 16:00:10 UTC
Actually there is no regression from 6.8, I was mistaken.
What happens is that when the CC popup is first opened, no resize is done. The resizing only happens when the CC prefix is changed while the CC popup is open, for example by typing further characters, or when pressing Ctrl+Space while the popup is already open.

I had these two use cases:

1) Type "JOptionPane.", where the "." causes an auto-popup, and then scrolling through the CC list with PageUp/PageDown and/or up/down arrow keys. In that case the popup is not resized to fit the visible contents.

2) On existing source code "JOptionPane.show...", press Ctrl+Space behind "show" to invoke CC. Again the popup is not sized to fit the contents.

In either case it's not obvious at all that pressing Ctrl+Space or shanging the CC prefix would cause proper resizing. I would suggest to auto-resize from the beginning.
Comment 26 matthies 2010-05-12 16:05:43 UTC
Reassigning.
Comment 27 Dusan Balek 2010-09-27 22:06:49 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/e61d95dd08e6