Bug 23669 - [plan][DCR][Javadoc] Add support for @cat / @category organization of class members
Summary: [plan][DCR][Javadoc] Add support for @cat / @category organization of class ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.2   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 45077
  Show dependency tree
 
Reported: 2002-09-17 14:58 EDT by Leif Nelson CLA
Modified: 2005-10-28 11:39 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leif Nelson CLA 2002-09-17 14:58:10 EDT
Add support in the Java Browsing Perspective for organizing methods/fields 
using the @category (or @cat - whichever is selected) tag described here: 

http://java.sun.com/j2se/javadoc/proposed-tags.html
and here:
http://developer.java.sun.com/developer/bugParade/bugs/4085608.html

If the Java Browsing Perspective (or any java-based perspective for that 
matter) had a new view called "category" or some such that could be placed 
between the "types" view and the "members" view, I believe it would be very 
convenient.  This category view would display the list of all the 
@cat/@category values that were provided in the entire .java file.  When one of 
these categories was selected, this would "filter" the members view to only 
show members that declared themselves with the selected category in their 
javadoc entry.

This is the EXACT same behavior as protocols in most Smalltalk development 
environments.  Examples of possible categories are provided at the Sun 
enhancement request for @category in the comments (url provided above).

copied from Sun enhancement request:
======
Here are a few examples of typical protocols we used to 
use in Smalltalk, along with a description of the kinds of methods that 
would be assigned to the protocol:

 "accessing" - getter and setter methods

 "converting" - methods that convert the object to another 
type (e.g., toInteger, toDate, toPolygon)

 "calculating" - methods that are about computation (e.g., 
calculateOrderTotal, calculateAverageDuration)

 "initializing" - methods that do initialization

 "adding/removing" - methods that add to or remove from a 
collection maintained by an object (e.g., addCustomer, 
removeOrder)

 "testing" - methods that query the state of the object 
(e.g., isConfirmed, isDirty, includesCustomer)

 "actions" - methods that command an object to do something 
(e.g., turnRight, closeConnection)

In addition to assisting in organizing Javadocs, having 
support for a @category or @protocol tag might encourage 
some vendors with Java code browsers to add by-category 
filtering of methods.  The closer we can get to a Smalltalk 
code browser, the more productive we will all be (my $0.02).
========

This would make it VERY easy to organize the methods/fields on classes that 
have MANY, MANY methods into logical groupings.  Also, since it follows along 
with upcoming java standards would be a good choice for support, in my opinion.

Thanks!
Comment 1 Philipe Mulet CLA 2002-10-28 08:45:07 EST
Would be nice indeed. Not for 2.1 though
Comment 2 Leif Nelson CLA 2003-07-07 11:43:47 EDT
What about 3.0?
Comment 3 Philipe Mulet CLA 2003-07-07 12:46:10 EDT
Nice feature indeed, will tag it for 3.0, no strong promise though, but 
definitely worth investigating.
Comment 4 Philipe Mulet CLA 2003-09-16 17:38:07 EDT
Might be worth surfacing in the JavaModel along with javadoc support...
Comment 5 Leif Nelson CLA 2003-09-23 13:31:26 EDT
Someone (Chris Grindstaff) actually implemented a plugin that has this behavior.  
http://gstaff.org/xdoc/
He had the same idea as others, including myself, but he implemented it!
Comment 6 Philipe Mulet CLA 2004-03-25 06:18:23 EST
Not for 3.0
Comment 7 Philipe Mulet CLA 2004-05-19 10:33:10 EDT
Removing milestone of deferred item.
Comment 8 Frederic Fusier CLA 2005-02-17 11:02:23 EST
Sorry, neither for 3.1...
Comment 9 Jerome Lanneluc CLA 2005-09-21 11:50:02 EDT
Considering 3.2
Comment 10 Jerome Lanneluc CLA 2005-10-12 04:14:13 EDT
Current spec for @category tag: http://www.javac.info/doc?n=JavaDoc.CategoryTags
Comment 11 Jerome Lanneluc CLA 2005-10-13 05:56:06 EDT
Added APIs IMember#getCategories() and IType#getChildrenForCategory(String).

Added tests CompilationUnitTests#testGetCagetories01/11 and
testGetChildrenForCategory01/02, and ClassFileTests#testGetCagetories01/03 and
testGetChildrenForCategory01
Comment 12 Jerome Lanneluc CLA 2005-10-18 11:18:55 EDT
Added IJavaElementDelta#F_CATEGORIES. This flag is set when one or more
categories of an element are added/changed/removed.

Corresponding tests are in ReconcilerTests#testCategories1/3.
Comment 13 Olivier Thomann CLA 2005-10-28 11:39:33 EDT
Verified for 3.2 M3 using build I20051025-0800+JDT/Core v_618a.
Verified that the regression tests are propertly run.