Using Filters to control your menu contributions

Author: sandeepp  |  Category: ColdFusion Builder, Extensions, General  |  Comments (0)  |  Add Comment

ColdFusion Builder Extensions allow you to add filters to menu contributions . With this you can control what menus are visible/hidden when the context menu is displayed.

Filter’s can be used for menu contributions to navigator and outline view.

Adding Filters to Menus:

For Navigator you may want to use filter to control menu contributions appearing when user tight clicks a project|folder|file or a file with given name or extension.

For ex. following menu will appear only when user right clicks a project

<menu name="Deploy">
<filters>
<filter type="project" />
<filters>
</menu>

and following menu will appear only when user right clicks a file with name “modelGlue.xml”

<menu name="Validate Config File">
<filters>
<filter type="file" pattern="modelGlue.xml" />
<filters>
</menu>

For outline view you can control for which nodes menu contribution can appear.

For Ex. Following menu will only appear when user clicks on node named “Events” in outline view.

<menu name="Add Event">
<filters>
<filter type="Events" />
</filters>
</menu>

Adding filters for Menu Actions:

Sometimes you may want to show the Menu every time, but may want to hide/show menu actions based on what user has clicked on. This can be achieved by adding filters at action level and not at menu level. So menu will appear all time but, display of individual menu items will be controlled by filters applied on menu action. Here’s an example

<menu name="ModelGlue Assistant">
<action name="Add Controller" handlerid="handler1" >
<filters>
<filter type="controllers" /> <!-- action appears only when user right clicks controllers node -->
</filters>
</action>
<action name="Add Message Listener" handlerid="handler2" >
<filters>
<filter type="controller" /> <!-- action appears only when user right clicks controller node -->
</filters>
</action>
<action name="Remove" handlerid="eventhandler" /> <!-- action appears for all nodes -->
</menu>

Here are the Screen shots for above code-

Above images show the working Action Filters. Here Menu and remove action appear at all places but other actions are controlled by filters.

Adobe ColdFusion Builder - File encoding support

Author: sandeepp  |  Category: ColdFusion Builder, Preferences  |  Comments (0)  |  Add Comment

Adobe ColdFusion Builder by default treats CFML file content as UTF-8 encoded. So when you look at properties of cfm file and it will show encoding as default UTF-8 (determined by content).

This post tells you how to configure Adobe ColdFusion builder to support different file encoding. This is useful when you have CFML files which have encoding other than UTF-8.

So here are the steps -

1) Navigate to preferences->General->Content types page

2) On this page expand Text node and select CFML source file.

3) Once selected, default encoding text field will show “UTF-8″ as default encoding for CFML content.

4) Change this to any desired encoding type and click update button next to this field.

5) Click OK.

6) Reopen file in editor.

Following is screen shot of how to change this preference setting-

Encoding preference

Now file properties will show files encoding as set by user, and file content will be shown properly in editor based on set encoding.

Some useful Keyboard shortcuts

Author: sandeepp  |  Category: ColdFusion Builder, Preferences  |  Comment (1)  |  Add Comment

Here are few useful editor shortcuts when using ColdFusion Builder

  • Toggle between source and preview tabs
              Press Ctrl+Page Down to navigate to next tab
               (eg. from source to preview)
              Press Ctrl+Page up to navigate to previous tab
              (eg. from preview to source)
  • To navigate between all open documents in editor
             Press Ctrl+F6. Keep Keys pressed and select any open file with
             arrow keys or using mouse.
            Or alternatively Press Ctrl+E to get drop down list of open files
            to select from. If this list is too big, you can just type first
            few letters of file name and the list will get filtered automatically.
  • To quick select any currently open View
           Press Ctrl + F7. Keep keys pressed and select available views through
           arrow keys or using mouse.
  • Quick Outline view
           Press Ctrl+O to get quick outline view for cuttently open document.

At any time you want to change these default keys, you can do this via Preferences->General->Keys preference page.

ColdFusion Builder Extensions Tutorial - Part 2 - Adding context menus

Author: sandeepp  |  Category: ColdFusion Builder, Extensions  |  Comments (0)  |  Add Comment

This post from me comes a little delayed than i would have liked, but all I can say is that some cool stuff for ColdFusion Builder has been keeping me busy ;).

So to get started I will cover how to add custom context menu to different views in ColdFusion Builder in this post. Supported views include

1) Project Navigator

2) Outline view

3) RDS Data View

One good way to learn how to add custom menu is to try this out on currently available extensions. For this post I will assume you have already installed Adobe CFC generator.
All you need to do is modify ide_config.xml file (Once you install an extension, config file is placed in install location/<extension name> folder.)

