Showing posts with label CFBuilder. Show all posts
Showing posts with label CFBuilder. Show all posts

Sep 15, 2011

A Cloud of Productivity features in ColdFusion Builder

Yesterday at the ColdFusion Developer Week, I had demonstrated the Productivity features in ColdFusion Builder. Here is a cloud of these features: 

Jun 20, 2011

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

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. 

Apr 7, 2011

Navigation enhancements in ColdFusion Builder 2.0

Do you spend a lot of  time scrolling large files, just to find out the next function definition in place or to figure out the end\start of a tag? If your answer is YES, then why don’t you try the Navigation enhancements in ColdFusion Builder 2.0?
ColdFusion Builder comes to you with three types of Navigation enhancements:
-         Code Navigation
-         Smart Tab Navigation
-         Jumping to matching tag.

Code Navigation

Code Navigation is all about navigating to the next function definition in place. Imagine a CFC containing various cffunction tags. It is a time-consuming task to keep scrolling and keep an eye on the file to get to the next cffunction tag. ColdFusion Builder 2.0 provides a shortcut key CTRL + SHIFT + DOWN to navigate to the next function definition. And to navigate to the previous function definition, you can use the shortcut CTRL + SHIFT + UP.

Code Navigation works in conditional statements as well. Consider an example of a cfif-cfelseif-cfelse conditional statement. If the cursor is placed, say at the start tag and if this particular conditional statement has several conditions in it, then on pressing the shortcut key, the next condition in place is highlighted. That is, on placing the cursor at the start of the cfif tag and pressing the shortcut CTRL + SHIFT + DOWN, the next cfelseif condition is highlighted.

Smart Tab Navigation

Smart Tab navigation is about navigating to the next attribute value. The shortcut key for this is CTRL + ]. On pressing the shortcut key, the next attribute value is highlighted. This works in script style code as well, wherein the function arguments are also highlighted.

Jump to matching tag

If you have several nested cfif tags, it becomes very difficult to find out the end of a particular cfif tag. ColdFusion Builder 2.0 provides the shortcut CTRL + ALT + M, which shifts the cursor position to end of the tag. If the cursor is placed at the end tag, then on pressing the same shortcut key the cursor position shifts to the start tag.

