| By Chris Muir | Article Rating: |
|
| March 7, 2010 06:54 AM EST | Reads: |
3,216 |
The JDev11gPS1 New Features page lists a large amount of improvements, including something called the "Declaration Insight". The New Features blurb lists this feature as "When declaring local variables from method calls, declaration insight can automatically add the declaration and assignment code as well as completing the method call."
Like us, if you're using JDev11gPS1 you've probably already stumbled upon this feature and not realized it.
You'll be familiar with the traditional Completion Insight. Say in an EntityImpl you're implementing a method and within you want to call the super class method to get the database transaction. However you've forgotten the function name, is it getDBTransaction or getDatabaseTransaction? This is easily solvable by starting to type the function name "getD" then activating Completion Insight, either via pressing Ctrl-Space or the Source menu's same named option. The editor will show the Completion Insight popup in blue with all the functions starting with "getD" in the super class stack, including the method we’re interested in getDBTransaction:
Selecting the same named method, the method is instantly copied into the code:
...saving you some typing and hunting around for the right method.
However the Completion Insight only really gives the right hand side of the assignment expression. It would be good if you could get the IDE to create the left hand side of the assignment expression creating a variable of the correct type to take the result from the function, as well as the function call on the right hand side of the assignment operator as per what the Completion Insight does.
This is where the new "Declaration Insight" comes in. On invoking the Completion Insight with Ctrl-Space showing itself in blue, if you press Ctrl-Space again you'll see the popup changes to puce and displays the very similar Declaration Insight:
Again selecting the same named method, using the Declaration Insight the result is:
....where both the function call and the variable to be assigned the result are inserted into your code, ultimately saving you a bit more typing. If you're like me, and always forgetting what the return type is by the time you're back to the editor, and having to hunt for it again by double invoking the Completion Insight, this will same some extra time.
A minor but useful enhancement in the latest JDev11gPS1 release.
Read the original blog entry...
Published March 7, 2010 Reads 3,216
Copyright © 2010 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Chris Muir
Chris Muir, an Oracle ACE Director, senior developer and trainer, and frequent blogger at http://one-size-doesnt-fit-all.blogspot.com, has been hacking away as an Oracle consultant with Australia's SAGE Computing Services for too many years. Taking a pragmatic approach to all things Oracle, Chris has more recently earned battle scars with JDeveloper, Apex, OID and web services, and has some very old war-wounds from a dark and dim past with Forms, Reports and even Designer 100% generation. He is a frequent presenter and contributor to the local Australian Oracle User Group scene, as well as a contributor to international user group magazines such as the IOUG and UKOUG.
- Patterns for Building High Performance Applications
- It's the Java vs. C++ Shootout Revisited!
- Asynchronous Logging Using Spring
- Java for Programmers (2nd Edition)
- Cross-Platform Mobile Website Development – a Tool Comparison
- Three Buzzwords That Every CIO Hears but One They Should Listen To
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Immersing into JavaScript Frameworks
- Workday Reportedly Prepping to Go Public
- Cloud Expo New York: The Java EE 7 Platform - Developing for the Cloud
- Book Review: Sams Teach Yourself Java in 24 Hours
- OpenOffice.com Lives
- Book Excerpt: Introducing HTML5
- Adobe Sends Flex to the Apache Foundation
- Five Years Waiting for JRE 7: Is It Justified? (Part 1)
- Book Excerpt: Java Application Profiling Tips and Tricks
- i-Technology in 2012: Five Industry Predictions
- Patterns for Building High Performance Applications
- It's the Java vs. C++ Shootout Revisited!
- OpenXava 4.3: Rapid Java Web Development
- The Next Web Architecture
- Asynchronous Logging Using Spring
- Java for Programmers (2nd Edition)
- Is Write Once Run Anywhere Ever Going to Be a Reality?
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- JavaServer Faces (JSF) vs Struts
- The i-Technology Right Stuff
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- What's New in Eclipse?
- i-Technology Predictions for 2007: Where's It All Headed?





















