Re: Programmatically doing 'Find Usages"
Sunil Dudani <[email protected]> Mon, 14 Nov 2016 15:25:53 -0800
| Newsgroups | gmane.comp.java.netbeans.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks John. Not so much of a recommendation for new code but analytics for existing code for all usages of the various Logger methods. Sunil On 11/14/2016 3:19 PM, John McDonnell wrote: > Sunil, > > Are you trying to do something like this? > http://www.eclipse.org/recommenders/ > > But in Netbeans? > > Regards > > John >> On 14 Nov 2016, at 23:16, geertjan wielenga >> <[email protected] <mailto:[email protected]>> >> wrote: >> >> >> PS: it would really help to know what you are trying to achieve -- >> what does this mean: "analyze the statement and provide logging >> recommendations to the user". What kind of analysis and logging >> recommendations are you talking about? >> >> On 15-11-2016 0:13, geertjan wielenga wrote: >>> >>> https://blogs.oracle.com/geertjan/entry/custom_declarative_hints_in_netbeans >>> >>> https://blogs.oracle.com/geertjan/entry/oh_no_vector >>> >>> Gj >>> >>> On 15-11-2016 0:11, Sunil Dudani wrote: >>>> >>>> Note that i want the user to be able to select any Logger instance >>>> variable used in a Class, not just the Logger constructor. A 'Find >>>> Usage' on the instance variable does not search for usages of the >>>> variable Class across modules. >>>> >>>> I can get the Class name when the user selects (put the cursor) the >>>> variable by comparing the Element.asType().toString() to >>>> "java.util.logging.Logger" >>>> >>>> Thanks >>>> >>>> >>>> On 11/14/2016 2:40 PM, geertjan wielenga wrote: >>>>> >>>>> Could you not, instead of the below, have a menu item in the Usage >>>>> output window to process the statements? >>>>> >>>>> I.e., after the usages are displayed, you'd have a way of >>>>> accessing those usages in the Usage output window and then do >>>>> something with them? >>>>> >>>>> Gj >>>>> >>>>> On 14-11-2016 23:38, Sunil Dudani wrote: >>>>>> >>>>>> Hi Folks, >>>>>> >>>>>> Pardon my newbie questions: >>>>>> >>>>>> Background: i am writing a new search and recommend plugin for >>>>>> Java development (please correct if this is not the right forum) >>>>>> >>>>>> 1. Specifically, i am requesting suggestions for sample/open >>>>>> source code for "Find Usages". I wish to provide some additional >>>>>> user action based on the search results. >>>>>> >>>>>> 2. Once the user clicks on a particular field (i have that >>>>>> working using the sample CopyFQNAction plugin), i would like to >>>>>> display a new button. >>>>>> >>>>>> Use case: >>>>>> >>>>>> User selects any java.util.logging.Logger.log() statements in a >>>>>> Java file and the code should find all instances of similar log() >>>>>> statements in all the open projects (same as what is being done >>>>>> by 'Find Usages'. However, rather than display these in the Usage >>>>>> output window, i want to analyze the statement and provide >>>>>> logging recommendations to the user. >>>>>> >>>>>> Thanks, >>>>>> Sunil >>>>>> >>>>> >>>> >>> >> >