Did you know? DZone has great portals for Python, Cloud, NoSQL, and HTML5!

My name is Sagar Ganatra and I'm from Bangalore, India. I'm currently employed with Adobe India and I work there as a ColdFusion Engineer. At Adobe, I have worked on various features of ColdFusion and ColdFusion Builder. I'm very much passionate of web technologies and have a very good understanding of jQuery, Flex, HTML5, Java and of course ColdFusion. Sagar H is a DZone MVB and is not an employee of DZone and has posted 28 posts at DZone. You can read more from them at their website. View Full User Profile

Auto Insertion of Tag attributes and Function arguments in ColdFusion Builder 2

06.21.2011
Email
Views: 4055
  • submit to reddit
The Editor is the most important feature in an IDE and the code assist features in the Editor helps in developing applications quickly and hence help in increasing the productivity. One of features is the 'Auto insertion of tag attributes'. Most of the tags in ColdFusion have a mandatory attribute, for example the attribute 'name' is mandatory when using the cffunction tag. In ColdFusion Builder 2, these attributes are auto inserted i.e. when a user types in the cffunction tag and invokes code assist (using CTRL + SPACE) the name attribute is auto inserted.

Auto insertion also works for function arguments wherein the required arguments are auto inserted. 
Auto Insertion of Tag attributes
As explained above, the mandatory attributes are auto inserted whenever the code assist is invoked for tags such as cffunction:

In the above picture, code assist for cffunction is invoked and the tag is selected from the list. This would auto insert the required attribute 'name':

There are some tags such as cfpdf, cfimage wherein a few attributes become mandatory when one of the attributes' value is specified. For example, in case of cfimage when the action attribute is specified as 'convert', the attributes destination and source become mandatory and are auto inserted:

Now on selecting the action attributes' value as convert, the attributes destination and source are auto inserted:

If the user selects action attributes' value as rotate, then the attributes angle and source are auto inserted:

Another thing to note here is that, after inserting the required attributes the cursor is positioned such that one can go about specifying the next attributes' value.
Auto Insertion of required function arguments
Whenever one tries to invoke a built-in function or a user defined function the required arguments are auto inserted. For example, consider a function foo which takes three arguments, of which the first two arguments are mandatory:
When this function is invoked using code assist, the required arguments are auto inserted. As seen above, arguments arg1 and arg2 are marked as required and are auto inserted when the function is invoked. After inserting the required arguments the first argument is selected so that the user can go about specifying a value for the argument. The tooltip here shows the list of arguments that the function accepts along with the argument type. The last argument - arg3 is marked optional and is surrounded by square brackets indicating that it is optional.
References
Tags:
Published at DZone with permission of Sagar H Ganatra, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)