Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


ID: 21612, XML Code Folding and Scoping

by Keith Wood Email: Anonymous


Bring code folding abilities to XML documents. Hide tags in XML documents when working elsewhere. See where you are within an XML document.
Download Details
FTP  download also available
CDN Login Required to Download. (You will be redirected to the login page if you click on the Download Link)
To download this, you must have registered:
A free membership

For JBuilder, Version 10.0  to 10.0 239 downloads
Copyright: No significant restrictions


Size: 31,571 bytes
Updated on Thu, 08 Apr 2004 21:40:59 GMT
Originally uploaded on Thu, 08 Apr 2004 21:39:48 GMT
SHA1 Hash: D76A496BABE2278A3435D5A10EF03A26541003EF
MD5 Hash: EBB3F5A80197152D865E7B9AECA1A84E

    Explore the files in this upload

Description
This OpenTool provides XML code folding and scoping abilities for XML-based documents. It only works with JBuilder 10. Candidates for code folding are all elements that cover more than one line. The XML parser used has some difficulty identifying the location of the main document element, but is usually only out by one line at most. The Up and Down buttons at the bottom of the gutter move you to the previous or next code folding site at the same depth as the current position. The code scoping also works off the folding sites, showing the innermost surrounding site. Use the Scope Information button in the bottom corner of the editor, or press Ctrl+D to see all the scope information for the item at the top of the screen.

Unfortunately, JBuilder 10 is really only set up to handle code folding in Java source code, so a few hacks have been included to overcome this limitation. A parallel XML file node hierarchy is established to correctly invoke the code folding when necessary. Warning: if you use other OpenTools that subclass any of the XML file nodes then this tool will not function for them (however, you could easily duplicate the code included here for that new subclass).

Even then, JBuilder does not automatically show the code folding for XML based documents. You could manually toggle the Enable code folding option for each file, but a bindable action is included here to ease the process. Under Tools | Preferences on the menu, select the Keymapping tab and press the Edit button. Look for the show-xml-folding action under the Miscellaneous category and assign a keystroke to it (such as Ctrl+Alt+F). Then, for each XML document opened, press this keystroke to show the code folding.

To install, just copy the JAR file to your JBuilder/lib/ext directory and then restart JBuilder. You will see a setup reminder message the first time you run the tool (and thereafter if you ask to be reminded again).

   Latest Comments  View All Add New

Move mouse over comment to see the full text

Could not retrieve comments. Please try again later.

Server Response from: ETNACDC03