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 124351

Summary: Unable to change text in completion popup
Product: editor Reporter: Rohan Ranade <rohanranade>
Component: Completion & TemplatesAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: blocker CC: vv159170
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed change

Description Rohan Ranade 2007-12-21 03:48:51 UTC
I am trying to implement smart code completion for a Spring Beans Context XML file
(http://spring-netbeans.sourceforge.net). When the user presses Ctrl+Space, I want to show items locally defined in the
XML file, and when the user presses Ctrl+Space again, I want to show all items (local + ones defined in referenced files).

CompletionResultSet.hasAdditionalItems() does the trick for me, but shows me the text "Imported Items. Press Ctrl+Space
again..." at the bottom of the completion pop up. This text is misleading in my usage context and I want to change it.
However there is no method exposed to change this text. This text should be configurable, as the smart completion is now
going to be used in XML files like Spring beans config as well as hibernate mapping/config files.
Comment 1 Vitezslav Stejskal 2008-01-02 10:36:25 UTC
We are sorry, but presently there is no way to change this text through the Code Completion APIs. We'll have to find
some solution.
Comment 2 Dusan Balek 2008-01-30 13:18:36 UTC
Created attachment 55762 [details]
Proposed change
Comment 3 Dusan Balek 2008-01-30 13:21:08 UTC
I would like to propose a small change to the editor/completion API to allow for customization of the text as requested
(diff is attached).
Comment 4 Vladimir Voskresensky 2008-01-30 14:33:31 UTC
patch is OK for me
Comment 5 Vitezslav Stejskal 2008-02-04 15:43:52 UTC
I know this is nitpick, but should not there be some sort of a separator between messages supplied by several completion
providers or should we just pick the first one? And I suppose, there will be related changes in existing completion
providers that need to call CRS.setHasAdditionalItemsText(), right? (at least in Java completion provider; obviously in
C++; maybe also in Ruby and others)

Otherwise the change is looking good, thanks.
Comment 6 Vladimir Voskresensky 2008-02-04 16:42:06 UTC
I'm OK to update C++ text after integration by myself
Comment 7 Dusan Balek 2008-02-07 10:04:33 UTC
Fixed.

changeset fc946e8c34d2 in main
details: http://hg.netbeans.org/main?cmd=changeset;node=fc946e8c34d2

changeset 3f8068e9891b in main
details: http://hg.netbeans.org/main?cmd=changeset;node=3f8068e9891b