[tasklist] Re: [nbdev] Tasklist SPI suggestions
Tor Norbye <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.tasklist.devel |
|---|---|
| Organization | Sun Microsystems, Inc |
| Message-ID | <1050439276.6624.72.camel__26175.9971538142$1054570093@proto> |
On Mon, 2003-04-14 at 17:31, Julian Sinai wrote: > We are using the Tasklist SPI (it's great!), and we have a couple of > enhancement requests (perhaps there are already ways of doing these things): Unfortunately, not using the Tasklist SPI. > -Our suggestions relate to symbols on a graph, not files. Therefore the > file- and line-based suggestions window is not useful for us. It would be > nice if you could customize the suggestions window with other columns. Ok. When you're saying the suggestions window is not useful to you - do you mean that you want to have a special window dedicated to showing only your own suggestions - or do you want these suggestions to be included in the user's main suggestions window, along with other suggestions (copyrights, javadoc, pmd, etc.) ? If you want to have a separate window, that's doable - but you have to use the tasklist/core APIs - these are much richer (and more complicated, and less documented, and not as "stable", and less elegant since they have evolved quite a bit over the last year to accomodate different needs.) Take a look at the tasklist/usertasks or tasklist/bugs or tasklist/compiler for example for modules which use these APIs to create their own dedicated views. If you want to have your suggestions show up in the shared suggestions window you need to take a different approach (below). > -Our SuggestionPerformer needs to highlight the symbol on the graph. We need > to store some state in the Suggestion so the performer knows what to do. It > would be nice if Suggestion could take an Object property. You can't > currently subclass SuggestionImpl, nor clone-and-own it, because of > package-privacy issues. Ah, I see - I made SuggestionImpl final. OK, I can change that. If you unfinal SuggestionImpl, you can add some state to it (and some of your own properties to SuggestionNode). Then you can new your own SuggestionImplChild, and register it with the SuggestionManager. (Yes, I know the javadoc says not to do that, but that's because it wants to make sure that the Suggestions created are indeed SuggestionImpl's, not merely the superclass Suggestions from tasklist/api). This means your suggestion will show up with additional properties in the property sheet. However, the suggestions view won't have these properties as displayable in a separate column. To do -that- you have to do more work. I think it would work to subclass SuggestionsView, add in your own columns, and replace (using system file system _hidden attributes) the regular View Suggestions action with your own which instantiates your child suggestions view. > -We're attempting to clone-and-own the entire suggestions package, but > there's a lot of code, and we'd prefer not to, so we can take advantage of > future features. Yes, I think subclassing as I've outlined above is the way to go. The tasklist APIs aren't flexible enough to do what you want yet, and I'm not sure exactly what the API would have to look like to accomodate your needs. If you have specific suggestions, please mail them to nbdev. -- Tor