engtuncay
engtuncay

Reputation: 877

How can i add template context in eclipse

In eclipse , there are standard contexts for editors. For java editors, there are java , java statements, java type members...

Is there anyway to add new context in templates ?

template view

Upvotes: 0

Views: 384

Answers (1)

greg-449
greg-449

Reputation: 111142

You can add contexts but only by writing an Eclipse plugin. The org.eclipse.ui.editors.templates is used to do this with the contextType element.

For example the 'Java' context is defined using:

<extension
     point="org.eclipse.ui.editors.templates">
  <contextType
        name="%templates.java.contextType.name"
        class="org.eclipse.jdt.internal.corext.template.java.JavaContextType"
        id="java"
        registryId="org.eclipse.jdt.ui.CompilationUnitEditor">
  </contextType>

Upvotes: 1

Related Questions