Once you locate ide_config.xml at extension install location, open ide_config.xml file for editing.
Now add following entry directly under <menu name=”Adobe CFC Generator”>

<action name=”hello” handlerid=”helloworld” showResponse=”yes” />

Save the file.

Navigate to Preferences->ColdFusion->Extensions page. Click on Reload Extensions button. This will make ColdFusion Builder reload the currently modified config file and reflect you current changes.

Now when you right click any table on RDS data view, this newly menu will appear under Adobe CFC generator menu.

Once you add menu you want to be able to do stuff when users clicks on it.
to achieve this, again open ide_config.xml and add following entry inside “<handlers>” node.

<handler id=”helloworld” type=”CFM” filename=”helloworld.cfm” />

Now create “helloworld.cfm” file under handlers directory, with content <cfoutput>Hello World</cfoutput>.

Reload extensions again, and this time once you click newly added menu, a dialog will come up showing response from helloworld.cfm.

That’s it you have successfully add custom menu in ColdFusion Builder and handled click event on it.

ColdFusion Builder - HTML Colorization

Author: sandeepp  |  Category: ColdFusion Builder, Colorization  |  Comments (3)  |  Add Comment

In ColdFusion Builder HTML colors can be customized through Preferences->HTML-Editors->HTML->Colors preference page.

HTML colorization affects all HTML tags in a generic way and to set color for individual tags (like Table or Form tags) is not possible.

Here is colorization file to change HTML colors similar to that of Dreamweaver. Since all Dreamweaver colorization option are not exactly mapped to HTML colorization, it tries to match Dreamweaver html colorization as much as possible.

To use this navigate to HTML color preferences and click import button. Point ColdFusion Builder to this .col file and hit apply. That’s it!!

Understanding Default colorization for HTML Tags:

By default angular Braces for HTML tags are colorized differently than tag name. Apart from these most options are straight forward, and should be easy to change through HTML Color Preferences.

Here is how you customize colorization for angular braces around html tags.

1) Select HTML->Editors->HTML->Colors in preferences
2) Expand “Punctuator” node, Select Start Tag.
3) With Start Tag entry selected expand region colorization section below.
4) Change two entries “Tag_part” and “Name_part” to color of your choice.
5) Click apply to notice changes in any currently open file with html code.

Follow similar steps for “Punctuator” End tag entry to colorize html end tag.

Understanding  region colorization:

Regions are used to further break down any known token into number of parts. For eg.  for start tag (”<table>”) you can define 3 different regions as “<” , “table” “>” and colorize them differently.
Any tag with defined region for them have a small bar in front of their entry in token section.
Attached is screen shot which shows start tag with region colorization defined for it.
Also notice small bar in front of start tag to indicate the same.

Show/Hide Whitespace Characters

Author: sandeepp  |  Category: ColdFusion Builder, Preferences  |  Comments (0)  |  Add Comment

Display of whtiespace characters in ColdFusion Builder can be easily switched on/off by hitting “Ctrl+.”(Control and dot).Below screenshow shows cfm file opend in editors with whitespace characters being displayed.

Also which characters are displayed in place of whitespace characters can be customized via Preferences->HTML->Editors page. Assign any desired characters in corresponding fields inside whitespace markers group.

Check below screenshot

ColdFusion Builder - Editor Profiles

Author: sandeepp  |  Category: ColdFusion Builder, Preferences  |  Comments (0)  |  Add Comment

Editor Profiles (Found under Preferences->ColdFusion->Editor Profiles) are meant to group all editor preferences under one set and save them all for future use.This allows users to create different profiles for different editor preferences and allows one click applying of all your favorite editor preference settings.

So what you can do is set individual editor preferences like colorization, keyboard shortcuts and code assist preferences etc. for a particular style of coding/editor use. Now once done, navigate to “Editor Profiles” preferences page and save them all as a set by creating a new profile. This newly created profile will save current values of all editor preferences. Following editor preferences are saved as profiles

1) ColdFusion->Editor Profiles-> Editor

2) Code Assist

3) Colors

4) Keys

5) Outline

6) Syntax checking

7) Typing

You can make any changes to editor preferences and whenever you want all your favorite settings back, all you have to do is, open editor profiles, select your previously saved profile and hit apply. This will set all editor preferences to values they had when you created this new profile. This can be very useful when you want to have different editor preferences for different kind of development needs.

ColdFusion Builder has three profiles created by default. They are

a) Default - sets all editor preferences to ColdFusion Builder defaults

b) Dreamweaver - sets all editor preferences similar to Dreamweaver (as applicable)

c) CFEclipse- sets all editor preferences similar to CFEclipse (as applicable)

