The new design elements (everything that you have to edit through Package Explorer) don't have an interface to set template inheritance on them.
You can enable this functionality with a little hack.
Create a view that shows all design elements. Set the first column formula to $Title. This makes it easier to find the design element you're looking for.
Set the $Class field on the design element document to the template you want it to inherit from. You can do this using a formula agent, or a plugin like Formul8.
That's about it. I'm not sure how the refresh task handles compiling of your java code, but since it seems to work when the design task refreshes an entire application from a template, I'm not surprised if everything works as you expect it to do.
Per design element inheritance enables you to have a central repository for things like message bundles. If you want to change a typo in a label (e.g. Adress -> Address), you can change this in the repository, and all applications that "subscribes" to this bundle will be updated with the fix.
Share and enjoy!