Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 75981 | Differences between
and this patch

Collapse All | Expand All

(-)Ant Editor/org/eclipse/ant/internal/ui/editor/templates/BuildFileContextType.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 35-40 Link Here
35
		addResolver(new GlobalTemplateVariables.LineSelection());
35
		addResolver(new GlobalTemplateVariables.LineSelection());
36
		addResolver(new GlobalTemplateVariables.Dollar());
36
		addResolver(new GlobalTemplateVariables.Dollar());
37
		addResolver(new GlobalTemplateVariables.Date());
37
		addResolver(new GlobalTemplateVariables.Date());
38
		addResolver(new GlobalTemplateVariables.DayOfMonth());
39
		addResolver(new GlobalTemplateVariables.Month());
38
		addResolver(new GlobalTemplateVariables.Year());
40
		addResolver(new GlobalTemplateVariables.Year());
39
		addResolver(new GlobalTemplateVariables.Time());
41
		addResolver(new GlobalTemplateVariables.Time());
40
		addResolver(new GlobalTemplateVariables.User());
42
		addResolver(new GlobalTemplateVariables.User());
(-)core extension/org/eclipse/jdt/internal/corext/template/java/AbstractJavaContextType.java (+2 lines)
Lines 315-320 Link Here
315
		addResolver(new GlobalTemplateVariables.LineSelection());
315
		addResolver(new GlobalTemplateVariables.LineSelection());
316
		addResolver(new GlobalTemplateVariables.Dollar());
316
		addResolver(new GlobalTemplateVariables.Dollar());
317
		addResolver(new GlobalTemplateVariables.Date());
317
		addResolver(new GlobalTemplateVariables.Date());
318
		addResolver(new GlobalTemplateVariables.DayOfMonth());
319
		addResolver(new GlobalTemplateVariables.Month());
318
		addResolver(new GlobalTemplateVariables.Year());
320
		addResolver(new GlobalTemplateVariables.Year());
319
		addResolver(new GlobalTemplateVariables.Time());
321
		addResolver(new GlobalTemplateVariables.Time());
320
		addResolver(new GlobalTemplateVariables.User());
322
		addResolver(new GlobalTemplateVariables.User());
(-)core extension/org/eclipse/jdt/internal/corext/template/java/JavaDocContextType.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 38-43 Link Here
38
		addResolver(new GlobalTemplateVariables.WordSelection());
38
		addResolver(new GlobalTemplateVariables.WordSelection());
39
		addResolver(new GlobalTemplateVariables.Dollar());
39
		addResolver(new GlobalTemplateVariables.Dollar());
40
		addResolver(new GlobalTemplateVariables.Date());
40
		addResolver(new GlobalTemplateVariables.Date());
41
		addResolver(new GlobalTemplateVariables.DayOfMonth());
42
		addResolver(new GlobalTemplateVariables.Month());
41
		addResolver(new GlobalTemplateVariables.Year());
43
		addResolver(new GlobalTemplateVariables.Year());
42
		addResolver(new GlobalTemplateVariables.Time());
44
		addResolver(new GlobalTemplateVariables.Time());
43
		addResolver(new GlobalTemplateVariables.User());
45
		addResolver(new GlobalTemplateVariables.User());
(-)core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplateContextType.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 166-171 Link Here
166
		// global
166
		// global
167
		addResolver(new GlobalTemplateVariables.Dollar());
167
		addResolver(new GlobalTemplateVariables.Dollar());
168
		addResolver(new GlobalTemplateVariables.Date());
168
		addResolver(new GlobalTemplateVariables.Date());
169
		addResolver(new GlobalTemplateVariables.DayOfMonth());
170
		addResolver(new GlobalTemplateVariables.Month());
169
		addResolver(new GlobalTemplateVariables.Year());
171
		addResolver(new GlobalTemplateVariables.Year());
170
		addResolver(new GlobalTemplateVariables.Time());
172
		addResolver(new GlobalTemplateVariables.Time());
171
		addResolver(new GlobalTemplateVariables.User());
173
		addResolver(new GlobalTemplateVariables.User());
(-)reference/ref-preferences-template-variables.htm (+8 lines)
Lines 52-57 Link Here
52
          <td>Evaluates to the current date.</td>
52
          <td>Evaluates to the current date.</td>
53
        </tr>
