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.
Summary: | [QuickSearch] Search through options | ||
---|---|---|---|
Product: | platform | Reporter: | Ondrej Langr <olangr> |
Component: | Quick Search | Assignee: | apireviews <apireviews> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | anebuzelsky, dsimonek, jbecicka, jskrivanek, jtulach, msauer, pchytil |
Priority: | P2 | Keywords: | API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://ui.netbeans.org/docs/ui/quicksearch/index.html | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 191803 | ||
Bug Blocks: | 137318, 134398 | ||
Attachments: |
Diff
new patch, with declarative optionCategory and AdvancedOption patch with yarda's suggestions patch to integrate |
Description
Ondrej Langr
2008-06-16 17:11:33 UTC
This feature needs API change in options.api module. I propose to add method to class SPI OptionsPanelController /** * Set of keywords related to this panel * @return Map<category name, Set<keyword>) */ public Map<String, Set<String>> getKeywordsByCategory() { return Collections.EMPTY_MAP; } default implementation returns empty map. Proposed change is compatible. Diff includes also proposed changes in options.api module and implementation for java options and todo tasks as proof of concept. Created attachment 62934 [details]
Diff
BTW "Occurences" is a misspelling. You meant "Occurrences". ^^ [JG01] Missing @since, spec version change, and usage of new version. [JG02] "@return Map<category name, Set<keyword>)" has a spurious ')', and will not appear correctly in HTML. The physical type is clear in Javadoc; spell out what the method does. "@return a map from category name to a set of keywords" or similar. Also the initial sentence is missing a period ('.'). > BTW "Occurences" is a misspelling. You meant "Occurrences".
Well, problem with spelling was not introduced by me. "JavaOptions/MarkOccurences" is name of folder in xml filesystem,
I must follow it. I use correct spelling in keyword definition, which is relevant to users. The same issue is with
Formating vs. Formatting.
JG01, JG02 - will fix.
[JS01] Move initialization of categoryToController in Model class into init() and use new DelegatingController(). [JS02] Make CategoryModel.getCategories() package private. Regarding misspelled folder names - I know, I was suggesting the name of the actual folder just be corrected. Y01 Last time Jirka added a method into the Options SPI I asked him to make it protected, so it is clear that only the infrastructure is supposed to call it, nobody else. Please make this method protected as well. Y02 I do not like the method at all! Does this mean that first time somebody uses Quick Search, you load all classes of all panel providers into memory? I do not think performance people can agree with that. Please propose some declarative way of annotating the panels, so you do not need to load any class until it is really displayed. Y01: NP Y02: I'm not performance expert, but it is obvious, that something needs to be loaded for all panels. Panel controllers are quite lightweight and I tried not to introduce any new class. What declarative way do you have in mind? Can you quantify performance comparison of declarative solution? Thanks for help. Re. Y03, I'd like the OptionsCategory to have a static method create that would read its values from a layer. Use issue 138076 to get localized values from the layer in standard way. I'm just curious, what's the status? Will we make it for M2? Created attachment 64256 [details]
new patch, with declarative optionCategory and AdvancedOption
Here is a new patch, with declarative way of loading OptionCategory and AdvancedOption (subpanels), with example of 'General' option category and 'ToDo' subpanel. Other categories are not yet rewritten. Jardo? I asked Max not to publish method getOptionsByCategory, Otherwise patch seems to be ok. Y11 Looks like the GeneralOptions class can be completely deleted from the implementation Y12 I do not like "controllerClassName", instead I suggest to use just: <attr name="controller" newvalue="org.netbeans.core.ui.options.general.GeneralOptionsPanelController"/> Also do not play tricks with classloaders in OptionsCathegory and co. Just do attrs.get("controller") to get the right instance. Y13 apichanges.xml do not mention the new factory method yet Y14 Do not change "public abstract class AdvancedOption" into class with implementation. Keep it abstract. Put the implementation into some AdvancedOptionImpl extends AdvancedOption class. No the other hand, keep the factory method in the API class. Y15 The same as Y14 applies to OptionsCategory, put the implementation into own class, keep the API class abstract as it was. Y16 ToDoOptions class can probably be deleted Created attachment 64348 [details]
patch with yarda's suggestions
I've added a patch implementing Jarda's suggestions. In case there will be no objections, I'll integrate the patch tomorrow. Created attachment 64443 [details]
patch to integrate
Integrated into core-main by http://hg.netbeans.org/core-main/rev/d6c325e1834f Integrated into 'main-golden', available in NB_Trunk_Production #324 build Changeset: http://hg.netbeans.org/main/rev/d6c325e1834f User: Max Sauer <msauer@netbeans.org> Log: #137338: QuickSearch through options verified in: Product Version: NetBeans IDE 6.5 RC1 (Build 200810151402) Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-133 System: Mac OS X version 10.5.5 running on i386; MacRoman; en_US (nb) Userdir: /Users/petr/.netbeans/6.5rc1 |