Skip to content

Instantly share code, notes, and snippets.

@luiscberrocal
Created October 9, 2011 15:03
Show Gist options
  • Save luiscberrocal/1273781 to your computer and use it in GitHub Desktop.
Save luiscberrocal/1273781 to your computer and use it in GitHub Desktop.
Eclipse Templates
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<templates>
<template autoinsert="true" context="java" deleted="false" description="Debug log" enabled="true" name="debug_log">Log.d(TAG + ".${enclosing_method}:" + Thread.currentThread().getStackTrace()[2].getLineNumber(), ${msg});</template>
<template autoinsert="true" context="java" deleted="false" description="Singleton pattern" enabled="true" name="singleton">private static ${enclosing_type} instance;
public static ${enclosing_type} getInstance(){
if(instance == null){
instance = new ${enclosing_type}();
}
return instance;
}</template>
<template autoinsert="true" context="java" deleted="false" description="Inserts the tag with de class name" enabled="true" name="tag_android">public static String TAG = "${enclosing_type}";</template>
<template autoinsert="false" context="java-members" deleted="false" description="test method" enabled="true" id="org.eclipse.jdt.ui.templates.test" name="test">public void test${name}() throws Exception {
${cursor}
}</template>
<template autoinsert="true" context="java" deleted="false" description="" enabled="true" name="test_log_method">Log.d(TAG, "**${enclosing_type}.${enclosing_method}");</template>
</templates>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment