for (int i= 0; i < variables.length; i++) { TemplatePosition position= variables[i]; if (position.getName().equals(JavaTemplateMessages.getString("GlobalVariables.variable.name.cursor"))) { if (position.getOffsets().length > 1) { fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.multiple.cursor.variables"); return null; } } }
	public TemplateBuffer translate(String string) throws CoreException {	    fBuffer.setLength(0);	    fOffsets.clear();	    fLengths.clear();	    fState= TEXT;	    fErrorMessage= null;	    		if (!parse(string))			return null;					switch (fState) {		case TEXT:			break;				// illegal, but be tolerant		case ESCAPE:			fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.incomplete.variable"); //$NON-NLS-1$			fBuffer.append(ESCAPE_CHARACTER);			return null;						// illegal, but be tolerant		case IDENTIFIER:			fErrorMessage= TemplateMessages.getString("TemplateTranslator.error.incomplete.variable"); //$NON-NLS-1$			fBuffer.append(ESCAPE_CHARACTER);			return null;				}							int[] offsets= new int[fOffsets.size()];		int[] lengths= new int[fLengths.size()];				for (int i= 0; i < fOffsets.size(); i++) {			offsets[i]= ((Integer) fOffsets.get(i)).intValue();			lengths[i]= ((Integer) fLengths.get(i)).intValue();		}		String translatedString= fBuffer.toString();		TemplatePosition[] variables= findVariables(translatedString, offsets, lengths);		return new TemplateBuffer(translatedString, variables);	}