X

Geertjan's Blog

  • March 22, 2006

Wicket: Increasing Productivity Even Further (Part 4)

Geertjan Wielenga
Product Manager
I got a great e-mail from my colleague (who will also be my fellow presenter at JavaOne) Petr Pisl this morning. He's been working on the hyperlinking support for Wicket files. Now, when you hold down the Ctrl key and then move the mouse over a Wicket identifier in an HTML file, as shown below, the cursor becomes a hand and the Wicket identifier becomes a hyperlink:

When you click on that link, the corresponding Java file opens and the cursor lands at the start of the method that contains the corresponding Wicket identifier:

This feature is made possible by the HyperlinkProvider interface. From the perspective of the layer.xml file (which is the configuration file for NetBeans plug-in modules), this is what is needed (i.e., this functionality is provided for all HTML files):

<folder name="Editors">
<folder name="text">
<folder name="html">
<folder name="HyperlinkProviders">
<file name="WicketHTMLHyperlinkProvider.instance">
<attr name="instanceClass" stringvalue="org.netbeans.modules.web.wicketsupport.hyperlink.WicketHTMLHyperlingProvider"/>
<attr name="instanceOf" stringvalue="org.netbeans.lib.editor.hyperlink.spi.HyperlinkProvider"/>
</file>
</folder>
</folder>
</folder>
</folder>

And, if you want to see the code itself (which is well documented, thanks Petr), here's the file that extends HyperlinkProvider:

WicketHTMLHyperlingProvider.java

One question: If you are a Wicket user, where would you want the cursor to be positioned in the corresponding Java file? Currently it is put at the start of the method containing the Wicket identifier. But maybe it should be placed at the start of the line that contains the Wicket identifier instead? Feedback on this would be appreciated.

Join the discussion

Comments ( 2 )
  • dabar Wednesday, March 22, 2006
    and i also suggest that the tags with Wicket IDs should be distinct in the HTML source code like Bold just the way Netbeans JSP editor makes special JSTL tags bold
  • Jonathan Locke Wednesday, March 22, 2006
    Where is the distribution of the Wicket NetBeans plugin available? Is it going to become part of the list of available plugins on the NetBeans site?
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.