Easy Access to Editor preferences

Author: sandeepp  |  Category: ColdFusion Builder, Preferences  |  Comments (0)  |  Add Comment

An easy way to access editor preferences is through editor’s context menu, i.e. just right click on editor while editing any CFM CFC files, and select “preferences” menu option it will take you to CFML Editor’s preferences.

This also works for any editor in general, so for eg. if you are editing HTML files, “preferences” option in editor’s context menu will take you to HTMl Editor Preferences.

So if you change preferences quite often, this might be useful to you, especially if you are new to eclipse platform and find it difficult to access editor preferences through windows menu (Windows->Preferences-> …).

ColdFusion Builder Extensions Tutorial Part I - Introduction

Author: sandeepp  |  Category: ColdFusion Builder, Extensions, General  |  Comments (0)  |  Add Comment

As I had said in my previous post that I will post a series of articles on extensions covering basics, tips and tricks etc, so here’s my first one.  This articles introduces you to ColdFusion Builder Extensions, explains what are they, what all is possible, where to find extensions etc.

First things First

What Are ColdFusion Builder Extensions?

Well in very simple words, extensions allow you to extend ColdFusion Builder by writing CFML code. Yes, that’s right CFML!!!….no java…no need to learn eclipse..just CFML code and a bit of XML. All this (CFML code and XML configuration file) can be packaged as ready to use zip file. This zip is what you can install/distribute as extension for ColdFusion Builder.

What all you can do with extensions?

Through extensions, ColdFusion Builder lets you hook into it in different ways. This means that you can tie specific CFML code to a given hook. To tell ColdFusion Builder to tie a hook to a specific CFML template you need to XML configuration file. Broadly there are two type of hooks

1) Hooks to Add Context Menus to different views inside ColdFusion Builder. Context menus are the pop-up menus which appear when you right click on a selected object/UI element etc. This can be useful to address code generation/analysis use-cases specific to a Framework or application development in general.

Context menus can be added to following views as of now

  • Navigator View
  • RDS Data View
  • Outline View

2) Hooks for Listening to Events inside ColdFusion Builder

  • Currently Project creation event is supported. This means that specific CFML code can be called whenever user creates a new project in ColdFusion Builder. This can be useful in creating default project templates, basic application code, Framework specific directory structure etc.

Are there any extensions available as of now?

Adobe ColdFusion Builder ships few extensions which can be location in <ColdFusion Builder install Dir>/extensions. These include extensions to generate basic as well as ORM  CFCs and Action script classes from database tables. Also a basic extension for Model-Glue Framework. And there quite a few exciting extensions already available on RIAForge under ColdFusion Builder Extensions category.

So go ahead and try out a few of them.

Hope this post clears your basic question about ColdFusion Builder extensions. Next post I will cover how you can add a context menu and hook it to cfm file.

ColdFusion Builder Comment Colorization

Author: sandeepp  |  Category: ColdFusion Builder, General  |  Comments (2)  |  Add Comment

Default colorization for ColdFusion Builder beta does not have background color set for comments. I guess lots of Dreamweaver users are used to having comment background colorized. Here’s a quick solution for that.

1) Open Editor Color Preferences(Window->Preferences->ColdFusion->Editor Profiles->Editor->Colors)

2) Click import and point to this colorization file

3) Click Apply. That’s it!!!…you are done.

Now, if you are wondering what this colorization file is, and are interested to know about it  then keep reading.

Colorization file is an xml file, which tells ColdFusion Builder how to colorize CFML. This can be created by exporting your current colorization settings.

Once you open this file you will see styles assigned for different CFML tokens.

For eg. <style foreground=”rgb(0,0,192)” id=”KEYWORD”/> meaning create style with id KEYWORD with assigned RGB colors.

Now this style can be applied to any category or token as below

<category name=”KEYWORD” style=”KEYWORD”/>

this means all keywords are styled with style identified with id “KEYWORD”.

So you can have your own custom style created and assigned to available token or categories.

Note:In preference UI only style options available are to change foreground colors and text style as(Bold/Italic/Underlined).

To change background color, as in case of comments, this has to be put in colorization file and imported back to apply.

Here’s how you assign background color for comments

create style for both background and foreground color

<style background=”rgb(255,255,153)” foreground=”rgb(0,0,0)” id=”WHITESPACE_COMMENT”/>
assign it to comment token as

<category name=”WHITESPACE” style=”WHITESPACE”>
<token style=”WHITESPACE_COMMENT” type=”COMMENT”/>
</category>

So if you need to change comment background color, just assign corresponding RGB value to the color you want to set in comment style and import your colorization file again.