Community
Participate
Working Groups
With bug 356620, JDT/Core is providing the support to specify the index files when the class path library is specified. JDT/UI should show the index file used allow users to modify or update them.
I have put in the high level approach, the implementation with the bug and some questions. Please let us know if this is inline with what you would need.
In JDT/UI we need to allow to view and edit the index location from - a jar's properties page - the 'Libraries' tab in the 'Java Build Path' page for a project. I suppose we also need an extension point in PDE, see bug 356620 comment 16. Anything else ?
Do you need a delta when the index is modified? BTW, we do generate the delta for the change in source attachment too. Do you make use of this?
(In reply to comment #3) > Do you need a delta when the index is modified? At this point, I don't see why we would need the delta. But then I could be wrong as I not an expert in this area. > BTW, we do generate the delta > for the change in source attachment too. Do you make use of this? Yes, we do.
Per https://bugs.eclipse.org/bugs/show_bug.cgi?id=356620#c37, JDT/Core support for this feature retargetted to early M5.
See also bug 365446.
I have created and pushed a topic branch - 'dazad/bug364287-JarIndex' (http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/log/?h=dazad/bug364287-JarIndex) (In reply to comment #2) > In JDT/UI we need to allow to view and edit the index location from > - a jar's properties page > - the 'Libraries' tab in the 'Java Build Path' page for a project. These two things work. Comments are welcome on the UI and functionality. (I guess you can also just make code changes in the branch, rather than commenting here, at least for the minor changes e.g wording for labels) TODOs: - Validation of index file - I guess we want to provide an option for this when the user is specifying the index file? Currently JDT/Core does not provide an API to validate the index (see bug 365446), hence 'Validate' does not work. - There are a few TODO's in code for minor things e.g. help context - I started by copying the UI code for 'Javadoc location', hence there is some scope for code duplication reduction. I will work on this.
Do we have some example JARs and indices somewhere? If not, please create some and attach them here so that the UI can be tested.
Created attachment 209362 [details] test.jar
Created attachment 209363 [details] test.index
Test a 'broken' example - Fresh workspace - Add 'test.jar' as a library to a Java project - Specify any invalid file as the Index for this jar e.g. you can specify test.jar as index for test.jar - Since the index is invalid a correct index will be created in "<workspace>\.metadata\.plugins\org.eclipse.jdt.core". The file name for this index would be "<magicnumber>.index", looking at the time stamp for the file would help in identifying it. - Open this index file in a text editor and compare with 'test.index' attached here, both will look the same. Test a 'good' example - Fresh workspace - Add 'test.jar' as a library to a Java project - Specify 'test.index' as the Index for this jar - Check in "<workspace>\.metadata\.plugins\org.eclipse.jdt.core", no new index file is created.
For the 'Index Location' property on the 'Libraries' tab in the 'Java Build Path' page for a project I have used the 'Jar with Source' icon for now. But I suppose we will need a new icon?
> suppose we will need a new icon? Yes.
The requester of the feature will never need a UI as he points to the index via its own CP container. We need to validate and decide whether we really want to provide the UI. Deepak, please check how much we'd gain by e.g. using a pre-built index for the rt.jar and for the jdt.ui JAR. Also, if we provide the UI for rt.jar (i.e. 'JRE System Library') then we also need to adjust the 'Edit JRE' dialog.
(In reply to comment #14) > The requester of the feature will never need a UI as he points to the index via > its own CP container. We need to validate and decide whether we really want to > provide the UI. I feel that it is a bit atypical and somewhat unnatural for a user to specify the pre-built index using the UI. Viewing may be useful as it simply exposes a new attribute and informs. Admit even that is only weakly tenable.
(In reply to comment #14) > The requester of the feature will never need a UI Closing as WONTFIX for now.
Created attachment 209537 [details] patch for doc I already had this patch for UI doc, attaching it here in case we need it in future.