Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Custom shortcut keys
Custom shortcut keys [message #260946] Mon, 12 July 2004 20:33
Eclipse UserFriend
I'm working on a ColdFusion editor plugin (http://cfeclipse.tigris.org)
where we have the concept of snippets of code that can be inserted into a
document.

The current prevailing ColdFusion editors (Dreamweaver and HomeSite) allow
you to assign a keyboard shortcut to a snippet. This is very convenient for
snippets of code that you use regularly since you can also define snippet
variables that you insert at runtime.

An example of this is the snippet below:

<cffunction name="get$${property}" access="public" returnType="$${type}"
output="false">
<cfreturn variables.instance.$${property} />
</cffunction>

<cffunction name="set$${property} access="public" returnType="void"
output="false">
<cfargument name="$${property}" required="true" type="$${type}" />
<cfset variables.instance.$${property} = arguments.$${property} />
</cffunction>

Here you would be prompted for the name of the property and it's type. The
snippet variables would be inserted and you would quickly have a pair of
accessor/mutators for a bean.

Now, a number of users of the plugin have requested that they can assign
keyboard shortcuts to snippets. This makes perfect sense in the context of
the above snippet and how a lot of code is written in ColdFusion, but I'm
unsure of the best way to implement it.

Has anyone else implemented custom keyboard shortcuts that allow the user
to insert a snippet of code rather than call an action?

Given that there isn't really a limit to the number of snippets a user
could have, or how many of them the user would like to assign to a key
sequence, I think I'll have to write something that will intercept every
keystroke combination and either ignore it or act upon it based on what the
user has set up.

Any suggestions appreciated.

Spike


--
--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk
Previous Topic:debug applet in Eclipse?
Next Topic:Implement a Progressbar for a DOS command
Goto Forum:
  


Current Time: Sun Jul 20 23:59:32 EDT 2025

Powered by FUDForum. Page generated in 0.04916 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top