Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2012-10-01 17:16:24 -0400
committerLars Vogel2012-10-01 17:17:40 -0400
commit851aa0c97bf1cfca79ce2312ce9d23394a718237 (patch)
tree51d00d31e14793e630a57ed49e8efbd6a8999b62
parent6d2199da1ec8874389465a6390ac09b1661fbf8c (diff)
downloadorg.eclipse.e4.tools-851aa0c97bf1cfca79ce2312ce9d23394a718237.tar.gz
org.eclipse.e4.tools-851aa0c97bf1cfca79ce2312ce9d23394a718237.tar.xz
org.eclipse.e4.tools-851aa0c97bf1cfca79ce2312ce9d23394a718237.zip
Cleanup of the e4 code templates
-rw-r--r--bundles/org.eclipse.e4.tools.jdt.templates/plugin.xml23
-rw-r--r--bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.properties0
-rw-r--r--bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.xml27
3 files changed, 28 insertions, 22 deletions
diff --git a/bundles/org.eclipse.e4.tools.jdt.templates/plugin.xml b/bundles/org.eclipse.e4.tools.jdt.templates/plugin.xml
index 2a4f1536..30b8ff7f 100644
--- a/bundles/org.eclipse.e4.tools.jdt.templates/plugin.xml
+++ b/bundles/org.eclipse.e4.tools.jdt.templates/plugin.xml
@@ -38,8 +38,7 @@
registryId="org.eclipse.jdt.ui.CompilationUnitEditor">
</contextType>
<include
- file="templates/default-e4templates.xml"
- translations="$nl$/templates/default-e4templates.properties">
+ file="templates/default-e4templates.xml">
</include>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.FieldResolver"
@@ -51,61 +50,61 @@
class="org.eclipse.jdt.internal.corext.template.java.LocalVarResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.LocalVar.description"
- name="%templates.java.resolvers.LocalVar.name"
+ name="Local Variable"
type="localVar"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.VarResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.Var.description"
- name="%templates.java.resolvers.Var.name"
+ name="Variable"
type="var"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.NameResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.Name.description"
- name="%templates.java.resolvers.Name.name"
+ name="New Name"
type="newName"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.TypeResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.Type.description"
- name="%templates.java.resolvers.Type.name"
+ name="New Type"
type="newType"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.ElementTypeResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.ElementType.description"
- name="%templates.java.resolvers.ElementType.name"
+ name="Element Type"
type="elemType"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.TypeVariableResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.ArgumentType.description"
- name="%templates.java.resolvers.ArgumentType.name"
+ name="Argument Type"
type="argType"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.LinkResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.Link.description"
- name="%templates.java.resolvers.Link.name"
+ name="Linked Mode"
type="link"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.ImportsResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.Imports.description"
- name="%templates.java.resolvers.Imports.name"
+ name="Import"
type="import"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.StaticImportResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.ImportStatic.description"
- name="%templates.java.resolvers.ImportStatic.name"
+ name="Import Static"
type="importStatic"/>
<resolver
class="org.eclipse.jdt.internal.corext.template.java.ExceptionVariableNameResolver"
contextTypeId="e4-members"
description="%templates.java.resolvers.ExceptionVariableName.description"
- name="%templates.java.resolvers.ExceptionVariableName.name"
+ name="Exception Variable Name"
type="exception_variable_name">
</resolver>
</extension>
diff --git a/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.properties b/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.properties
deleted file mode 100644
index e69de29b..00000000
--- a/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.properties
+++ /dev/null
diff --git a/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.xml b/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.xml
index f8cf7dc5..2f6c5404 100644
--- a/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.xml
+++ b/bundles/org.eclipse.e4.tools.jdt.templates/templates/default-e4templates.xml
@@ -16,33 +16,40 @@
<templates>
-<template name="inject-parent" description="Injected Parent Composite" id="org.eclipse.e4.tools.jdt.templates.parent" context="e4-members" enabled="true" autoinsert="false">@Inject
-Composite parent;</template>
+<template name="Inject - Composite" description="Injected Parent Composite" id="org.eclipse.e4.tools.jdt.templates.parent" context="e4-members" enabled="true" autoinsert="false">@Inject
+Composite parent;
+${imp:import(javax.inject.Inject)}
+</template>
-<template name="inject-preference" description="Injected Preference Value" id="org.eclipse.e4.tools.jdt.templates.preference" context="e4-members" enabled="true" autoinsert="false">@Inject
+<template name="Inject - Preference Value" description="Injected Preference Value" id="org.eclipse.e4.tools.jdt.templates.preference" context="e4-members" enabled="true" autoinsert="false">@Inject
void setPreferenceValue(@Named("preference-PREFERENCE_KEY") String preferenceValue) {
${cursor}
}</template>
-<template name="inject-preferences" description="Injected Preferences Service" id="org.eclipse.e4.tools.jdt.templates.preferences" context="e4-members" enabled="true" autoinsert="false">@Inject
+<template name="Inject - Preferences" description="Injected Preferences Service" id="org.eclipse.e4.tools.jdt.templates.preferences" context="e4-members" enabled="true" autoinsert="false">@Inject
IEclipsePreferences preferences;</template>
-<template name="inject-logger" description="Injected Logger" id="org.eclipse.e4.tools.jdt.templates.logger" context="e4-members" enabled="true" autoinsert="false">@Inject
+<template name="Inject - Logger" description="Injected Logger" id="org.eclipse.e4.tools.jdt.templates.logger" context="e4-members" enabled="true" autoinsert="false">@Inject
Logger logger;</template>
-<template name="inject-eventbroker" description="Injected Event Broker" id="org.eclipse.e4.tools.jdt.templates.eventbroker" context="e4-members" enabled="true" autoinsert="false">@Inject
-IEventBroker eventBroker;</template>
+<template name="Inject - Eventbroker" description="Injected Event Broker" id="org.eclipse.e4.tools.jdt.templates.eventbroker" context="e4-members" enabled="true" autoinsert="false">@Inject
+IEventBroker eventBroker;
+${imp:import(org.eclipse.e4.core.services.events.IEventBroker)}
+</template>
-<template name="inject-stylingengine" description="Injected Styling Engine" id="org.eclipse.e4.tools.jdt.templates.stylingengine" context="e4-members" enabled="true" autoinsert="false">@Inject
-IStylingEngine stylingEngine;</template>
-<template name="ininjectject-event" description="Event Handler Method" id="org.eclipse.e4.tools.jdt.templates.eventhandler" context="e4-members" enabled="true" autoinsert="false">@EventHandler("some/event/topic")
+<template name="Injectject - Event" description="Event Handler Method" id="org.eclipse.e4.tools.jdt.templates.eventhandler" context="e4-members" enabled="true" autoinsert="false">@EventHandler("some/event/topic")
void handleSomeEvent(Payload payloadObject) {
${cursor}
}</template>
+<template name="Inject - Styling Engine" description="Injected Styling Engine" id="org.eclipse.e4.tools.jdt.templates.stylingengine" context="e4-members" enabled="true" autoinsert="false">@Inject
+IStylingEngine stylingEngine;</template>
+
+
<template name="PostConstruct" description="Creates @PostConstruct method" id="org.eclipse.e4.tools.jdt.templates.init" context="e4-members" enabled="true" autoinsert="false">@PostConstruct
public void postConstruct(${type:newType(org.eclipse.swt.widgets.Composite)} parent) {
+ ${cursor}
}
${imp:import(javax.annotation.PostConstruct)}
</template>

Back to the top