Mercurial > projects > dwt-addons
comparison dwtx/jface/text/templates/GlobalTemplateVariables.d @ 162:1a5b8f8129df
...
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 08 Sep 2008 00:51:37 +0200 |
parents | 000f9136b8f7 |
children |
comparison
equal
deleted
inserted
replaced
161:f8d52b926852 | 162:1a5b8f8129df |
---|---|
33 import dwtx.jface.text.templates.TemplateVariableResolver; // packageimport | 33 import dwtx.jface.text.templates.TemplateVariableResolver; // packageimport |
34 | 34 |
35 | 35 |
36 import dwt.dwthelper.utils; | 36 import dwt.dwthelper.utils; |
37 | 37 |
38 import com.ibm.icu.text.DateFormat; | 38 // import com.ibm.icu.text.DateFormat; |
39 import com.ibm.icu.util.Calendar; | 39 // import com.ibm.icu.util.Calendar; |
40 | 40 |
41 /** | 41 /** |
42 * Global variables which are available in any context. | 42 * Global variables which are available in any context. |
43 * <p> | 43 * <p> |
44 * Clients may instantiate the classes contained within this class. | 44 * Clients may instantiate the classes contained within this class. |
136 */ | 136 */ |
137 public this() { | 137 public this() { |
138 super("date", TextTemplateMessages.getString("GlobalVariables.variable.description.date")); //$NON-NLS-1$ //$NON-NLS-2$ | 138 super("date", TextTemplateMessages.getString("GlobalVariables.variable.description.date")); //$NON-NLS-1$ //$NON-NLS-2$ |
139 } | 139 } |
140 protected String resolve(TemplateContext context) { | 140 protected String resolve(TemplateContext context) { |
141 return DateFormat.getDateInstance().format(new java.util.Date()); | 141 implMissing(__FILE__,__LINE__); |
142 return null; | |
143 //return DateFormat.getDateInstance().format(new java.util.Date()); | |
142 } | 144 } |
143 } | 145 } |
144 | 146 |
145 /** | 147 /** |
146 * The year variable evaluates to the current year. | 148 * The year variable evaluates to the current year. |
151 */ | 153 */ |
152 public this() { | 154 public this() { |
153 super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$ | 155 super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$ |
154 } | 156 } |
155 protected String resolve(TemplateContext context) { | 157 protected String resolve(TemplateContext context) { |
156 return Integer.toString(Calendar.getInstance().get(Calendar.YEAR)); | 158 implMissing(__FILE__,__LINE__); |
159 return null; | |
160 //return Integer.toString(Calendar.getInstance().get(Calendar.YEAR)); | |
157 } | 161 } |
158 } | 162 } |
159 | 163 |
160 /** | 164 /** |
161 * The time variable evaluates to the current time. | 165 * The time variable evaluates to the current time. |
170 | 174 |
171 /** | 175 /** |
172 * {@inheritDoc} | 176 * {@inheritDoc} |
173 */ | 177 */ |
174 protected String resolve(TemplateContext context) { | 178 protected String resolve(TemplateContext context) { |
175 return DateFormat.getTimeInstance().format(new java.util.Date()); | 179 implMissing(__FILE__,__LINE__); |
180 return null; | |
181 //return DateFormat.getTimeInstance().format(new java.util.Date()); | |
176 } | 182 } |
177 } | 183 } |
178 | 184 |
179 /** | 185 /** |
180 * The user variable evaluates to the current user. | 186 * The user variable evaluates to the current user. |