Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion, Eclipse

ColdFusion: Article

Making the Switch to CFEclipse to Write ColdFusion Code

When I started writing ColdFusion code, ColdFusion Studio was the editor of choice

I've been using CFEclipse for about four months. When I started writing ColdFusion code, ColdFusion Studio was the editor of choice. Slowly I moved over to Dreamweaver as Homesite's support started to wane.

About a year ago, when I wrote an article on Dreamweaver, I used half of Dreamweaver and half of Homesite. Today, as I write this, half my development is done in CFEclipse and the other half in Dreamweaver. Unfortunately I used Dreamweaver as a really advanced text editor, something it's not that great at. CFEclipse seemed like the obvious alternative so I got it installed and I'm slowly learning its power. The learning curve for CFEclipse has been steep, since, coming from Dreamweaver, its interface is counterintuitive. Assuming that other people are having the same problem, I thought I'd share my thoughts.

Installing CFEclipse
CFEclipse is built on top of Eclipse, the popular Open Source editor used by many Java Programmers. There are plug-ins available for just about anything you could want to do, including Web development, UML modeling, database access, and version control with utilities such as Surround or CVS. CFEclipse is just another plug-in that makes Eclipse operate like ColdFusion Studio/HomeSite+. It has tag insight, color-coding, automatic indentation, and snippets.

Unfortunately, there's no CFEclipse install/setup wizard like you'd find in many other products such as Dreamweaver or ColdFusion. So the first step in setting up CFEclipse is to download Eclipse. First you need to install Eclipse and then you'll have to install the CFEclipse plug-ins. You can download Eclipse from the Eclipse.com web site at www.eclipse.org/downloads/.

Eclipse is unique compared to any other product I've used in having a no-install install. Once you unpack the file you downloaded (I grabbed a Win32 zip, however. tar and gz options also exist), the product is installed. That's all you need to run the program. There are no ini files and no registry installs. You're good to go. I unzipped the zip into a directory called "C:\Eclipse." Click on the eclipse.exe in that directory and this window will pop up similar to Figure 1.

This dialog asks you to select your default workspace. A workspace is how Eclipse manages projects, plug-ins, and other settings. What would you use workspaces for? Perhaps you'll want to set up a workspace for Java development and one for ColdFusion development. Or, perhaps you want a different workspace for each project you're working on. If you like me, you might want a workspace for each client. For purposes of this tutorial, you can use the default settings for your workspace.

The next step is to install the CFEclipse plug-in in your Eclipse workspace. From the "Help" menu, select "Software Updates" then "Find and Install." This will bring up the Install/Update window with two options: Search for updates to current features and Search for new features to install. Select "Search for New Features To Install" and click Next. You should see a screen as shown in Figure 2

Click the New Remote Site button and this window should show up (see Figure 3).

For the name enter CFEclipse. For the URL enter http://www.cfeclipse.org/update. Click OK and CFEclipse should be added to your sites. Make sure to select it and click Finish. CFEclipse will show a new window with all available updates (see Figure 4).

You have two options: either install the latest stable release of CFEclipse or the Bleeding Edge release. The Bleeding Edge release is usually an "in process" version. I prefer to go with the stable releases. Check what you want to install and click Next. Read through the license and click "I accept the terms of the license agreement." Click Next to review your updates. Then click Finish to install. CFEclipse will download. You'll see a feature verification window. (This is your last chance to cancel the install if you're having cold feet). Click Install then Yes to restart the workbench. CFEclipse is installed.

You'll find a much more detailed account of this install process in the ACME Guide located at www.stephencollins.org/acme/. ACME stands for Apache, ColdFusion, MySQL, and Eclipse and talks about setting up all them in a development environment.

Setting up a Project
Now that CFEclipse is installed, the interface doesn't look any different, does it? Nope, the interface doesn't look any different (yet). From the window menu, select Open Perspective and other. CFEclipse should be in the list of perspectives. Select it. A perspective is the default layout for your workspace.

In my Dreamweaver article, I talked about setting up a site. You'll probably want to do the same thing in CFEclipse. In CFEclipse, a project is the equivalent of a Dreamweaver site. This is how you can set it up:

1.  While in the CFEclipse Perspective, select File‡ New ‡ Project. You'll get a list of all available project types as shown in Figure 5. Expand CFEclipse and then select "CFML Project." Click Next (see Figure 5).

