blob: 9fc878bf7afaf55cf1c3a2d624c428c5e7301dc3 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*******************************************************************************
* Copyright (c) 2010, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Boris Bokowski, IBM Corporation - initial API and implementation
* Lars Vogel <Lars.Vogel@vogella.com> - Ongoing maintenance
*******************************************************************************/
-->
<templates>
<template name="Inject - Preference value as method injection" 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 service as field" 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 service as field" 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 service as field" 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 - ESelection service as field" description="Injected ESEectionService" id="org.eclipse.e4.tools.jdt.templates.selectionservice" context="e4-members" enabled="true" autoinsert="false">@Inject
ESelectionService selectionService;
${imp:import(org.eclipse.e4.ui.workbench.modeling.ESelectionService)}
</template>
<template name="Inject - Subscribe to event topic via method" description="Event Handler Method" id="org.eclipse.e4.tools.jdt.templates.eventhandler" context="e4-members" enabled="true" autoinsert="false">@EventHandler("some/event/topic")
void subscribeTopic(String string) {
${cursor}
}</template>
<template name="Inject - IStylingEngine service as field" 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>
<template name="Focus" description="Creates @Focus method" id="org.eclipse.e4.tools.jdt.templates.focus" context="e4-members" enabled="true" autoinsert="false">@Focus
public void onFocus() {
}
${imp:import(org.eclipse.e4.ui.di.Focus)}
</template>
<template name="PreDestroy" description="Creates @PreDestroy method" id="org.eclipse.e4.tools.jdt.templates.dispose" context="e4-members" enabled="true" autoinsert="false">@PreDestroy
public void preDestroy() {
}
${imp:import(javax.annotation.PreDestroy)}
</template>
<template name="Execute" description="Creates Execute method" id="org.eclipse.e4.tools.jdt.templates.execute" context="e4-members" enabled="true" autoinsert="false">@Execute
public void execute() {
}
${imp:import(org.eclipse.e4.core.di.annotations.Execute)}
</template>
<template name="CanExecute" description="Creates CanExecute method" id="org.eclipse.e4.tools.jdt.templates.canexecute" context="e4-members" enabled="true" autoinsert="false">@CanExecute
public boolean canExecute() {
return true;
}
${imp:import(org.eclipse.e4.core.di.annotations.CanExecute)}
</template>
</templates>