Clone this wiki locally
About Wicket-Source and SourceOpener
Wicket-source shows wicket component origin locations in source code, in an html attribute, speeding the modification of existing wicket pages.
It lets you Inspect-Element from your web browser, click on a link in a Firebug sidebar, and then Eclipse opens the Java source code to the location of that wicket component. It is meant primarily as a wicket developer tool.
There are three parts.
- Maven Module for wicket called "wicket-source" - records where in the code each component is constructed. Adds an HTML attribute.
- Browser Extension "WicketSource" - displays html attribute and lets you click to open. Available for Firefox+Firebug and for Chrome.
- Eclipse plugin "Source Opener" - listens for clicks from browser and opens the file to that line.
Wicket Module wicket-source
Versioning of everything is based off of Wicket version ala wicketstuff's recommendations. So, the following resources are matched to the 1.5.x version of Wicket.
The module wicket-source plugs in to your Wicket application to record the class and line number where each component is created. It produces an html attribute on each dom node, like so:
Maven dependency for Wicket 6:
<dependency> <groupId>net.ftlines.wicket-source</groupId> <artifactId>wicket-source</artifactId> <version>18.104.22.168</version> </dependency>
or for Wicket 1.5:
<dependency> <groupId>net.ftlines.wicket-source</groupId> <artifactId>wicket-source</artifactId> <version>22.214.171.124</version> </dependency>
For Wicket 7 use
Usage, inside a debug flag check in your WicketApplication:
Obviously, whatever debug check you do, ensure that the matching debug flag is set to true in your dev environment or you won't see any useful output. The process used to discover instantiation locations is a bit slow and should not be used in a production environment.
There is also a
wicket-source-demo web application available via maven central. It's a wicket quick start app modified to show what wicket-source can do. It's a great way to test out your Firefox plugin and Eclipse drop-in setups.
If you need to track a snapshot release for bug fixes, the snapshot repo is:
and the current snapshot version as of Feb 2012 is
WicketSource Firebug Extension for Firefox 7+
This is a Firebug extension, so yes, you need Firebug as well.
The WicketSource (click to install) firebug extension lets you inspect an element and request that the file be opened in Eclipse.
Inspect an element with Firebug, and then go to the WicketSource sidebar pane to see where in the Java code its Wicket component was created. Click the hyperlink to send a request to Eclipse to open the file (you'll need the Eclipse plug-in below for that to work).
WicketSource Chrome Extension
Chrome extension is compatible with Chrome 18 and later. Just like the FireBug extension, the Chrome extension hangs off of "inspect element" and adds its own panel to the tool area.
The BEST way to install is through the Chrome Web Store, here:
Uninstall/delete your existing version of the plugin before installing from the web store.
If for some reason that is taken down, or you want the older version of the plugin, you can still install from the Downloads area. But Chrome has recently changed their extension installation options. You can no longer install directly from a web page on github (or any third party website), for security reasons. If you choose to use it, here's how.
- Download the crx file from my github Downloads area. Save it to your local computer as a file.
- In Chrome, open the Settings / Extensions page.
- Drag and drop the crx file onto the Extensions page.
- Grant it access to read your web sites, and then it will work.
SourceOpener Eclipse Plug-in for Eclipse Indigo
The SourceOpener plugin for Eclipse is the final step.
To install, copy the net.ftlines.wicketsource.sourceopener_VERSION.jar from the Downloads area of this github project, into your \eclipse\dropins\ folder and restart Eclipse. Then go to the menu "Window", "Show View", "Other", "Source Opener", "Recent File Locations", and put the resulting tab wherever you like.
The listener starts up by default, so it should be usable immediately. The first open-file click from Firefox will be slow while the Eclipse search engine initializes; the rest should be quite fast.
Eclipse will open directly to the line in the Java file when it receives the click from Firefox. To reopen a line, double-click any item in the "Recent File Locations" tab.
WicketSource for browsers and SourceOpener for Eclipse communicate across a port. You can set a different port through the preferences (make sure they both match!) and optionally require a password as well.
You can also stop and start the listener in Eclipse (red square to stop, green play button to start). It will pick up preference changes automatically, so you may never need to manually stop or start it.
IDE port for Intellij
George Armhold ported the IDE plugin. Thanks!! He says:
I just whipped up a plugin for Intellij. It might not be publicly available until they have a chance to review it, but here's the link: http://plugins.intellij.net/plugin/?idea&id=6846
You can https://github.com/armhold/wicket-source-intellij/tree/master/artifacts install the jar manually if you don't feel like waiting for it to show up in the public repo.
In the mean time source is on github: https://github.com/armhold/wicket-source-intellij.