2.  This puts you in the new Project Dialog. Give the project a name and specify its directory location. Most likely you're going to be starting a new project so feel free to use the default directory, which points to the workspace directory. Click Finish. Now the project is created.

3.  CFEclipse isn't as full-featured in its project settings as Dreamweaver, but there are a few that you may want to make note of. In the navigator on the left side of the screen, you should see the name of the project and a list of all files/directories that are part of the project. Right-click on the project name and select Properties. Select CFEclipse properties and you should see something like Figure 6.

This will let you specify the project URL and the path to your snippet directory. If you're using different workspaces, but want to share snippets, you can do so here. You can also enter the docroot, which refers to the browser view, an option underneath the code view. If you want a quick browse of the files in your project, this is the way to do it without switching to a different window.

Dealing with Components
It seems that with every passing day I spend more and more time dealing with CFCs, either creating them or editing them. The CFEclipse creators didn't let me down in that regard. They have a few handy tools for creating and using components. This is how to use the wizard for creating a component:

  1. From the file menu, select "New‡ Project." From the project menu (see Figure 5) select CFC. You'll get the New Component wizard in Figure 7.
  2. Enter the path for the component, the component it extends, the hint, and the display name. Click Next.
  3. You can add properties (a k a Instance Variables) to the component in the next window. You can specify various options including the option to generate getter and setter methods, the hint, and the type.
  4. Click Next and you can add Functions to the component in this window. You can also specify each attribute in the component tag, such as access, return type, roles, hint, displayname, name, and output. Click Next.
  5. In this step you can add parameters to each function you have in the component. Click Finish to create the component.
Let's examine a few of the other windows in your workspace. Open up a CFC file. (I opened the address.cfc from my December '04 article for this column). In the right half of the screen you'll see a method view, which should look something like Figure 8.

This is a nice quick outline of all the methods in your CFC. If you double-click on one of the methods, you'll jump right to its place in the component. This can be handy when jumping around long components. The Method view won't work on a regular cfm file even if you have functions inside it, however, the outline view will. The outline view gives you a collapsible hierarchical view of your files.

Miscellaneous Features
There are a bunch of things about CFEclipse that make it a joy to work with. None of these things are so amazing that they'll make you want to switch from another editor, however if you do switch I'm sure you'll find them useful.

  • Snippets: CFEclipse has snippets. They are very similar to HomeSite-style snippets. My favorite feature here (something lacking in Dreamweaver) is that you can insert snippet variables such as the current date and time inside a snippet. You can read more details about it at the CFEclipse web site www.cfeclipse.org/index.cfm?objectid=C1F58502-EA69-0EC7-FF3FD40329552407.
  • Parenthesis Marking: When dealing with nested function calls or complicated SQL queries, you'll often end up with a lot of parenthesis. When your cursor is at one parenthesis, its foil will be highlighted so you can see the order of operations grouping. This is extremely useful.
  • Problems Tab: CFEclipse will point out some syntax errors (such as a missing end tag) and mark them visually and in the problems tab at the bottom of the screen. I hope that future versions will advance this feature, creating a CF pseudo-compiler that will catch syntax errors.
  • Task List: CFEclipse includes a simple task manager right in the IDE. In the middle of one thing you probably don't want to stop to fix another. So just make a quick note to come back to it.
  • Search and Replace: The multiple file search and replace feature is a great way to search through all the files in your project. You can get a flat list of results like with Dreamweaver or a hierarchical list sorted like the file structure. When you open a template that has search results, CFEclipse will visually highlight those features with a bullet next to the scroll bar.
  • Hiding Panels: By clicking the square in the top right corner of a panel, CFEclipse will expand any panel to the full size of the screen. I use this a lot to expand the code view.

Final Thoughts
CFEclipse isn't perfect yet. (Is anything ever perfect?) But it sure stands out as a quick editor that's not a resource hog. I found it does almost everything I need. And hey, it's free. It's really hard to beat free. Check it out at www.cfeclipse.org.

More Stories By Jeffry Houser

