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 211287 - Make default search results displayer customizable
Summary: Make default search results displayer customizable
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2012-04-16 20:43 UTC by Jaroslav Havlin
Modified: 2012-04-27 10:01 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch (87.33 KB, patch)
2012-04-16 20:43 UTC, Jaroslav Havlin
Details | Diff
Patch (97.39 KB, patch)
2012-04-20 15:16 UTC, Jaroslav Havlin
Details | Diff
Patch (97.41 KB, patch)
2012-04-23 09:02 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Havlin 2012-04-16 20:43:43 UTC
Created attachment 118366 [details]
Patch

Module api.search provides a very simple default component for displaying search
results.
Some clients, e.g. module cnd.search, need to reuse some advanced features used in the standard search results panel.

The attached patch changes result type of SearchResultsDisplayer.createDefault
to new type DefaultSearchResultsDisplayer, that is enhanced (buttons to navigate in results) and that enables clients to customize the outline view used to display nodes, e.g. to add property columns.

There is also new support for creating combo box for search text pattern, method ComponentUtils.adjustComboForSearchPattern and class SearchPatternController.

The patch was co-authored and revised by Andrew Krasny from CND team.
Comment 1 Jaroslav Havlin 2012-04-18 07:38:06 UTC
Please review.
Comment 2 Andrew Krasny 2012-04-19 12:15:21 UTC
No objections.. Means it passed.. (?)
Comment 3 Alexander Simon 2012-04-19 12:52:22 UTC
[AS01] Final keywords are redundant in the method SearchResultsDisplayer.createDefault()
[AS02] SearchPatternController opens internal methods:
getOption(), getText(), requestFocusInWindow(), setOption(), setSearchPattern() and setText(). Probably methods should be hidden.
Comment 4 Jan Becicka 2012-04-20 09:12:28 UTC
[JB01] all API classes should be final if possible (for instance SearchPatternController should be final, right?)
[JB02] document change in api-changes.xml
[JB03] Use @since tag properly for all new stuff
[JB04] Do not forget to increase spec version of the module
Comment 5 Jaroslav Havlin 2012-04-20 15:16:54 UTC
Created attachment 118574 [details]
Patch
Comment 6 Jaroslav Havlin 2012-04-20 15:25:43 UTC
AS01 - Redundant "final" keywords removed.
AS02 - Methods made private, except for "requestFocusInWindow".
       I think it is quite useful. Do not you think so?
JB01 - Class SearchPatternController made final.
JB02 - File apichanges.xml created.
JB03 - Tags @since added.
JB04 - Specification version increased.

Thank you for your comments.
Comment 7 Andrew Krasny 2012-04-20 16:50:42 UTC
Regarding requestFocusInWindow... Strictly, this is not Controller's method... 
requestFocusInWindow method is supposed to be a method of some Component... 
And also for user of this API it is not big difference either invoke this controller.requestFocusInWindow or his combobox.requestFocusInWindow.
Comment 8 Jaroslav Havlin 2012-04-23 09:02:30 UTC
Created attachment 118617 [details]
Patch

(In reply to comment #7)
> Regarding requestFocusInWindow... Strictly, this is not Controller's method... 
> requestFocusInWindow method is supposed to be a method of some Component... 
> And also for user of this API it is not big difference either invoke this
> controller.requestFocusInWindow or his combobox.requestFocusInWindow.
Sure, sorry, my mistake.
Fixed.
Comment 9 Jaroslav Havlin 2012-04-24 11:52:00 UTC
If there are no objections, I'll integrate tomorrow. Thanks.
Comment 10 Jaroslav Havlin 2012-04-25 12:31:29 UTC
Integrated as http://hg.netbeans.org/core-main/rev/d55e9c11ecfd
Comment 11 Quality Engineering 2012-04-26 10:30:54 UTC
Integrated into 'main-golden', will be available in build *201204260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d55e9c11ecfd
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #211287 - Make default search results displayer customizable
Comment 12 Quality Engineering 2012-04-27 10:01:39 UTC
Integrated into 'main-golden', will be available in build *201204270400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/83016f739006
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #211287 - Fixed apichanges.xml, missing @since annotation