Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2005 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: IBM Corporation - initial API and implementation /
package org.eclipse.ant.internal.ui.editor.templates;
Looks up existing ant variables and proposes them. The proposals are sorted by their prefix-likeness with the variable type.
	/*
	 * @see org.eclipse.jface.text.templates.TemplateVariableResolver#resolveAll(org.eclipse.jface.text.templates.TemplateContext)
	 */
	protected String[] resolveAll(TemplateContext context) {
		String[] proposalsnew String[] { "${srcDir}""${dstDir}" }; //$NON-NLS-1$ //$NON-NLS-2$
		Arrays.sort(proposalsnew Comparator() {
			public int compare(Object o1Object o2) {
			}
			private int getCommonPrefixLength(String typeString var) {
				int i= 0;
				CharSequence vSeqvar.subSequence(2, var.length() - 1); // strip away ${}
				while (i < type.length() && i < vSeq.length())
					if (Character.toLowerCase(type.charAt(i)) == Character.toLowerCase(vSeq.charAt(i)))
						i++;
					else
						break;
				return i;
			}
		});
		return proposals;
	}
New to GrepCode? Check out our FAQ X