Jeffry is a technical entrepreneur with over 10 years of making the web work for you. Lately Jeffry has been cooped up in his cave building the first in a line of easy to use interface components for Flex Developers at www.flextras.com . He has a Computer Science degree from the days before business met the Internet and owns DotComIt, an Adobe Solutions Partner specializing in Rich Internet Applications. Jeffry is an Adobe Community Expert and produces The Flex Show, a podcast that includes expert interviews and screencast tutorials. Jeffry is also co-manager of the Hartford CT Adobe User Group, author of three ColdFusion books and over 30 articles, and has spoken at various events all over the US. In his spare time he is a musician, old school adventure game aficionado, and recording engineer. He also owns a Wii. You can read his blog at www.jeffryhouser.com, check out his podcast at www.theflexshow.com or check out his company at www.dot-com-it.com.

Comments (4) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
Carlos Corredor 04/18/06 09:14:35 PM EDT

As a result of reading your article, I downloaded and installed Eclipse. It looks like the CFEclipse HELP does not contain anything. Is this correct? or did I do something wrong? I tried finding this information in eclipse.org, but no luck. If you have time, could you please give me some ideas on this? Thank you, Carlos

Kris 04/14/06 09:25:46 AM EDT

I think figure 6 should point to something else. Houser-fig-6.gif and Houser-fig-4.gif are the same image (just has different title).

SYS-CON India News Desk 04/12/06 06:11:04 PM EDT

About a year ago, when I wrote an article on Dreamweaver (http://coldfusion.sys-con.com/read/48232.htm), I used half of Dreamweaver and half of Homesite. Today, as I write this, half my development is done in CFEclipse and the other half in Dreamweaver. Unfortunately I used Dreamweaver as a really advanced text editor, something it's not that great at. CFEclipse seemed like the obvious alternative so I got it installed and I'm slowly learning its power. The learning curve for CFEclipse has been steep, since, coming from Dreamweaver, its interface is counterintuitive. Assuming that other people are having the same problem, I thought I'd share my thoughts.

SYS-CON Brazil News Desk 04/12/06 04:26:01 PM EDT

About a year ago, when I wrote an article on Dreamweaver (http://coldfusion.sys-con.com/read/48232.htm), I used half of Dreamweaver and half of Homesite. Today, as I write this, half my development is done in CFEclipse and the other half in Dreamweaver. Unfortunately I used Dreamweaver as a really advanced text editor, something it's not that great at. CFEclipse seemed like the obvious alternative so I got it installed and I'm slowly learning its power. The learning curve for CFEclipse has been steep, since, coming from Dreamweaver, its interface is counterintuitive. Assuming that other people are having the same problem, I thought I'd share my thoughts.

IoT & Smart Cities Stories
CloudEXPO | DevOpsSUMMIT | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
DXWorldEXPO LLC announced today that Big Data Federation to Exhibit at the 22nd International CloudEXPO, colocated with DevOpsSUMMIT and DXWorldEXPO, November 12-13, 2018 in New York City. Big Data Federation, Inc. develops and applies artificial intelligence to predict financial and economic events that matter. The company uncovers patterns and precise drivers of performance and outcomes with the aid of machine-learning algorithms, big data, and fundamental analysis. Their products are deployed...
All in Mobile is a place where we continually maximize their impact by fostering understanding, empathy, insights, creativity and joy. They believe that a truly useful and desirable mobile app doesn't need the brightest idea or the most advanced technology. A great product begins with understanding people. It's easy to think that customers will love your app, but can you justify it? They make sure your final app is something that users truly want and need. The only way to do this is by ...
Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
The challenges of aggregating data from consumer-oriented devices, such as wearable technologies and smart thermostats, are fairly well-understood. However, there are a new set of challenges for IoT devices that generate megabytes or gigabytes of data per second. Certainly, the infrastructure will have to change, as those volumes of data will likely overwhelm the available bandwidth for aggregating the data into a central repository. Ochandarena discusses a whole new way to think about your next...
Cell networks have the advantage of long-range communications, reaching an estimated 90% of the world. But cell networks such as 2G, 3G and LTE consume lots of power and were designed for connecting people. They are not optimized for low- or battery-powered devices or for IoT applications with infrequently transmitted data. Cell IoT modules that support narrow-band IoT and 4G cell networks will enable cell connectivity, device management, and app enablement for low-power wide-area network IoT. B...
The hierarchical architecture that distributes "compute" within the network specially at the edge can enable new services by harnessing emerging technologies. But Edge-Compute comes at increased cost that needs to be managed and potentially augmented by creative architecture solutions as there will always a catching-up with the capacity demands. Processing power in smartphones has enhanced YoY and there is increasingly spare compute capacity that can be potentially pooled. Uber has successfully ...
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...