Summary:
  • Code Navigation - Navigate to the next function definition or the next condition. Shortcut- CTRL + SHIFT + DOWN \ UP.
  • Smart Tab Navigation - Navigate to the next attribute value or arguments (cfscript). Shortcut- CTRL + ] \ [.
  • Jump to matching tag - Jump to the start or end tag. Shortcut- CTRL + ALT + M.

    Mar 14, 2011

    Tag replace - Actions in ColdFusion Builder

    Tag search is that one powerful feature in ColdFusion Builder 2.0 which allows you to search for tags that match some criteria. Also, there are various actions that the user can perform once the tag is found. Actions such as
    •  'Replacing the tag block' with some text,
    •  'Removing the Tag block', 
    •  'Setting an attribute', 
    •  'Removing an attribute',
    •  'Adding text before the tag block' and
    •  'Adding text after the tag block'. 
    In this post I'll explain how these actions can help you increase your productivity in your day to day application development.

    Action - Setting an attribute

    Consider a use-case where you would like your ColdFusion application to be available to other web clients such as a HTML client or a FLEX client. In these cases you will have to update the cffunction's access attribute to remote. Updating each and every function definition can be a time consuming task. With the action Set attribute one can specify the attribute that you would like to update with the given value:


    As we can see in the above screenshot, a condition 'cffunction tag with attribute access is Any value' is specified (i.e. the tag search engine would search for cffunction tags whose access attribute will be any value). The action selected is Set attribute with attribute access selected with its value set to remote. On clicking 'Replace All', all cffunction tags in the CFC will now have the access attribute set to remote. How easy was that? Gone are the days when you had to go through the entire file and update the tag attributes where ever required.

    If you specify an attribute which doesn't exist, then the attribute would be added to the tag definition. Action Set Attribute is used for both adding and updating the tag definitions.

    Action - Remove attribute

    Action Remove attribute is used to remove an attribute from the tag. So if you would like to remove an attribute, say output attribute of cffunction tag, then select Remove attribute as the action and specify the attribute that you would like to remove:


    Actions - Adding text before and after the tag block

    While editing a CFC containing various cffunction tags, there are times when you would like to add a generic comment before the function definition, stating its description. Also you would want to add a comment stating the end of the function tag block at the end of the cffunction tag. With the new Tag search, you can specify the tag as cffunction and then add a condition (if required) and click 'Add'. Now in the Action list, select Add before Tag and specify the text that you would like to add. In this case, it would be a comment as shown in the picture below:


    Click on Replace All and you will see that the comment is added before the tag block.

    Similarly, in case of Adding text after the tag block, select Add after tag and specify the text that you want to add after the function definition:


    Again, click 'Replace All' to add the comment at the end of every function definition.

    Actions - Replace tag block and Remove tag block


    Other actions provided include Replacing a tag block and Removing a tag block. As the name suggests, on selecting the action Replace tag block, the tag block is replaced with the text that the user has provided:


    Similarly if you would like to remove the tag block, then select the action Remove tag block:


    All the actions mentioned above can be performed in all the scopes. Please refer to my previous post where in I have describe various scopes available for both text and tag search. 

    Mar 12, 2011

    A cheat sheet of keyboard shortcuts in ColdFusion Builder

    In my last post I have explained about keyboard shortcuts in ColdFusion Builder 2.0. This blog post contains a list of all shortcut keys and I have listed these keyboard shortcuts based on the categories that it falls into. Well, this post was not planned since users can easily get to know the keyboard shortcuts by navigating to the preferences (ColdFusion -> Profiles -> Keys). However, I met Joshua at Scotch on the rocks in Edinburgh and he suggested that it would be nice to have the list of keyboard shortcuts handy. So this post is for those who would like to have the list with them and refer it whenever required.


    Keyboard shortcuts for inserting text:

    These are the keyboard shortcuts which are used to insert some text into the editor:

    Command Keyboard shortcuts on Windows Keyboard shortcuts on Mac
    Insert anchor tag CTRL + T, L CMD + T, L
    Insert bold tag CTRL + T, B CMD + T, B
    Insert br tag CTRL + T, R CMD + T, R
    Insert cfabort CTRL + T, A CMD + T, A
    Insert cfdump CTRL + T, D CMD + T, D
    Insert cfscript block CTRL + T, S CMD + T, S
    Insert cfset CTRL + T, = CMD + T, =
    Insert HTML comment CTRL + T, / CMD + T, /
    Insert Italic tag CTRL + T, I CMD + T, I
    Insert nbsp tag CTRL + T, N CMD + T, N
    Insert p tag CTRL + T, P CMD + T, P
    Insert strong tag CTRL + T, K CMD + T, K
    Wrap in ## CTRL + T, H CMD + T, H
    Wrap in cfoutput CTRL + T, O CMD + T, O
    Wrap in try catch CTRL + T, T CMD + T, T
    Wrap/Unwrap in CF comment CTRL + T, M CMD + T, M
    Wrap/Unwrap in CF script comment CTRL + SHIFT + 8 CMD + SHIFT + 8
    Wrap in double quotes CTRL + SHIFT + ' CMD + SHIFT + '
    Wrap in single quotes CTRL + ' CMD + '

    Keyboard shortcuts for invoking wizards:

    There are various wizards in ColdFusion Builder, now you can invoke these wizards using a keyboard shortcut:

    Command Keyboard shortcuts on Windows Keyboard shortcuts on Mac
    Add CF Server CTRL + ALT + W, A CMD + ALT + W, A
    Import CF Project CTRL + ALT + W, I CMD + ALT + W, I
    Launch RDS Query Builder CTRL + ALT + W, R CMD + ALT + W, R
    New CF Project CTRL + ALT + W, P CMD + ALT + W, P
    New CFC CTRL + ALT + W, C CMD + ALT + W, C
    New CFI CTRL + ALT + W, W CMD + ALT + W, W
    New CFM CTRL + ALT + W, M CMD + ALT + W, M
    SQL Editor CTRL + ALT + W, S CMD + ALT + W, S


    Keyboard shortcuts for Extensions:

    Command Keyboard shortcuts on Windows Keyboard shortcuts on Mac
    Import Extension CTRL + SHIFT + E, M CMD + SHIFT + E, M
    Install Extension CTRL + SHIFT + E, I CMD + SHIFT + E, I
    Reload Extension CTRL + SHIFT + E, R CMD + SHIFT + E, R

    Keyboard shortcuts for various Editor features:

    Navigation enhancements:

    Command Keyboard shortcuts on Windows Keyboard shortcuts on Mac
    Go To Next Member CTRL + SHIFT + DOWN CMD + SHIFT + DOWN
    Go To Previous Member CTRL + SHIFT + UP CMD + SHIFT + UP
    Jump To Next Attribute Value CTRL + ] CMD + ]
    Jump To Previous Attribute Value CTRL + [ CMD + [
    Jump to Matching tag CTRL + ALT + M CMD + ALT + M

    Other Editor features:

    Command Keyboard shortcuts on Windows Keyboard shortcuts on Mac
    Launch in External Browser CTRL + ALT + E CMD + ALT + E
    Lowercase CTRL + SHIFT + L CMD + SHIFT + L
    Uppercase CTRL + SHIFT + U CMD + SHIFT + U
    Select Tag Block CTRL + ALT + B CMD + ALT + B
    Toggle Folding at Selection CTRL + ALT + F CMD + ALT + F
    Tag Editor CTRL + SHIFT + T CMD + SHIFT + T

    You can also download the pdf containing this list of keyboard shortcuts from http://tinyurl.com/4uztbe2

    Mar 11, 2011

    Forget the mouse, keyboard shortcuts are here - ColdFusion Builder

    ColdFuison Builder 2.0 is all about productivity, it has introduced a lot of keyboard shortcuts, about 42 of them. Shortcuts have been provided for inserting text, invoking wizards, shortcuts for all new editor features and shortcuts for Extensions. Want to define a keyboard shortcut for a piece of code? Possible. Not only that, you can also Export and Import the keyboard shortcuts, so that you need not redo the task of defining a list of keyboard shortcuts on a different installation.

    What comes with ColdFusion Builder 2.0?

    You get 42 keyboard shortcuts and I know remembering all of these 42 keyboard shortcuts seems to be a daunting task, but the way these keyboard shortcuts have been designed doesn't require you to remember each and every shortcut. The keyboard shortcuts have been grouped into three categories: Insert options, Wizard options and the Extensions options. Each of these categories start with a key combination. For example the Insert options start with CTRL + T and when you press this key a list of keyboard shortcuts will be shown at the bottom right corner of the screen. The same goes with Wizards (CTRL + ALT + W) and Extensions (CTRL + SHIFT + E).

    You can refer to all the keyboard shortcuts by navigating to Windows -> Preferences -> ColdFusion -> Profiles -> Keys.


    This list also includes some special keyboard shortcuts, these are used to perform some specific editor functionality. For example the shortcut key for 'Jump to the matching tag' is CTRL + ALT + M, 'Code Folding' it is CTRL + ALT + F. It is easy remember these as well; M for 'Matching tag' and 'F' for 'Code Folding'.

    Example:
    Press CTRL + T and you should get a list of keyboard shortcuts at the bottom right corner of the screen:


    As you can see the above list shows all the Insert options and all of them start with the key combination CTRL +T. Now to insert say a cfscript tag, press CTRL + T and then press S. Please note it is not CTRL + T + S, one is required to press CTRL + T and then press S. Also, one need not wait for the popup to come up, just press the associated key and the action would be performed.

    It is also possible to change the key binding for any of these keyboard shortcuts. Navigate to the Keyboard shortcut preferences, click on the shortcut key that you want to change and update the key binding in the section below the list.

    Define your own keyboard shortcut

    To define your own keyboard shortcut navigate to the keyboard shortcut preferences and click on 'Add' button. This would enable the section for defining your shortcut key, enter any name, provide a description (not mandatory) and then provide the key binding. If the provided key binding conflicts with any of the key bindings then the conflict section would be shown listing the shortcut keys with which the key binding conflicts. User will not be able to save the shortcut key until the conflicts are resolved. After providing a valid key binding, provide the text that you would like to insert and then click the 'Save' button. This would save the custom key binding and the same would be shown in the list.

    It is also possible to define the cursor position once the text is inserted i.e. while providing the 'Insert text' if one adds the macro $${CP}, the cursor would placed at this position.

    For example, if the 'Insert text' is say

    $${CP}

    and once the text is inserted the cursor would be placed at $${CP}.

    Export and Import Keyboard shortcuts

    If you have defined several keyboard shortcuts, it would be a big pain to do the same on a different installation. However, with the Export\Import functionality one can export the keyboard shortcut definitions to a csv file and import the same in a different installation.

    Mar 9, 2011

    Quick Fix in ColdFusion Builder

    Quick Fix is another interesting feature introduced in ColdFusion Builder 2.0. The CFML Editor now provides corrections to the problems found in the file that you are editing. The Editor tries to resolve the CFCs specified at various places i.e. in createObject function, the new operator or the ones specified in the tags cfinvoke\cfobject. The Editor also tries to resolve the functions using CFC introspection. Now if you have declared a CFC or a function which doesn't exist, then the CFML Editor instead of showing an error in document provides Quick Fix suggestions.


    Quick fix suggestions for components:


    As shown in picture above, the CFML Editor was not able to resolve the component 'Component1' and instead of showing an error, the Editor has shown a yellow marker indicating that a quick fix suggestion is available. On clicking the yellow marker, a list containing suggestions are shown.
    On selecting the first suggestion, the component will be created in the same directory as the cfm file. The user need not invoke the New CFC wizard. Instead, the IDE will create the component on users' behalf. 
    On selecting the second option, the component would be created right under the webroot of the associated server. If the server is not associated with the project, then this suggestion would not be shown.
    The third option would create the component in a directory location specified by the user.

    Similarly quick fix suggestions would be shown for the tags cfinvoke and cfobject. Quick fix suggestions are also shown if the Editor is not able to resolve the components mentioned as attribute values to extends or implements in a cfcomponent tag.

    Quick fix suggestions for functions:

    Quick fix suggestions are also provided for functions which are not defined. Taking the above example, once the component is created and when you try to invoke a function which doesn't exist, then the quick fix will suggest you to create a function. 


    On accepting the suggestion, the function would be created in Component1. 

    If one invokes a function with arguments, then the cffunction with arguments would be created. Say if I invoke a function with two arguments 'arg1' and 'arg2' which are of type numeric and string respectively, then a cffunction would be created with two arguments and the type of those arguments will be numeric and string.   That is, arguments will be of the same type as the parameters passed to the function.
    How cool is that... 

    If you are writing a script style code, then the component or the function would be created in script style syntax.


    Mar 6, 2011

    ColdFusion Builder Search\Replace - A new story

    ColdFusion Builder 2 (codenamed 'Storm') the next version of ColdFusion Builder is now public beta and it comes packed with several new features. One of the highlights of this release is the ColdFusion specific Search and Replace feature; CFB is an Eclipse based IDE and the search\replace functionality provided in the 1.0 version of the product (codenamed 'Bolt') used the Eclipse's search and replace functionality. Storm now comes with a separate engine for Search and Replace.
    One can search not only for text but also tags based on the conditions that you specify. The search scope is now widened and users can search over various scopes such as Open documents, Projects, WorkingsetWorkspace, Local directory, Selected Resources and over any of your FTP\RDS connections. And that's not it, you can also perform certain actions on the matches found. In this post I'll be providing an overview and will try to deliver more complex scenarios in the coming posts.



    The Search dialog:


    The search dialog shown above looks very compact and is packed with features. The scope combo box lists various scopes across which search can be performed, by default the 'Current Document' will be set as the scope. The search combo box lists two options Text and Tag. There is text box for entering the string that you would like to search and a text box to replace the matching string. Also, as noted from the above screenshot there are various options provided to perform search. However, you get more options when you switch to other scopes or when you switch to Tag search.

    Tag search:



    When the search scope is changed to Tag search, the ColdFusion search dialog box changes its layout to provide various options which are relevant to the tag you search. After selecting the tag from the list ('Choose Tag'), there are various conditions that the user can select and add to the list.

    Conditions:

    There are various conditions that you can specify to search for tags. Conditions such as With attribute, Without attribute, Containing (Tag\Text), and Not containing (Tag\Text).

    With attribute:


    When the condition 'With attribute' is selected the dialog box also provides attribute matching conditions 'is\is not\containing\does not contain\starts with\ends with'. User can provide the attribute name and the value for the same. If no conditions are added to the list then the file would be searched for the mentioned tag.

    Without attribute:




    When Without attribute is selected an attribute list is shown and this will match all the tags which do not contain the specified attribute.

    Containing Tag\Text:




    Users can now search tags that contain the specified Tag\Text. An example would be to search for cffunction tags that contain cfargument tags.

    Not Containing Tag\Text:




    Similar to containing; the Not containing condition would select those tags which do not contain the specified text\tag.

    Users can specify multiple conditions for tag search. By specifying Any of the conditions an 'OR' operation would be performed by the tag search engine; meaning that if any of the tags match any of the conditions then it would be returned. Similarly with 'All of the conditions' an 'AND' operation would be performed and only the tags matching all of the conditions would be returned.

    Actions:

    The Action section lists everything that you can do with the tag searched and found. Apart from Replace\Remove the tag block you can perform various other actions such as Add Text Before\After the tag block and Set\Remove the attribute.
    I will be explaining more about Actions in my next blog post.

    Mar 3, 2011

    What's new in ColdFusion Builder Storm- picture

    ColdFusion Builder - Storm is public beta and you can download Storm from labs.adobe.com.
    I just completed my session at SOTR and all the new features are on the picture below:

    Nov 15, 2010

    Speaking at Scotch on the Rocks 2011

    The title says it all. I will be speaking at Scotch on the Rocks (SOTR) conference to be held at Edinburgh, Scotland on March 3rd and 4th 2011. I will talking about the next version of ColdFusion Builder codenamed Storm. The speakers and sessions were announced a month back and I must say the session topics look very impressive. Of course there will be sessions on ColdFusion and related technologies, but one would also get to know more about HTML5, Regular expressions, Software Requirements etc,.

    This is going to be my first ever ColdFusion conference and I'm very excited.

    May 7, 2010

    ColdFusion Builder - A few tweaks

    ColdFusion Builder sometimes might take a lot of time during startup or when a large project is imported into workspace. This post explains how one can change Builder settings to improve the startup experience.

    Server settings:

    If you have added a server to CFB, then you can see at the bottom right corner of the IDE that the CFCs are getting indexed. CFB uses the server settings to provide code assist for datasources, CFCs. This might take a lot of time since it indexes all the files in the webroot. This setting can be disabled in the preferences section. Navigate to Window -> Preferences -> ColdFusion -> Server Settings. Mac users can find Preferences under Adobe ColdFusion Builder (standalone) or under Eclipse (plugin installation).


    CFB indexes all the CFCs located under webroot and mappings directory for the servers defined. By default these options are checked. One can uncheck 'Build server settings' and can observe that the build is not initiated when the CFB is started or when the server is started/added/refreshed. 

    If the webroot or mappings path contain a few files then I would recommend users to keep the default settings  as it is since it would not take much time for the CFCs to get indexed.

    Startup settings: 

    ColdFusion Builder also provides an option of indexing files only in workspace and not the entire server webroot and mappings directory. This can be achieved by unchecking the options available under Server settings page (as explained in the previous section) and enabling 'Build CFCs in project on startup' under Preferences -> ColdFusion -> Startup. By default this is enabled.

    If you are importing a very large project then I would recommend that you disable this option since it might take long time to index these project files. Once the project is imported successfully then enable this option and restart Builder. Indexing large project is always an expensive operation, however if one disables this then the code assist for the CFCs will not be shown.




    Apr 10, 2010

    ColdFusion Builder - Project Support

    ColdFusion Builder is a brand new IDE from Adobe for building ColdFusion applications. ColdFusion Builder is based on Eclipse and can be downloaded from http://www.adobe.com/products/coldfusion/buy/#cfb.

    In this series I will be explaining about creating Projects/Applications in ColdFusion Builder. CF Builder provides wizards for creating projects. It also provides wizards for creating CFCs, CFMs and CF Interfaces. I would like to cover the latter in the next post. In this post I will be explaining the project creation with CF Builder.



    To get started with creating Projects switch to ColdFusion perspective. The project creation wizard can be invoked from four places:

    • Start page -> ColdFusion project.
    • File -> New -> ColdFusion project
    • Clicking New ColdFusion project Icon on the toolbar.
    • Right click Navigator view and select New -> ColdFusion Project.
    The 'New ColdFusion project' page is as shown below:


    Enter your 'Project Name' as say 'ProjectTest'. By default the project location would point to the current workspace location. De-select 'Use Default Location' and specify a location under webroot of your ColdFusion Server in this case it would be 'C:\ColdFusion9\wwwroot\ProjectTest'. Here I have created a folder under  webroot by name 'ProjectTest'. Click on next to continue.

    The Server details page allows the user to associate a server with the project. Once the server is associated with the project Sample URL field will be populated (this is not editable). Therefore make sure you create a project within the webroot of your ColdFusion server. There are various workflows involved in adding a new server/associating a server to the IDE such as adding a remote server, specifying virtual hosts and virtual directory which I would like to cover in coming posts. In this post I will associate the project with an already added server.



    Here I have associated a localhost server whose server home is 'C:\ColdFusion9' and webroot is 'C:\ColdFusion9\wwwroot'. Since the project is under the webroot the Sample URL is populated with 'http://localhost:8500/projecttest'. There is also an option provided for specifying an external browser. The specified external browser would be invoked when the project is run. Click on Next and you will be prompted to specify Linked folder.

    A link folder allows you to associate external files within a project. Say you have created a project outside webroot (c:\NewProject) and would like to make files inside webroot(c:\ColdFusion9\wwwroot\cfc) to be available to this project.


    You can select 'Use Link Folder Name to Resolve CFCs' to see a list of CFCs present in the link directory in content assist. The CFM/CFC files from the webroot can be run within the IDE by switching to one of internal browsers.