Reusing code snippets in JDeveloper
By Ramkumar Menon on Apr 22, 2008
Here is one simple but useful thing that I've been too lazy to make use of, and had overlooked.
JDeveloper's component palette has a page named "Code Snippets". You could actually add frequently re-used code snippets and save them into the "code snippets" section.
Once you click on "Add component", you can give the snippet a name, for e.g. "Assign WS-Addressing Headers" and copy the snippet from your source code to the given text area.
You can now re-use the code snippet by dragging and dropping the component from the code snippet palette onto the source view of any file that you open in JDeveloper.
Similarly, you can also add your own Pages to the Component palette, to capture Snippets for diferent cateogies of code [for instnace, BPEL,XML, XSD, XSLT etc].
Now you can specify the Page Name and specify the type - "snippet", "java" etc.
Now you can add new code snippets to the new Palette Page that you created.