You need to sign in to do that
Don't have an account?

APEX and Eclipse (Force IDE) - Snippets Panel?
I was just at the Tour de Force - I saw the "Build any UI for Any App
Using Visualforce" demo and I'm wondering: how did the presenter store those code snippets? He was dragging and dropping them in, it looked like the library was inside Eclipse.
I've seen the Snippet window in Elicpse, but it looked like he was accessing a prebuilt library of snippets. I'd love to be able ot store my own code blocks, but I couldn't figure out how.
If anyone knows how to add them, I'd appreciate it (meanwhileI'll go search Eclipse's site)
Thanks
[Update]
Okay - I've managed to figure out that I needed to add a "category" to the Snippet window, then I can add items. I just added a new item and put the snippet code I want handy into the "template" text area and it seems to work.
Is there any reason to use the 'variables' options when adding a new 'template'? Thanks again!
Message Edited by icemft1976 on 04-24-2008 02:16 PM
I've seen the Snippet window in Elicpse, but it looked like he was accessing a prebuilt library of snippets. I'd love to be able ot store my own code blocks, but I couldn't figure out how.
If anyone knows how to add them, I'd appreciate it (meanwhileI'll go search Eclipse's site)
Thanks
[Update]
Okay - I've managed to figure out that I needed to add a "category" to the Snippet window, then I can add items. I just added a new item and put the snippet code I want handy into the "template" text area and it seems to work.
Is there any reason to use the 'variables' options when adding a new 'template'? Thanks again!
Message Edited by icemft1976 on 04-24-2008 02:16 PM
Thanks! I got that to work. I was having issues with the software updates in Eclipse but once I got around it was able to get the snippets as you said.
All Answers
As usual - I just needed to dig around a bit :)
If you edit your existing snippet: create a new variable and input a value (say 'Status', 'Closed') - Eclipse then displays an option button to 'Insert variable placeholder' into your code. You can then use the 'insert' button to insert the variable in the appropriate locations of your code snippet.
I imagine the variables option would be useful if you were looking to paste a template, more than just a code block, but it does give you a nice ability to update your snippets on the fly -> b/c when you drag and drop a snippet in, Eclipse lets you edit the variable values (or just paste the code as is)
Hi,
it's part of an add-in package called 'Web Tools'.
this blog post describes how to add it to Eclipse if you don't have it. (It also shows another tool that provides more advanced capabilities to make handy tools for Eclipse & looks pretty useful - but I haven't tried it).
You might have the package already in your Eclipse build though, follow the instructions but check your 'update' tab (as opposed to the 'available software' tab) to see if you already have an entry under "WST ...."
Note that the current version of the package appears as Web Tools -> Web Tools Platform (WTP) 3.1.x in the 'available software' tab.... but the steps are the same.
After it's installed - you open the Snippets panel by going to Window->Show View->Other->General->snippet
Good luck!
Thanks! I got that to work. I was having issues with the software updates in Eclipse but once I got around it was able to get the snippets as you said.