Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6204301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:04:02+00:00 2026-05-24T05:04:02+00:00

As I slowly crawl in my transition from .net to Java, I find more

  • 0

As I slowly crawl in my transition from .net to Java, I find more and more interesting things about the eclipse IDE. I recently stumbled upon its templates and I’m loving it. Which brings me to a question: can I call a template from within a template? Of course it would be merely a copy and paste matter, but I’m wondering if it can be done.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:04:02+00:00Added an answer on May 24, 2026 at 5:04 am

    Yes, actually, you can and there is an example right in the default set.

    If you go to your Preferences -> Java -> Code Style -> Code Templates, you can Export All of the provided Java templates. In there you will see the following File template (formatted for readability):

    <template 
        autoinsert="true" 
        context="filecomment_context" 
        deleted="false" 
        description="Comment for created Java files" 
        enabled="true" 
        id="org.eclipse.jdt.ui.text.codetemplates.filecomment" 
        name="filecomment">
        /** * */
    </template>
    

    and a bit further down, the New Type which makes use of that File template:

    <template 
        autoinsert="true" 
        context="newtype_context" 
        deleted="false" 
        description="Newly created files" 
        enabled="true" 
        id="org.eclipse.jdt.ui.text.codetemplates.newtype" 
        name="newtype">
        ${filecomment} ${package_declaration} ${typecomment} ${type_declaration}
    </template> 
    

    So, if you’d like to make a template use another, the basic form is to refer to the id of your sub-template with the dollar sign prefix. For example:

    <template 
        autoinsert="true" 
        context="BobOuter_context" 
        deleted="false" 
        description="Bob example outer template" 
        enabled="true" 
        id="bob.example.outertemplate" 
        name="BobOuter">
        BobOuterBegins Insert inner template ${bob.example.innertemplate} BobOuterEnds
    </template> 
    
    <template 
        autoinsert="true" 
        context="BobInner_context" 
        deleted="false" 
        description="Bob example inner template" 
        enabled="true" 
        id="bob.example.innertemplate" 
        name="BobInner">
        BobInnerBegins Super awesome content goes here BobInnerEnds
    </template> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am slowly moving into Silverlight from asp.net and have a question about how
I am learning Java (slowly) from the ground up, but every now and again
I am slowly getting more serious about Core Animation and would greatly appreciate an
I have an app that is slowly being upgraded to MVC (MVC.net?) from ASP.net.
I am slowly porting over an app from MySQL to use Linq2Sql - but
I'm slowly getting into MVC, but it's still relatively new to me. From what
I would like to have the navigation bar hide more slowly than usual. I
I have a page that renders slowly. The trip across the net is quick.
I am slowly learning how to use Reactive Extensions for .NET with WPF. There
i'm slowly making my way over to Flash Builder from doing all of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.