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)

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.


IoT & Smart Cities Stories
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
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...
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
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...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities - ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups.
Chris Matthieu is the President & CEO of Computes, inc. He brings 30 years of experience in development and launches of disruptive technologies to create new market opportunities as well as enhance enterprise product portfolios with emerging technologies. His most recent venture was Octoblu, a cross-protocol Internet of Things (IoT) mesh network platform, acquired by Citrix. Prior to co-founding Octoblu, Chris was founder of Nodester, an open-source Node.JS PaaS which was acquired by AppFog and ...
The deluge of IoT sensor data collected from connected devices and the powerful AI required to make that data actionable are giving rise to a hybrid ecosystem in which cloud, on-prem and edge processes become interweaved. Attendees will learn how emerging composable infrastructure solutions deliver the adaptive architecture needed to manage this new data reality. Machine learning algorithms can better anticipate data storms and automate resources to support surges, including fully scalable GPU-c...
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...