comparison dwtx/jface/text/templates/GlobalTemplateVariables.d @ 133:7d818bd32d63

Fix ctors to this with gvim regexp
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 01:29:22 +0200
parents c4fb132a086c
children 000f9136b8f7
comparison
equal deleted inserted replaced
132:77bd3bb3d7b8 133:7d818bd32d63
60 public static final String NAME= "cursor"; //$NON-NLS-1$ 60 public static final String NAME= "cursor"; //$NON-NLS-1$
61 61
62 /** 62 /**
63 * Creates a new cursor variable 63 * Creates a new cursor variable
64 */ 64 */
65 public Cursor() { 65 public this() {
66 super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.cursor")); //$NON-NLS-1$ 66 super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.cursor")); //$NON-NLS-1$
67 setEvaluationString(""); //$NON-NLS-1$ 67 setEvaluationString(""); //$NON-NLS-1$
68 } 68 }
69 } 69 }
70 70
78 public static final String NAME= "word_selection"; //$NON-NLS-1$ 78 public static final String NAME= "word_selection"; //$NON-NLS-1$
79 79
80 /** 80 /**
81 * Creates a new word selection variable 81 * Creates a new word selection variable
82 */ 82 */
83 public WordSelection() { 83 public this() {
84 super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedWord")); //$NON-NLS-1$ 84 super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedWord")); //$NON-NLS-1$
85 } 85 }
86 protected String resolve(TemplateContext context) { 86 protected String resolve(TemplateContext context) {
87 String selection= context.getVariable(SELECTION); 87 String selection= context.getVariable(SELECTION);
88 if (selection is null) 88 if (selection is null)
101 public static final String NAME= "line_selection"; //$NON-NLS-1$ 101 public static final String NAME= "line_selection"; //$NON-NLS-1$
102 102
103 /** 103 /**
104 * Creates a new line selection variable 104 * Creates a new line selection variable
105 */ 105 */
106 public LineSelection() { 106 public this() {
107 super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedLines")); //$NON-NLS-1$ 107 super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedLines")); //$NON-NLS-1$
108 } 108 }
109 protected String resolve(TemplateContext context) { 109 protected String resolve(TemplateContext context) {
110 String selection= context.getVariable(SELECTION); 110 String selection= context.getVariable(SELECTION);
111 if (selection is null) 111 if (selection is null)
119 */ 119 */
120 public static class Dollar : SimpleTemplateVariableResolver { 120 public static class Dollar : SimpleTemplateVariableResolver {
121 /** 121 /**
122 * Creates a new dollar variable 122 * Creates a new dollar variable
123 */ 123 */
124 public Dollar() { 124 public this() {
125 super("dollar", TextTemplateMessages.getString("GlobalVariables.variable.description.dollar")); //$NON-NLS-1$ //$NON-NLS-2$ 125 super("dollar", TextTemplateMessages.getString("GlobalVariables.variable.description.dollar")); //$NON-NLS-1$ //$NON-NLS-2$
126 setEvaluationString("$"); //$NON-NLS-1$ 126 setEvaluationString("$"); //$NON-NLS-1$
127 } 127 }
128 } 128 }
129 129
132 */ 132 */
133 public static class Date : SimpleTemplateVariableResolver { 133 public static class Date : SimpleTemplateVariableResolver {
134 /** 134 /**
135 * Creates a new date variable 135 * Creates a new date variable
136 */ 136 */
137 public Date() { 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 return DateFormat.getDateInstance().format(new java.util.Date());
142 } 142 }
147 */ 147 */
148 public static class Year : SimpleTemplateVariableResolver { 148 public static class Year : SimpleTemplateVariableResolver {
149 /** 149 /**
150 * Creates a new year variable 150 * Creates a new year variable
151 */ 151 */
152 public Year() { 152 public this() {
153 super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$ 153 super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$
154 } 154 }
155 protected String resolve(TemplateContext context) { 155 protected String resolve(TemplateContext context) {
156 return Integer.toString(Calendar.getInstance().get(Calendar.YEAR)); 156 return Integer.toString(Calendar.getInstance().get(Calendar.YEAR));
157 } 157 }
162 */ 162 */
163 public static class Time : SimpleTemplateVariableResolver { 163 public static class Time : SimpleTemplateVariableResolver {
164 /** 164 /**
165 * Creates a new time variable 165 * Creates a new time variable
166 */ 166 */
167 public Time() { 167 public this() {
168 super("time", TextTemplateMessages.getString("GlobalVariables.variable.description.time")); //$NON-NLS-1$ //$NON-NLS-2$ 168 super("time", TextTemplateMessages.getString("GlobalVariables.variable.description.time")); //$NON-NLS-1$ //$NON-NLS-2$
169 } 169 }
170 170
171 /** 171 /**
172 * {@inheritDoc} 172 * {@inheritDoc}
181 */ 181 */
182 public static class User : SimpleTemplateVariableResolver { 182 public static class User : SimpleTemplateVariableResolver {
183 /** 183 /**
184 * Creates a new user name variable 184 * Creates a new user name variable
185 */ 185 */
186 public User() { 186 public this() {
187 super("user", TextTemplateMessages.getString("GlobalVariables.variable.description.user")); //$NON-NLS-1$ //$NON-NLS-2$ 187 super("user", TextTemplateMessages.getString("GlobalVariables.variable.description.user")); //$NON-NLS-1$ //$NON-NLS-2$
188 } 188 }
189 189
190 /** 190 /**
191 * {@inheritDoc} 191 * {@inheritDoc}