3

I am not sure if this question gets closed but looking for shortcuts in Force IDE similar to what we have in Java. https://stackoverflow.com/questions/1028858/useful-eclipse-java-code-templates

I am sure people who are working on salesforce for a long time would definitely have some templates.

Please share with us and it definitely helps people like me who are new and coming from Java background.

9
  • 2
    I'm not sure about the Force.com IDE, but I know MavensMate has a selection of templates. MavensMate-Templates Commented Aug 20, 2015 at 19:51
  • @DanielBallinger , Thanks for the link. I used Mavensmate IDE for a week but the saving file to the server was very painful. At time it would take around 5 mins..I wish we had all these features in Force IDE.
    – javanoob
    Commented Aug 20, 2015 at 20:02
  • @javanoob Most people see better performance with recent MavensMate than the Force.com IDE. And it looks like MavensMate has succeeded in attracting a community who contribute templates but the Force.com IDE has not. So I suggest you take another look at MavensMate.
    – Keith C
    Commented Aug 20, 2015 at 23:44
  • @KeithC I have used both MavensMate and Eclipse Force.com IDE for a while, and I am still using both for daily work. Considering the speed of compilation and refreshing from server, MavensMate is no comparison to Force.com IDE. I would say the success of MavensMate is the success of Sublime, not itself.
    – Lance Shi
    Commented Aug 20, 2015 at 23:52
  • @KeithC Are you not facing this problem github.com/joeferraro/MavensMate/issues/478 --Actually this led me to use ForceIDE
    – javanoob
    Commented Aug 21, 2015 at 1:08

3 Answers 3

2

Hope that it will help developers how want create custom Apex templates in Eclipse IDE.

Currently the Salesforce Plugin for Apex Provides you with:

  • ApexClass-Default
  • ApexClass-Inbound_Email_Service
  • ApexClass-Test_Class

You can add your custom template to the above list and it shows up, its simple:

  1. Navigate to the Eclipse Installation Folder –> Configuration –>org.eclipse.osgi . Search for .template. You can see the files listed above.
  2. Open any of the ApexClass* file using your fav text editor.
  3. Modify the file. Add custom comments , descriptions etc.
  4. Save the file as ApexClass-.template.
  5. Restart your Eclipse.
2

Based on the comment chain, I don't believe the Force.com IDE currently has Apex Code Templates.

I do know that MavensMate in sublime has templates when creating new components. See MavensMate-Templates.

1
  • Looks like I had tooling api turned off in my mavensmate..now after turning on the save time is greatly improved also I see there are so many other cool features in mavensmate..I am loving it! and no more feel like coding in EditPlus :)
    – javanoob
    Commented Aug 26, 2015 at 20:37
0
  • Go to File -> New -> Apex Class
  • Select a project and Choose a class name and click Next>
  • You'll see the following: "Templates are 'New Class' templates found in the Apex Editor Templates preference page."On the bottom of the pop-up window.
  • Click on Apex Editor Templates
  • The Templates preference window pops up and here you can create your new templates, modify existing one or delete them.

Enjoy!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .