Tuesday 3 March 2009

JDev IDE: defaulting to the source code editor for web pages

Recently Vivek Kumar posted about Improving Performance in JDeveloper 11g. Among other suggestions his second one caught my eye: "Configure JDeveloper to open jsp/jsff's in source view". This particular suggestion applies not only to JDev 11g, but also JDev 10g (and possibly earlier versions too, none of which I have installed to check). Unfortunately Vivek didn't give details of how to configure this so I thought I'd do it here.

On opening a web page in the IDE, there is a noticable delay while JDev initializes the WYSIWYG design editor. This becomes painful if you want to only make a small code change in the web page's source code. It becomes doubly painful as there is an infrequent bug in JDev 11g build 5188 where the design editor refuses to show the page's contents unless you flick between the source code and design editor views.

As such Vivek's suggestion took my eye and reminded me we can easily change the default behaviour of JDev to open web pages in the source code editor instead, to avoid these minor annoyances.

The option to do this is under the Preferences dialog invoked via the Tools menu, then selecting the File Types node:


As can be seen from the above picture, selecting the Default Editors tab displays all the different file types JDeveloper works with. For standard JSF pages with an extension of .jsp or .jspx, we can select the JSP Source option and switch its Default Editor option from Design to Source as I've done in this example.

One minor caveat to note is JDeveloper does remember for each file what editor type you were last using, so this change only applies to new files.

2 comments:

Unknown said...

Great tip...

Posted here as well http://www.linkedin.com/groups?gid=1801839&trk=hb_side_g

Vik

es.pinedo said...

Thank you very much