53
        </tr>
54
        <tr>
54
        <tr>
55
          <td><strong>${day_of_month}</strong></td>
56
          <td>Evaluates to the current day of month.</td>
57
        </tr>
58
        <tr>
55
          <td><strong>${dollar}</strong></td>
59
          <td><strong>${dollar}</strong></td>
56
          <td>Evaluates to the dollar symbol '$'. Alternatively, two dollars can be used: '$$'.</td>
60
          <td>Evaluates to the dollar symbol '$'. Alternatively, two dollars can be used: '$$'.</td>
57
        </tr>
61
        </tr>
Lines 84-89 Link Here
84
          <td>Evaluates to content of all currently selected lines.</td>
88
          <td>Evaluates to content of all currently selected lines.</td>
85
        </tr>
89
        </tr>
86
        <tr>
90
        <tr>
91
          <td><strong>${month}</strong></td>
92
          <td>Evaluates to the current month.</td>
93
        </tr>
94
        <tr>
87
          <td><strong>${primary_type_name}</strong></td>
95
          <td><strong>${primary_type_name}</strong></td>
88
          <td>Evaluates to the name primary type of the current compilation unit.</td>
96
          <td>Evaluates to the name primary type of the current compilation unit.</td>
89
        </tr>
97
        </tr>
(-)src/org/eclipse/jface/text/templates/TextTemplateMessages.properties (-1 / +3 lines)
Lines 1-5 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2000, 2006 IBM Corporation and others.
2
# Copyright (c) 2000, 2008 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
5
# which accompanies this distribution, and is available at
Lines 18-23 Link Here
18
GlobalVariables.variable.description.cursor=The cursor position after editing template variables
18
GlobalVariables.variable.description.cursor=The cursor position after editing template variables
19
GlobalVariables.variable.description.dollar=The dollar symbol
19
GlobalVariables.variable.description.dollar=The dollar symbol
20
GlobalVariables.variable.description.date=Current date
20
GlobalVariables.variable.description.date=Current date
21
GlobalVariables.variable.description.dayOfMonth=Current day of month
22
GlobalVariables.variable.description.month=Current month
21
GlobalVariables.variable.description.year=Current year
23
GlobalVariables.variable.description.year=Current year
22
GlobalVariables.variable.description.time=Current time
24
GlobalVariables.variable.description.time=Current time
23
GlobalVariables.variable.description.user=User name
25
GlobalVariables.variable.description.user=User name
(-)src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java (-1 / +41 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 119-124 Link Here
119
	}
119
	}
120
120
121
	/**
121
	/**
122
	 * The day of month variable evaluates to the current day of the month.
123
	 */
124
	public static class DayOfMonth extends SimpleTemplateVariableResolver {
125
		
126
		/** Name of the day of month variable. */
127
		public static final String NAME = "day_of_month"; //$NON-NLS-1$
128
		
129
		/**
130
		 * Creates a new day of month variable
131
		 */
132
		public DayOfMonth() {
133
			super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.dayOfMonth")); //$NON-NLS-1$
134
		}
135
		protected String resolve(TemplateContext context) {
136
			String dayOfMonth = Integer.toString(Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
137
			return dayOfMonth.length() > 1 ? dayOfMonth : "0" + dayOfMonth; //$NON-NLS-1$
138
		}
139
	}
140
	
141
	/**
142
	 * The month variable evaluates to the current month.
143
	 */
144
	public static class Month extends SimpleTemplateVariableResolver {
145
		
146
		/** Name of the month variable. */
147
		public static final String NAME = "month"; //$NON-NLS-1$
148
		
149
		/**
150
		 * Creates a new month variable
151
		 */
152
		public Month() {
153
			super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.month")); //$NON-NLS-1$
154
		}
155
		protected String resolve(TemplateContext context) {
156
			String month = Integer.toString(Calendar.getInstance().get(Calendar.MONTH) + 1);
157
			return month.length() > 1 ? month : "0" + month; //$NON-NLS-1$
158
		}
159
	}
160
	
161
	/**
122
	 * The year variable evaluates to the current year.
162
	 * The year variable evaluates to the current year.
123
	 */
163
	 */
124
	public static class Year extends SimpleTemplateVariableResolver {
164
	public static class Year extends SimpleTemplateVariableResolver {

Return to bug 75981