Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326669

Summary: XML Annotations/Documentation View
Product: [WebTools] WTP Source Editing Reporter: David Carver <d_a_carver>
Component: wst.xmlAssignee: David Carver <d_a_carver>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: enhancement    
Priority: P3 CC: nsand.dev
Version: 3.2Flags: nsand.dev: review+
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
XML Documentation View
none
javadoc annotations icon to be used with XML Doc view.
none
patch with tweaks none

Description David Carver CLA 2010-09-30 09:49:30 EDT
Currently if using the Tree View (Design tab) of the source editor there is no way to see the corresponding documentation or annotations that the XML file's grammar may have.   This patch will add a XML Documentation view, similar to the javadoc documentation view.   Selecting a Node in any XML based editor should display the corresponding content model documentation for that node selected.  If there is no documentation it will just display the content model.  This leverages the MarkupTagInfo class to help format the documentation.
Comment 1 David Carver CLA 2010-09-30 09:51:10 EDT
Created attachment 179954 [details]
XML Documentation View
Comment 2 David Carver CLA 2010-09-30 09:52:10 EDT
Created attachment 179955 [details]
javadoc annotations icon to be used with XML Doc view.
Comment 3 David Carver CLA 2010-09-30 09:53:45 EDT
Adding Nick for review and feedback.
Comment 4 Nick Sandonato CLA 2010-10-04 15:13:31 EDT
Hi Dave,

Overall, I think this view looks good. Some things I noticed were:

1. Should the default xmlDoc be externalized?
2. The result of presenter.updatePresentation() can return null providing null text, which will generate an SWT Error. (I think this happens if the XML declaration is selected)
3. Currently, the XML Documentation view will actually work with JSP and HTML files as well. It might be worthwhile to just rename the view to "Documentation".
4. Should we use a different icon (possibly the XML comment icon) since the @ symbol doesn't have any inherent meaning in XML?
Comment 5 David Carver CLA 2010-10-04 17:27:07 EDT
(In reply to comment #4)
> Hi Dave,
> 
> Overall, I think this view looks good. Some things I noticed were:
> 
> 1. Should the default xmlDoc be externalized?
> 2. The result of presenter.updatePresentation() can return null providing null
> text, which will generate an SWT Error. (I think this happens if the XML
> declaration is selected)
> 3. Currently, the XML Documentation view will actually work with JSP and HTML
> files as well. It might be worthwhile to just rename the view to
> "Documentation".
> 4. Should we use a different icon (possibly the XML comment icon) since the @
> symbol doesn't have any inherent meaning in XML?

Sure, let me work on these enhancements tomorrow and provide a new patch.
Comment 6 Nick Sandonato CLA 2010-10-14 15:04:25 EDT
Created attachment 180906 [details]
patch with tweaks

Hey Dave,

I wasn't sure if you had a chance to implement the changes, so I made the changes that I suggested in my previous review. Additionally, I also changed it so that this should function based on selections made either in the design or source view (works with XML/XSL/HTML/JSP editors).
Comment 7 Nick Sandonato CLA 2010-10-14 15:11:43 EDT
Checked in the changes to HEAD. Thanks for the new view, Dave.
Comment 8 David Carver CLA 2010-10-14 15:18:30 EDT
(In reply to comment #6)
> Created an attachment (id=180906) [details]
> patch with tweaks
> 
> Hey Dave,
> 
> I wasn't sure if you had a chance to implement the changes, so I made the
> changes that I suggested in my previous review. Additionally, I also changed it
> so that this should function based on selections made either in the design or
> source view (works with XML/XSL/HTML/JSP editors).

Thanks, Nick. I haven't had time to do anything with this.