Universal Gadget for JIRA comes with 5 built-in samples that demonstrate how to build custom widgets.